In plain terms: use these calls to look at one workflow, compare or restore its earlier versions, start it, stop its runs and list them. Starting a workflow is the call you will use most.
All responses use the envelope.
404 is returned for an unknown session or workflow.
Get a definition
GET /api/sessions/{sessionId}/workflows/{workflowId}
Returns the workflow as stored.
Response data: workflowId, description, nodes (each with nodeId, type, config) and edges (each with source, target, sourcePort).
Get the graph
GET /api/sessions/{sessionId}/workflows/{workflowId}/graph
Returns the nodes and edges enriched with what a canvas needs to draw them, plus the order in which nodes would run.
Response data
List the runs of one workflow
GET /api/sessions/{sessionId}/workflows/{workflowId}/executions
Returns run summaries of this workflow, newest first. An empty list means the workflow has never run. It takes limit and cursor and announces more pages in the X-Next-Cursor header; see paging.
Response data: an array of run summaries.
List saved versions
GET /api/sessions/{sessionId}/workflows/{workflowId}/versions
Every change to a workflow’s definition is saved as a version. The list is newest first and holds the newest 20 versions. Applying an unchanged definition does not create a version.
Response data: an array of versions.
Compare versions
GET /api/sessions/{sessionId}/workflows/{workflowId}/versions/diff
Compares an older version with a newer one, or with the current definition.
Response
data
Errors:
404 if a version does not exist; 400 if from is missing.
Roll back to a version
POST /api/sessions/{sessionId}/workflows/{workflowId}/rollback?version={id}
Makes an earlier version the current definition. The restored definition is saved as a new version, so you can undo the rollback the same way. Runs that have already started keep the definition they use.
Response
data: workflowId and version.
Errors: 404 if the version does not exist.
Write a version note
POST /api/sessions/{sessionId}/workflows/{workflowId}/versions/note
Writes a note on a saved version, for example what changed and why. A blank note clears it. The text is trimmed and at most 1000 characters (400 beyond that).
The query parameters
version and note still work, but a note in the URL ends up in access and proxy logs, so send the body.
Response data: workflowId, version and note.
Start a workflow
POST /api/workflow/start
Starts a run and returns its id at once. The run continues in the background; follow it with status or the streams. A start may wait in a queue when the execution limits are full; the run then reports QUEUED until it gets a slot.
Request body
Response
202 Accepted. data.executionId is the run id. With wait and an answer in time, 200 OK with data.reply too.
Errors: 404 unknown session or workflow, 400 a workflow that fails validation, 429 limit reached and no room to queue, 503 on a standby server.
Stop all runs of a workflow
POST /api/workflow/{sessionId}/{workflowId}/stop
Stops every active run of the workflow and cuts the trigger’s input stream, so no new messages arrive.
Response
data: executionIds, the runs that were signalled. To stop one run, use POST /api/executions/{executionId}/stop.
Errors: 400 for an unknown mode.
List the runs of a session
GET /api/workflow/{sessionId}/history
Returns the runs of every workflow in the session, newest first. It takes limit and cursor (see paging) and these filters. Every filter that is set must match.
Response
data: run summaries, as in the per-workflow list. How many runs the history keeps is set by yukta.execution-log.retained-runs (default 500).
Errors: 404 if the session does not exist.
Test a saved workflow with stubs
POST /api/sessions/{sessionId}/workflows/{workflowId}/test
Runs the saved workflow once and reports which assertions held. Triggers emit the input (or their stub), terminals do nothing, and a processor with a stub emits it instead of running. Every other processor runs for real, so stub each node with a side effect, or list the nodes that may run in allow.
Request body (all fields optional)
Response
data: passed (whether every assertion held), status (the final run status) and assertions, one { "name", "passed", "detail" } entry each; detail holds the actual value when an assertion failed. A failing assertion is still a 200 with passed: false.
Errors: 404 unknown workflow.
Test-run a draft
POST /api/sessions/{sessionId}/test-runs
Runs a draft workflow, a node and the nodes before it, or one node alone, without saving it. The run is invisible to history, search, recovery, supervisors and analytics. The nodes use the session’s project path, tags and credentials. Read its progress and node outputs through the executions endpoints.
Response
202 Accepted. data holds executionId and workflowId, the reserved workflow id the run uses; nothing is stored under it.
Errors: 404 unknown session, 400 with the problems when the part to run does not validate, 429 when the execution limit is reached.
Next steps
Executions API
Read the status and result of a run, search runs, stop, restart and recover them, and manage the execution queue.
Validation and versions
Check a workflow definition before it runs, and diff, annotate and roll back its saved versions.
Admission and limits
Concurrency caps, queueing or refusing excess starts, priority, fairness between sessions, idempotent starts and live limit changes.