Skip to main content
For asynchronous executions, use the runs resource to check status and retrieve results.

Execution Status

Executions progress through these statuses:

Check Status

Use runs.get() to check the current status:

Wait for Completion

Use runs.waitForCompletion() to poll until the execution finishes:

Options

If the execution doesn’t complete within the timeout, a TimeoutError is thrown. The execution continues running—you can call waitForCompletion() again with a new timeout.

Manual Polling

For more control, implement your own polling loop:

Execution Result

Completed executions include:

Type-Safe Results

Use generics for typed output:

Cancel Execution

Cancel a running execution:
After cancellation, the execution status becomes cancelled. Partial results may be available.

Batch Processing

Process multiple documents and poll all results:

Next Steps

Webhooks

Get notified instead of polling

Error Handling

Handle execution failures