Workflow engine in python