Workflow Runs

Documentation for Workflow Runs

Base path: /api/v1/workflow-runs

A workflow run is a single execution instance of a workflow. You can execute workflows, monitor their progress in real time via SSE, and cancel runs.

Note: The list, get, dashboard stats, and cancel endpoints use privateSvcAuthMiddleware, meaning they accept either a valid JWT (for user-facing calls proxied through the backend) or a private-IP / trusted internal call. Frontend applications should proxy these through their own backend rather than calling them directly with a JWT.


Endpoints Overview

MethodPathAuthDescription
POST/api/v1/workflow-runs/executeJWT or internalExecute a workflow (blocking)
POST/api/v1/workflow-runs/execute/streamJWT or internalExecute a workflow (SSE stream)
POST/api/v1/workflow-runs/cancelJWT or internalCancel one or more runs
GET/api/v1/workflow-runsJWT or internalList workflow runs
GET/api/v1/workflow-runs/dashboard/:workflowIdJWT or internalGet run counts by status
GET/api/v1/workflow-runs/:runIdJWT or internalGet a single run with activity runs

POST /api/v1/workflow-runs/execute

Executes a workflow synchronously (blocking). Waits for the workflow to complete before returning the result.

Warning: This can be long-running. For UI applications, prefer the streaming endpoint instead.

Request Body (multipart/form-data)

FieldTypeRequiredDefaultDescription
workflowIdstring (UUID)Yes–ID of the workflow to execute
inputsJSON objectNo{}Input values keyed by input name
envsJSON objectNo{}Environment variable overrides (string-to-string)
javascript

Response 200 OK

json

POST /api/v1/workflow-runs/execute/stream

Executes a workflow and streams real-time progress updates via SSE.

Request Body (multipart/form-data)

Same fields as the blocking execute endpoint: workflowId, inputs, envs.

Response

Returns an SSE stream (Content-Type: text/event-stream).

SSE Events:

EventData ShapeDescription
ping{ "content": "ping" }Keep-alive, every 9 seconds
activity-run{ "content": { "workflowRunId": "...", "status": "..." } }Activity (step) status update
workflow-run{ "content": { "workflowRunId": "...", "status": "..." } }Workflow run status update
thinking{ "content": "<text>", "stepId": "...", "activityRunId": "..." }AI reasoning trace for a step
result{ "success": true, "workflowRun": { ... } }Final result when complete
error{ "error": "...", "details": "..." }Execution failure

Example (JavaScript)

javascript

POST /api/v1/workflow-runs/cancel

Cancels one or more workflow runs. You can cancel by specific run IDs or cancel all runs for a workflow.

Request Body (JSON)

Provide either runIds or workflowId (not both).

FieldTypeRequiredDescription
runIdsstring[]No*Array of run IDs to cancel
workflowIdstring (UUID)No*Cancel all non-terminal runs for this workflow
reasonstringNoReason for cancellation (max 500 chars)

*At least one of runIds or workflowId must be provided.

json

Response 200 OK

json

Outcome status values:

StatusDescription
cancelledSuccessfully cancelled
already_completedRun was already in a terminal state (completed/failed)
not_eligibleRun was already cancelled or has no Temporal workflow
not_foundRun ID not found
errorCancellation failed (Temporal error)

GET /api/v1/workflow-runs

Lists workflow runs with optional filtering.

Query Parameters

ParameterTypeDefaultDescription
workflowIdstring (UUID)–Filter by workflow ID
statusstring–Filter by status: scheduled, running, completed, failed, cancelled, waiting
pagenumber1Page number
limitnumber10Items per page (min: 1, max: 100)
searchstring–Search by workflow name

Response 200 OK

json

Workflow run fields:

FieldTypeDescription
idstring (UUID)Run ID
workflowIdstring (UUID)Parent workflow ID
workflowNamestring | nullWorkflow name at time of run
statusstringRun status
inputsarrayInput values used for this run
createdAtstring (ISO 8601)When the run was created
updatedAtstring (ISO 8601)Last status update time

Run status values: scheduled, running, completed, failed, cancelled, waiting


GET /api/v1/workflow-runs/dashboard/:workflowId

Returns a count breakdown of runs by status for a specific workflow. Useful for dashboard widgets.

Path Parameters

ParameterTypeDescription
workflowIdstring (UUID)Workflow ID

Response 200 OK

json

GET /api/v1/workflow-runs/:runId

Returns a single workflow run including all its activity (step) runs.

Path Parameters

ParameterTypeDescription
runIdstring (UUID)Workflow run ID

Response 200 OK

json

Activity run fields:

FieldTypeDescription
idstring (UUID)Activity run ID
stepIdstringWorkflow step ID
stepNamestring | nullStep name
statusstringStep status
outputsobject | nullStep output data
attemptnumberRetry attempt number (1-indexed)
createdAtstring (ISO 8601)Start time
updatedAtstring (ISO 8601)Last update time
api-docs/workflow-runs