Create Task Run
Create a task run. If a task run with the same flow_run_id, task_key, and dynamic_key already exists, the existing task run will be returned.
If no state is provided, the task run will be created in a PENDING state.
Headers
Body
Data used by the Prefect REST API to create a task run
A unique identifier for the task being run.
A dynamic key used to differentiate between multiple runs of the same task within the same flow run.
The ID to assign to the task run. If not provided, a random UUID will be generated.
The state of the task run to create
The flow run id of the task run.
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.
Specifies when the cached state should expire.
The version of the task being run.
Defines of how a task run should retry.
A list of tags for the task run.
The inputs to the task run.
Response
An ORM representation of task run data.
A unique identifier for the task being run.
A dynamic key used to differentiate between multiple runs of the same task within the same flow run.
The flow run id of the task run.
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.
Specifies when the cached state should expire.
The version of the task being run.
Defines of how a task run should retry.
A list of tags for the task run.
The id of the current task run state.
Tracks the source of inputs to a task run. Used for internal bookkeeping.
The type of the current task run state.
SCHEDULED
, PENDING
, RUNNING
, COMPLETED
, FAILED
, CANCELLED
, CRASHED
, PAUSED
, CANCELLING
The name of the current task run state.
The number of times the task run has been executed.
If the parent flow has retried, this indicates the flow retry this run is associated with.
The task run's expected start time.
The next time the task run is scheduled to start.
The actual start time.
The actual end time.
Total run time. If the task run was executed multiple times, the time of each run will be summed.
A real-time estimate of total run time.
The difference between actual and expected start time.
The current task run state.
Was this page helpful?