API reference

Workflow executions

Follow one contact's run through a workflow, cancel it, or resend its webhook.

A workflow execution follows one contact through a published workflow version. It is created by Run a workflow for one contact or when a workflow campaign dispatches an entry. Do not confuse it with a call execution: one workflow execution can place several calls, each with its own call execution.

All routes need Authorization: Bearer <key>. Errors use the workflow error body {"detail": {"code": "...", "message": "..."}} described in Workflows. An unknown or foreign id answers 404 with code not_found and message Execution not found.

OperationMethod and path
Get a workflow executionGET /workflow-executions/{execution_id}
Cancel a workflow executionPOST /workflow-executions/{execution_id}:cancel
Resend the webhookPOST /workflow-executions/{execution_id}/webhook:resend

Ids and statuses

An execution id has the form exec:<campaign_id>:<reference_id>. You can put it in the path as it is, or URL-encode the colons; both work.

StatusMeaning
pendingCreated, not started yet.
runningMoving through the nodes, or waiting on a call, a delay or a retry.
completedReached an end node. outcome is that node's success, failure or neutral.
failedStopped by an error.
cancelledCancelled through the API.
abortedIts campaign was aborted.

The last four are final. When an execution reaches a final status, the platform posts an execution.terminal payload to the workflow's webhook, if one is set.

Operations

Get a workflow execution

GET /workflow-executions/{execution_id}

Returns an execution with its state, the node attempts made so far and its most recent events.

Auth: API key or session token. Role: viewer and up.

ParameterInTypeRequiredDescription
execution_idpathstringyesThe execution id.

Request

bash
curl "https://api.sevennadi.si/workflow-executions/exec:7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9:loan-1042" \
  -H "Authorization: Bearer vk-0123456789abcdef0123456789abcdef"

Response 200 OK

json
{
  "id": "exec:7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9:loan-1042",
  "campaign_id": "7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9",
  "status": "completed",
  "current_node_id": "n_end_reached",
  "termination_reason": "reached",
  "outcome": "success",
  "call_count": 1,
  "created_at": "2026-10-13T09:00:00Z",
  "updated_at": "2026-10-13T09:02:10Z",
  "state": {},
  "nodes": [
    {"node_id": "n_start", "node_type": "start", "attempt": 1, "status": "completed", "to_node_id": "n_call", "matched_case_index": 0},
    {"node_id": "n_call", "node_type": "agent", "attempt": 1, "status": "completed", "to_node_id": "n_end_reached", "matched_case_index": 0,
     "outputs": {"call.status": "completed", "call.duration_s": 60}},
    {"node_id": "n_end_reached", "node_type": "end", "attempt": 1, "status": "completed"}
  ],
  "events": []
}
FieldDescription
current_node_idThe node the execution is on, or ended on.
termination_reasonFor a completed execution, the label of the end node. Otherwise a reason such as cancelled or campaign_aborted.
outcomesuccess, failure or neutral. Absent when the execution did not reach an end node.
call_countCalls placed so far.
stateValues written by set_value effects.
nodesOne entry per node attempt, in order. Each may also carry scheduled_for, created_at and updated_at.
eventsThe latest 100 events of the execution.

Fields with no value are left out.

Errors

StatusCodeMessage
404not_foundExecution not found

Cancel a workflow execution

POST /workflow-executions/{execution_id}:cancel

Cancels an execution that has not finished. It ends with the status cancelled and sends its webhook. Cancelling an execution that is already final succeeds and changes nothing; the response shows its existing status.

Auth: API key or session token. Role: member and up.

ParameterInTypeRequiredDescription
execution_idpathstringyesThe execution id.
reasonbodystringnoA note recorded in the execution's events. The body itself is optional.

Request

bash
curl -X POST "https://api.sevennadi.si/workflow-executions/exec:7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9:loan-1043:cancel" \
  -H "Authorization: Bearer vk-0123456789abcdef0123456789abcdef" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Customer paid at the branch"}'

Response 200 OK

json
{"status": "cancelled"}

Errors

StatusCodeMessage
404not_foundExecution not found
422validation_failedreason must be a string

Resend the webhook

POST /workflow-executions/{execution_id}/webhook:resend

Queues the execution's original final payload for the workflow's webhook again. Use it after your receiver was down. The payload is the one built when the execution finished, delivered to whatever webhook URL the workflow has now.

Auth: API key or session token. Role: admin and up.

ParameterInTypeRequiredDescription
execution_idpathstringyesThe execution id.

Request

bash
curl -X POST "https://api.sevennadi.si/workflow-executions/exec:7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9:loan-1042/webhook:resend" \
  -H "Authorization: Bearer vk-0123456789abcdef0123456789abcdef"

Response 202 Accepted

json
{
  "execution_id": "exec:7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9:loan-1042",
  "webhook_url": "https://hooks.example.test/wf"
}

The payload that is delivered looks like this:

json
{
  "event": "execution.terminal",
  "schema_version": 1,
  "execution_id": "exec:7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9:loan-1042",
  "workflow_id": "2ab95da4-50dd-4492-a355-793ec7d810c5",
  "workflow_version": 1,
  "campaign_id": "7d6c5b4a-3928-4170-8695-a4b3c2d1e0f9",
  "reference_id": "loan-1042",
  "status": "completed",
  "termination_reason": "reached",
  "outcome": "success",
  "occurred_at": "2026-10-13T09:02:10Z",
  "trail": [
    {"node_id": "n_start", "node_type": "start", "attempt": 1, "status": "completed", "to_node_id": "n_call", "matched_case_index": 0, "inputs": {}, "outputs": {}}
  ]
}

trail has one entry per node attempt; it is shortened here.

Errors

StatusCodeMessage
403Standard body: Your role (member) can't change webhooks. It needs admin access; ask an owner or admin of the workspace.
404not_foundExecution not found
409not_finishedThe execution hasn't finished yet
409no_webhookThe workflow has no webhook configured
502queue_unavailableThe webhook could not be queued