MCPcopy Create free account
hub / github.com/diffgram/diffgram / workflow_view_api

Function workflow_view_api

default/methods/action/workflow.py:71–96  ·  view source on GitHub ↗

Get a single flow object based on id. Uses projecd id for security

(project_string_id, workflow_id)

Source from the content-addressed store, hash-verified

69@limiter.limit("1000 per day")
70@swag_from('../../docs/actions/workflow_view.yml')
71def workflow_view_api(project_string_id, workflow_id):
72 """
73
74 Get a single flow object based on id.
75 Uses projecd id for security
76
77 """
78 log = regular_log.default()
79 with sessionMaker.session_scope() as session:
80
81 project = Project.get(session, project_string_id)
82
83 ### MAIN
84 workflow = Workflow.get_by_id(
85 session=session,
86 id=workflow_id,
87 project_id=project.id)
88 ### END MAIN
89 if workflow is None:
90 log['error']['flow'] = "Invalid flow"
91 return jsonify(log=log), 400
92
93 log['success'] = True
94 out = jsonify(workflow=workflow.serialize_with_actions(session = session),
95 log=log)
96 return out, 200
97
98
99# VIEW LIST

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
get_by_idMethod · 0.45

Tested by

no test coverage detected