This page tells you how to start a run and get its result. First, read the API overview.
Start a run
This request runs the published version of a workflow. Publish the workflow first.
curl -X POST "$ZERODOT_URL/api/v1/workflows/$ID/run" \
-H "Authorization: Bearer $ZERODOT_KEY" \
-H "content-type: application/json" \
-d '{"input":{"name":"Ada"}}'
The answer is 202. It has these fields:
{ "runId": "…", "status": "queued", "output": null, "error": null }
A run status is queued, running, waiting, succeeded, failed, or cancelled.
If the workflow has more than one trigger node, send nodeId to select one.
Wait for the result
Add wait=true to keep the request open until the run ends.
curl -X POST "$ZERODOT_URL/api/v1/workflows/$ID/run?wait=true" \
-H "Authorization: Bearer $ZERODOT_KEY" \
-H "content-type: application/json" \
-d '{"input":{"name":"Ada"}}'
200: the run ended. Readstatus,output, anderror. A200answer can have a failed run.202: the run did not end. Get the run later withGET /api/v1/runs/{id}.
The default timeout is 30 seconds. To change it, set ZERODOT_WEBHOOK_SYNC_TIMEOUT_MS.
One server process can keep a maximum of 500 requests open (ZERODOT_MAX_HELD_WEBHOOKS). Above this limit, the request does not wait. It returns 202 immediately.
Prevent duplicate runs
Send the header Idempotency-Key with a unique value. If you send the same value again, Zerodot does not start a second run. The answer gives the first run.
curl -X POST "$ZERODOT_URL/api/v1/workflows/$ID/run" \
-H "Authorization: Bearer $ZERODOT_KEY" \
-H "Idempotency-Key: order-1234"
Test a draft
POST /api/v1/workflows/{id}/test runs the draft in test mode. You can send a graph to test it without a save. You can send toNodeId to stop after one node.
Caution: A test run uses real credentials and writes real data.
If a node has no credential, the answer has warnings. Each warning has a url. Open it to add the credential.
Retry a failed run
curl -X POST "$ZERODOT_URL/api/v1/runs/$RUN_ID/retry" \
-H "Authorization: Bearer $ZERODOT_KEY"
The new run starts from the failed node. You can retry only a failed run.
Read events
This route sends server-sent events while the run operates.
curl -N "$ZERODOT_URL/api/v1/runs/$RUN_ID/events" \
-H "Authorization: Bearer $ZERODOT_KEY"
- The stream ends after the event
run.finished. - To continue after a break, send the header
Last-Event-ID. - The browser
EventSourcecannot send theAuthorizationheader. Usefetchor a different client.
Start a run with a webhook
A webhook does not use an API key. See Webhooks.