Run workflows

Start a run, wait for the result, retry it, and read its events.

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. Read status, output, and error. A 200 answer can have a failed run.
  • 202: the run did not end. Get the run later with GET /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 EventSource cannot send the Authorization header. Use fetch or a different client.

Start a run with a webhook

A webhook does not use an API key. See Webhooks.

Change this page on GitHub