API Reference
- Overview
- Python SDK Overview
- Settings reference
- REST API
- REST API overview
- Cloud API
- Server API
- Server API Overview
- Root
- Flows
- Flow Runs
- Task Runs
- Flow Run States
- Task Run States
- Flow Run Notification Policies
- Deployments
- SavedSearches
- Logs
- Concurrency Limits
- Concurrency Limits V2
- Block types
- Block documents
- Work Pools
- Task Workers
- Work Queues
- Artifacts
- Block schemas
- Block capabilities
- Collections
- Variables
- GETCreate Csrf Token
- Events
- Automations
- Admin
- CLI Reference
Paginate Task Runs
Pagination query for task runs.
{
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "my-task-run",
"flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_key": "<string>",
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "SCHEDULED",
"name": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"message": "Run started",
"data": "<any>",
"state_details": {
"flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"child_flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_time": "2023-11-07T05:31:56Z",
"cache_key": "<string>",
"cache_expiration": "2023-11-07T05:31:56Z",
"deferred": true,
"untrackable_result": false,
"pause_timeout": "2023-11-07T05:31:56Z",
"pause_reschedule": false,
"pause_key": "<string>",
"run_input_keyset": {},
"refresh_cache": true,
"retriable": true,
"transition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_parameters_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"traceparent": "<string>"
}
},
"task_version": "1.0",
"parameters": {},
"task_inputs": {},
"context": {
"my_var": "my_val"
},
"empirical_policy": {
"max_retries": 0,
"retry_delay_seconds": 0,
"retries": 123,
"retry_delay": 123,
"retry_jitter_factor": 123
},
"tags": [
"tag-1",
"tag-2"
]
}
],
"count": 123,
"limit": 123,
"pages": 123,
"page": 123
}
Headers
Body
Defines task run sorting options.
ID_DESC
, EXPECTED_START_TIME_ASC
, EXPECTED_START_TIME_DESC
, NAME_ASC
, NAME_DESC
, NEXT_SCHEDULED_START_TIME_ASC
, END_TIME_DESC
x >= 1
Filter for flows. Only flows matching all criteria will be returned.
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
Filter criteria for Flow.id
A list of flow ids to include
Filter criteria for Flow.tags
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of tags. Flows will be returned only if their tags are a superset of the list
["tag-1", "tag-2"]
If true, only include flows without tags
Filter flow runs. Only flow runs matching all criteria will be returned
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
Filter criteria for FlowRun.name
Filter criteria for FlowRun.tags
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of tags. Flow runs will be returned only if their tags are a superset of the list
["tag-1", "tag-2"]
A list of tags to include
["tag-1", "tag-2"]
If true, only include flow runs without tags
Filter criteria for FlowRun.deployment_id
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of flow run deployment ids to include
If true, only include flow runs without deployment ids
Filter criteria for `FlowRun.work_queue_name
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of work queue names to include
["work_queue_1", "work_queue_2"]
If true, only include flow runs without work queue names
Filter criteria for FlowRun.state
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
Filter criteria for FlowRun.state_type
A list of flow run state types to include
Enumeration of state types.
SCHEDULED
, PENDING
, RUNNING
, COMPLETED
, FAILED
, CANCELLED
, CRASHED
, PAUSED
, CANCELLING
A list of flow run state types to exclude
Enumeration of state types.
SCHEDULED
, PENDING
, RUNNING
, COMPLETED
, FAILED
, CANCELLED
, CRASHED
, PAUSED
, CANCELLING
Filter criteria for FlowRun.flow_version
A list of flow run flow_versions to include
Filter criteria for FlowRun.start_time
Filter criteria for FlowRun.end_time
Filter criteria for FlowRun.next_scheduled_start_time
Filter criteria for FlowRun.parent_task_run_id
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of flow run parent_task_run_ids to include
If true, only include flow runs without parent_task_run_id
Filter task runs. Only task runs matching all criteria will be returned
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
Filter criteria for TaskRun.id
A list of task run ids to include
Filter criteria for TaskRun.name
Filter criteria for TaskRun.tags
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of tags. Task runs will be returned only if their tags are a superset of the list
["tag-1", "tag-2"]
If true, only include task runs without tags
Filter criteria for TaskRun.state
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
Filter criteria for TaskRun.state_type
A list of task run state types to include
Enumeration of state types.
SCHEDULED
, PENDING
, RUNNING
, COMPLETED
, FAILED
, CANCELLED
, CRASHED
, PAUSED
, CANCELLING
Filter criteria for TaskRun.start_time
Filter criteria for TaskRun.subflow_run
If true, only include task runs that are subflow run parents; if false, exclude parent task runs
Filter criteria for TaskRun.flow_run_id
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of task run flow run ids to include
Filter for task runs with None as their flow run id
Filter for deployments. Only deployments matching all criteria will be returned.
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
Filter criteria for Deployment.id
A list of deployment ids to include
Filter criteria for Deployment.name
Filter criteria for Deployment.name
or Flow.name
A case-insensitive partial match on deployment or flow names. For example, passing 'example' might match deployments or flows with 'example' in their names.
Filter criteria for Deployment.paused
Only returns where deployment is/is not paused
Filter criteria for Deployment.tags
Operator for combining filter criteria. Defaults to 'and_'.
and_
, or_
A list of tags. Deployments will be returned only if their tags are a superset of the list
["tag-1", "tag-2"]
A list of tags to include
["tag-1", "tag-2"]
If true, only include deployments without tags
Filter criteria for Deployment.work_queue_name
A list of work queue names to include
["work_queue_1", "work_queue_2"]
DEPRECATED: Prefer Deployment.concurrency_limit_id
over Deployment.concurrency_limit
. If provided, will be ignored for backwards-compatibility. Will be removed after December 2024.
Only include deployments with a concurrency limit greater than or equal to this value
Only include deployments with a concurrency limit less than or equal to this value
If true, only include deployments without a concurrency limit
Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.
Response
The key of the task this run represents.
The name of the task run. Defaults to a random slug if not specified.
"my-task-run"
The id of the flow run this task run belongs to.
The id of the task run's current state.
The current state of the task run.
Enumeration of state types.
SCHEDULED
, PENDING
, RUNNING
, COMPLETED
, FAILED
, CANCELLED
, CRASHED
, PAUSED
, CANCELLING
"Run started"
Data associated with the state, e.g. a result. Content must be storable as JSON.
The version of the task executed in this task run.
"1.0"
Parameters for the task run.
Additional context for the task run.
{ "my_var": "my_val" }
The task run's empirical retry policy.
The maximum number of retries. Field is not used. Please use retries
instead.
The delay between retries. Field is not used. Please use retry_delay
instead.
The number of retries.
A delay time or list of delay times between retries, in seconds.
Determines the amount a retry should jitter
A list of tags for the task run.
["tag-1", "tag-2"]
Was this page helpful?
{
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "my-task-run",
"flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_key": "<string>",
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "SCHEDULED",
"name": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"message": "Run started",
"data": "<any>",
"state_details": {
"flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"child_flow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_time": "2023-11-07T05:31:56Z",
"cache_key": "<string>",
"cache_expiration": "2023-11-07T05:31:56Z",
"deferred": true,
"untrackable_result": false,
"pause_timeout": "2023-11-07T05:31:56Z",
"pause_reschedule": false,
"pause_key": "<string>",
"run_input_keyset": {},
"refresh_cache": true,
"retriable": true,
"transition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_parameters_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"traceparent": "<string>"
}
},
"task_version": "1.0",
"parameters": {},
"task_inputs": {},
"context": {
"my_var": "my_val"
},
"empirical_policy": {
"max_retries": 0,
"retry_delay_seconds": 0,
"retries": 123,
"retry_delay": 123,
"retry_jitter_factor": 123
},
"tags": [
"tag-1",
"tag-2"
]
}
],
"count": 123,
"limit": 123,
"pages": 123,
"page": 123
}