You need a published Flow and its
flowId. Find both in the Diligent dashboard, or ask your Diligent contact.How a run works
Starting a run is asynchronous.POST /flows/{flowId}/runs validates the input, queues the run, and returns immediately with a run id. It does not wait for the Flow to finish.
Poll GET /flow-runs/{runId} until status is terminal, or register a webhook for flow_run_completed and flow_run_failed. A webhook carries the terminal run object, including an inline report or output_ref when present; structured output is read separately with GET /flow-runs/{runId}/output. There is no result in the trigger response.
Typical statuses:
COMPLETED, FAILED, CANCELLED, and SKIPPED are terminal. Once a run reaches one of these, status does not change again.
Quick start
1. Trigger a run
input must match the Flow’s active version input schema. The fields below are an example — use the schema for your Flow.
202 Accepted):
id. That is the only handle you have for polling.
If input does not match the schema, the call fails immediately with 400 and does not queue a run:
404 with FLOW_NOT_FOUND means the flowId does not exist or belongs to another customer.
A 409 with NO_ACTIVE_VERSION means the Flow has no published active version.
2. Poll the run
Call Get Run with theid from step 1. Repeat until status is terminal.
Fields that are not yet available are omitted rather than returned as
null. A completed structured-only Flow may have output_ref without report, so use status to determine whether the run is finished.
3. Read structured output (optional)
Some Flows also produce structured output (JSON). If Get Run showsoutput_ref set, read it with Get Run Output:
snake_case:
404 with OUTPUT_NOT_AVAILABLE.
Examples
Poll until the run finishes (bash)
Poll every 3 seconds and stop when the status is terminal. Then print the report.Poll until the run finishes (Python)
Failed run
When execution fails, polling still ends on a terminal status. Readerror instead of report.
Polling guidance
- Poll
GET /flow-runs/{runId}for the simplest integration, or useflow_run_completedandflow_run_failedwebhooks to receive the terminal run object. - Start with a 2–5 second interval. Runs can take seconds to minutes depending on the Flow.
- Stop when
statusisCOMPLETED,FAILED,CANCELLED, orSKIPPED. - Persist the run
idin your system so you can resume polling after a restart. - Read
reportwhen present; a completed Flow may produce structured output without Markdown. - Call the output endpoint only after
output_refis set.