Extract method assign_workflow to solve issue #92