1. Submit the document
Trigger the workflow (workflows:trigger). Send a reference so you can match the result to your own record later:
status is held, runId is null: the document waits until someone runs it. Find its run later with list the runs of a document (runs:read), which returns the document’s runs newest first.
2. Poll the run
Get the run (runs:read) until its status is final:
Poll every few seconds and back off for long runs: a run in
review or waiting can take hours. Polling counts against the plan’s read limit, not the trigger limit, and costs no credits.
A
runId from the trigger can answer 404 Not Found for a moment before the run is created, and stays 404 if the run never starts, for example when the workflow stops running automatically before the document is processed. Get the document (documents:read): its status (such as failed, cancelled or held) tells you what happened.3. Follow review tasks
While a run is inreview, list review tasks (reviews:read) filtered by runId. The filter also matches tasks of reusable sections the run called:
page (from 1) and pageSize (default 20, at most 100). The response carries count (total items), pages (total pages) and data. A task’s decision is approved or rejected once a person finished it; reviews themselves happen in the review queue.
4. Collect the output
When the run iscompleted, get its output (runs:read). The output is what the workflow’s Download Output node captured:
- JSON output arrives as a JSON value, text formats (CSV, XML, YAML, plain text) as a string, and binary formats as a base64 string with
isBase64set totrue. - With several Download Output nodes, pass
nodeIdto choose one; without it, the most recently started one answers. AnodeIdthat is not a node of the graph the run executed returns404 Not Found. 409 Conflictmeans the run has not completed or captured no output.413 Content Too Largemeans the output exceeds the 10 MB that can be returned inline; download it from the run in the dashboard instead.
documents:read). It returns a url valid for 5 minutes (until expiresOn); request a new one after it expires.
Reading responses safely
- Errors are RFC 7807 problems served as
application/problem+json; branch on the HTTP status and log thedetail. - Ignore fields you do not recognize, and treat an unknown
statusor enum value as “not final yet”. New fields and values can appear without notice. - All timestamps are UTC (ISO 8601).