Skip to main content

Choose the async API

Long-running work can execute in the background. Keep the identifier returned by the start request; the identifier and status values depend on the API. callbackUrl is optional for these three APIs. Omit it when polling; no placeholder callback endpoint is needed. Use a publicly reachable HTTPS URL when requesting callbacks. The headless email generation endpoint, POST /api/v2/async/headless/generate-emails, also runs asynchronously, but its request schema requires callbackUrl.

Agent status and callbacks

Start an agent with its inputs and saved agentOId. The response contains requestId. Poll every 5–10 seconds until data.status is completed or failed; the initial state is pending. The status response exposes the processed output in data.result and errors in data.error. Agent callbacks have this envelope:
data contains the agent’s processed response, including its success or failure information. The request ID is sent in the X-Request-Id header. There is no shared top-level succeeded/failed callback field across all async APIs. The agent callback sender allows two retries after the initial attempt, with a fixed one-second delay. HTTP 404, 410, and 500 responses skip retries. If callback delivery fails, the async request is marked failed even if the agent finished successfully; inspect the polling response’s result and error before submitting another run.

Workflow status and callbacks

Workflow polling returns data.jobOId, counts, timestamps, and a status of PENDING, RUNNING, PAUSED, COMPLETED, FAILED, or CANCELLED. It reports job progress; it does not return the workflow’s final output rows. Workflow callbacks have their own payload: event (workflow.completed, workflow.failed, or workflow.cancelled), workflowOId, jobOId, lowercase status, terminalNode, results, errors, and pagination fields (batchIndex, totalBatches, totalItems). Result batches come from terminal ACTION nodes and contain up to 100 items. A workflow can send several callbacks. When no terminal ACTION results are delivered, a fallback notification contains an empty results array and available errors. Workflow delivery allows three retries after the initial attempt, with exponential delays of one, two, and four seconds. Exhausted delivery failures are logged; the polling API does not expose a delivery-failed state or callback history. Track received batches on your side to detect missing output. See Workflows for entry-node inputs and Get Workflow Run Status for the polling schema.

Skill runs

Skill runs use a separate run model with statuses queued, running, succeeded, partial, failed, and cancelled. Poll every 10–30 seconds. The response includes a page of items with their outputs and credit usage; paginate using itemsOffset and itemsLimit when hasNext is true. An optional callbackUrl receives the finished run after its last item settles. Use idempotencyKey on the start request to avoid starting a second run when retrying the same submission. See Running a skill and the Runs API.

Receiving callbacks

Return a successful response promptly and process the payload asynchronously. Make receivers idempotent: use X-Request-Id for agent callbacks and a combination of jobOId, terminalNode.oId, and batchIndex for workflow batches. Deduplicating a workflow only by job ID would discard later batches.