Skip to main content
The run object is the main object returned by Realtime subscriptions (e.g., 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

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.

Type-safety

You can infer the types of the run’s payload and output by passing the type of the task to the subscribeToRun function. This will give you type-safe access to the run’s payload and output.
When using subscribeToRunsWithTag, you can pass a union of task types for all the possible tasks that can have the tag.
This works with all realtime subscription functions:
  • runs.subscribeToRun<TaskType>()
  • runs.subscribeToRunsWithTag<TaskType>()
  • runs.subscribeToBatch<TaskType>()