def create(self, data, commit_sha, status_url, du_id):
        db_obj = objects.registry.Workflow()
        db_obj.id = str(uuid.uuid4())
        db_obj.user_id = self.context.user
        db_obj.project_id = self.context.tenant
        db_obj.deleted = False

        db_obj.app_id = data['app_id']
        db_obj.source = data['source']
        db_obj.config = data['config']
        db_obj.actions = data['actions']

        now = datetime.datetime.utcnow()
        db_obj.created_at = now
        db_obj.updated_at = now

        app_obj = objects.registry.App.get_by_id(self.context,
                                                 db_obj.app_id)

        self._update_app_scale_config(app_obj, data)

        plan, assem = PlanAssemblyAdapter(self.context,
                                          db_obj,
                                          app_obj).create_dummies()

        db_obj.assembly = assem.id

        workflow.Workflow.insert(self.context, db_obj)

        self._execute_workflow_actions(db_obj, app_obj, assem,
                                       commit_sha=app_obj.source['revision'],
                                       du_id=du_id)

        # TODO(devkulkarni): Update status of actions

        return db_obj
Create a new workflow.
dataset/ETHPy150Open openstack/solum/solum/api/handlers/workflow_handler.py/WorkflowHandler.create