[wf] separate pattern detection from autogrouping