runs.subscribeToRun()). It contains all the information about the run, including the run ID, task identifier, payload, output, and more.
Type-safety is supported for the run object, so you can infer the types of the run’s payload and output. See type-safety for more information.
The run object
Properties
The run ID.
The task identifier.
The input payload for the run.
The output result of the run.
Timestamp when the run was created.
Timestamp when the run was last updated.
Sequential number assigned to the run.
Current status of the run.
RunStatus enum
RunStatus enum
Duration of the run in milliseconds.
Total cost of the run in cents.
Base cost of the run in cents before any additional charges.
Array of tags associated with the run.
Key used to ensure idempotent execution.
Timestamp when the run expired.
Time-to-live duration for the run.
Timestamp when the run finished.
Timestamp when the run started.
Timestamp until which the run is delayed.
Timestamp when the run was queued.
Additional metadata associated with the run.
Error information if the run failed.
Indicates whether this is a test run.
Type-safety
You can infer the types of the run’s payload and output by passing the type of the task to thesubscribeToRun function. This will give you type-safe access to the run’s payload and output.
subscribeToRunsWithTag, you can pass a union of task types for all the possible tasks that can have the tag.
runs.subscribeToRun<TaskType>()runs.subscribeToRunsWithTag<TaskType>()runs.subscribeToBatch<TaskType>()

