[wf] Fix Workflow.replace_state() [applied]