PetalStateMachine: define workflow with state machine