Appearance
Workflow runs
Endpoints to control runs of workflow agents. Workflows are started with POST /v1/agents/{slug}/runs and cancelled with POST /v1/runs/{id}/cancel.
Retry a run
http
POST /v1/runs/{id}/retryScope: agents:run. No body. Re-executes a failed workflow run from its failed node(s): those nodes and everything downstream run again; nodes that succeeded keep their outputs.
Response 202:
json
{ "runId": "…", "status": "running" }| Status | Code | When |
|---|---|---|
| 409 | NOT_A_WORKFLOW_RUN | the run is not a workflow run |
| 409 | RUN_NOT_RETRYABLE | the run is not failed |
| 409 | RUN_ENDED_AT_FAIL_NODE | the run ended at a fail node (params.nodeId): a retry would end there again |
| 404 | NOT_FOUND | unknown run |
ts
await hevkar.runs.retry(runId);Decide an approval
http
POST /v1/runs/{id}/approvals/{nodeId}Scope: workflows:approve (not implied by agents:run). Approves or rejects the approval node nodeId of a waiting run.
| Body field | Type | Description |
|---|---|---|
decision | approve | reject | required; follows the approved or rejected edge |
data | any | replaces the node's output (the reviewed data) |
comment | string (≤ 5000) | stored with the decision |
Response 200: { "runId": "…", "status": "running" } (the run's status after the decision).
| Status | Code | When |
|---|---|---|
| 404 | APPROVAL_NOT_FOUND | no approval is waiting at this node |
| 400 | VALIDATION_FAILED | invalid body |
bash
curl "$HEVKAR_BASE_URL/v1/runs/$RUN_ID/approvals/review" \
-H "Authorization: Bearer $HEVKAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"decision": "reject", "comment": "Amount does not match the order"}'ts
await hevkar.runs.approve(runId, 'review', {
decision: 'reject',
comment: 'Amount does not match',
});Send an event
http
POST /v1/runs/{id}/eventsScope: workflows:approve (not implied by agents:run). Resumes a wait node in event mode that waits for this name.
| Body field | Type | Description |
|---|---|---|
name | string (1–200) | required; the node's eventName |
data | any | becomes the wait node's output |
Response 200: { "runId": "…", "status": "running" }.
| Status | Code | When |
|---|---|---|
| 409 | EVENT_NOT_EXPECTED | no wait node of the run is waiting for name |
bash
curl "$HEVKAR_BASE_URL/v1/runs/$RUN_ID/events" \
-H "Authorization: Bearer $HEVKAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "payment.received", "data": {"amount": 120}}'ts
await hevkar.runs.sendEvent(runId, { name: 'payment.received', data: { amount: 120 } });WorkflowNodeRun
Returned in nodes of GET /v1/runs/{id} and GET /v1/runs/{id}/steps.
| Field | Type | Description |
|---|---|---|
id | uuid | |
nodeId | string | the node's id in the graph |
nodeType | string | null | the node type (null if the node is no longer in the graph) |
iteration | integer | 0 for the node; map items are index + 1, loop iterations 1, 2, … |
status | string | pending, running, waiting, succeeded, failed, skipped, cancelled |
input | any | evaluated input (agent input, HTTP request, items, ...) |
output | any | |
handle | string | null | the output handle followed (urgent, approved, error, ...); null = main output |
attempts | integer | tries so far |
childRunId | uuid | null | the child run of an agent node, map item or loop iteration |
error | {code, message} | null | |
startedAt | string | null | |
finishedAt | string | null |
WorkflowWait
Returned in waits of GET /v1/runs/{id}/steps.
| Field | Type | Description |
|---|---|---|
id | uuid | |
nodeId | string | |
kind | string | approval, event or timer |
eventName | string | null | events |
message | string | null | approvals |
resumeAt | string | null | timers: when the run resumes; approvals and events: when the timeout edge is taken |
createdAt | string | |
resolvedAt | string | null | |
resolvedBy | string | null | user:<id>, api_key:<id> or system |
resolution | any | the decision or event |