def create_workflow(self, start=True): # create new workflow workflow = Workflow.create(WORKFLOW_SPEC_NAME, operator=self.operator) workflow.ref_unique_id = "approve-%d" % self._approve.id if start: workflow.start() self._approve.workflow = workflow.get_id() self._approve.save() return workflow