Added state-machine-based workflow