We define permutree sorting which generalizes the stack sorting and Coxeter sorting algorithms respectively due to Knuth and Reading. It consists of an algorithm that succeeds for a permutation if and only it is minimal in its permutree class or equivalently, avoids certain patterns. We present this algorithm through automata that read reduced expressions and accept only those that form a specific structure within the weak order. This is joint work with Vincent Pilaud and Viviane Pons.