v1

latestOpenAPI 3.1.0raw.githubusercontent.com2024-11-08170291390.5 KB
Task Runs

Read Task Run

Get a task run by id.

get/api/task_runs/{id}

Path parameters

idstring uuid required

The task run id

The task run id

Headers

x-prefect-api-versionstring

Response

Successful Response

idstring uuid
createdstring date-time
updatedstring date-time
namestring
flow_run_idstring uuid

The flow run id of the task run.

task_keystring required

A unique identifier for the task being run.

dynamic_keystring required

A dynamic key used to differentiate between multiple runs of the same task within the same flow run.

cache_keystring

An optional cache key. If a COMPLETED state associated with this cache key is found, the cached COMPLETED state will be used instead of executing the task run.

cache_expirationstring date-time

Specifies when the cached state should expire.

task_versionstring

The version of the task being run.

tagsstring[]

A list of tags for the task run.

state_idstring uuid

The id of the current task run state.

task_inputsobject

Tracks the source of inputs to a task run. Used for internal bookkeeping.

state_type'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING'

Enumeration of state types.

state_namestring

The name of the current task run state.

run_countinteger

The number of times the task run has been executed.

flow_run_run_countinteger

If the parent flow has retried, this indicates the flow retry this run is associated with.

expected_start_timestring date-time

The task run's expected start time.

next_scheduled_start_timestring date-time

The next time the task run is scheduled to start.

start_timestring date-time

The actual start time.

end_timestring date-time

The actual end time.

total_run_timenumber

Total run time. If the task run was executed multiple times, the time of each run will be summed.

estimated_run_timenumber

A real-time estimate of total run time.

estimated_start_time_deltanumber

The difference between actual and expected start time.

Example response

{
  "name": "my-task-run",
  "tags": [
    "tag-1",
    "tag-2"
  ],
  "state": {
    "message": "Run started"
  }
}