Skip to main content
This function subscribes to all changes to a run. It returns an async iterator that yields the run object whenever the run is updated. The iterator will complete when the run is finished.

Authentication

This function supports both server-side and client-side authentication. For server-side authentication, use your API key. For client-side authentication, you must generate a public access token with one of the following scopes:
  • read:runs
  • read:runs:<runId>
To generate a public access token, use the auth.createPublicToken function:

Response

The AsyncIterator yields an object with the following properties:
string
required
The run ID.
string
required
The task identifier.
object
required
The input payload for the run.
object
The output result of the run.
Date
required
Timestamp when the run was created.
Date
required
Timestamp when the run was last updated.
number
required
Sequential number assigned to the run.
RunStatus
required
Current status of the run.
number
required
Duration of the run in milliseconds.
number
required
Total cost of the run in cents.
number
required
Base cost of the run in cents before any additional charges.
string[]
required
Array of tags associated with the run.
string
Key used to ensure idempotent execution.
Date
Timestamp when the run expired.
string
Time-to-live duration for the run.
Date
Timestamp when the run finished.
Date
Timestamp when the run started.
Date
Timestamp until which the run is delayed.
Date
Timestamp when the run was queued.
Record<string, DeserializedJson>
Additional metadata associated with the run.
SerializedError
Error information if the run failed.
boolean
required
Indicates whether this is a test run.