curl --request POST \
--url https://api.example.com/api/flow_runs/filter \
--header 'Content-Type: application/json' \
--data '
{
"sort": "ID_DESC",
"offset": 0,
"flows": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"deployment": {
"operator": "and_",
"is_null_": true
},
"name": {
"any_": [
"my-flow-1",
"my-flow-2"
],
"like_": "marvin"
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"is_null_": true
}
},
"flow_runs": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"not_any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"my-flow-run-1",
"my-flow-run-2"
],
"like_": "marvin"
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"any_": [
"tag-1",
"tag-2"
],
"is_null_": true
},
"deployment_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_null_": true
},
"work_queue_name": {
"operator": "and_",
"any_": [
"work_queue_1",
"work_queue_2"
],
"is_null_": true
},
"state": {
"operator": "and_",
"type": {
"any_": [
"SCHEDULED"
],
"not_any_": [
"SCHEDULED"
]
},
"name": {
"any_": [
"<string>"
],
"not_any_": [
"<string>"
]
}
},
"flow_version": {
"any_": [
"<string>"
]
},
"start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z",
"is_null_": true
},
"end_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z",
"is_null_": true
},
"expected_start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z"
},
"next_scheduled_start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z"
},
"parent_flow_run_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"parent_task_run_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_null_": true
},
"idempotency_key": {
"any_": [
"<string>"
],
"not_any_": [
"<string>"
]
}
},
"task_runs": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"my-task-run-1",
"my-task-run-2"
],
"like_": "marvin"
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"is_null_": true
},
"state": {
"operator": "and_",
"type": {
"any_": [
"SCHEDULED"
]
},
"name": {
"any_": [
"<string>"
]
}
},
"start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z",
"is_null_": true
},
"expected_start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z"
},
"subflow_runs": {
"exists_": true
},
"flow_run_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_null_": false
}
},
"deployments": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"not_any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"my-deployment-1",
"my-deployment-2"
],
"like_": "marvin"
},
"flow_or_deployment_name": {
"like_": "<string>"
},
"paused": {
"eq_": true
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"any_": [
"tag-1",
"tag-2"
],
"is_null_": true
},
"work_queue_name": {
"any_": [
"work_queue_1",
"work_queue_2"
]
},
"concurrency_limit": {
"ge_": 123,
"le_": 123,
"is_null_": true
}
},
"work_pools": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"<string>"
]
},
"type": {
"any_": [
"<string>"
]
}
},
"work_pool_queues": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"wq-1",
"wq-2"
],
"startswith_": [
"marvin",
"Marvin-robot"
]
}
},
"limit": 123
}
'[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deployment_version": "1.0",
"work_queue_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_queue_name": "<string>",
"flow_version": "1.0",
"parameters": {},
"idempotency_key": "<string>",
"context": {},
"empirical_policy": {
"max_retries": 0,
"retry_delay_seconds": 0,
"retries": 123,
"retry_delay": 123,
"pause_keys": [
"<string>"
],
"resuming": false,
"retry_type": "in_process"
},
"tags": [
"<string>"
],
"labels": {},
"parent_task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state_type": "SCHEDULED",
"state_name": "<string>",
"run_count": 0,
"expected_start_time": "2023-11-07T05:31:56Z",
"next_scheduled_start_time": "2023-11-07T05:31:56Z",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"total_run_time": 0,
"estimated_run_time": 0,
"estimated_start_time_delta": 0,
"auto_scheduled": false,
"infrastructure_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"infrastructure_pid": "<string>",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_value": "<string>"
},
"work_pool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_pool_name": "my-work-pool",
"state": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "SCHEDULED",
"name": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"message": "Run started",
"data": "<unknown>",
"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": false,
"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>",
"deployment_concurrency_lease_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
},
"job_variables": {}
}
]Query for flow runs.
curl --request POST \
--url https://api.example.com/api/flow_runs/filter \
--header 'Content-Type: application/json' \
--data '
{
"sort": "ID_DESC",
"offset": 0,
"flows": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"deployment": {
"operator": "and_",
"is_null_": true
},
"name": {
"any_": [
"my-flow-1",
"my-flow-2"
],
"like_": "marvin"
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"is_null_": true
}
},
"flow_runs": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"not_any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"my-flow-run-1",
"my-flow-run-2"
],
"like_": "marvin"
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"any_": [
"tag-1",
"tag-2"
],
"is_null_": true
},
"deployment_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_null_": true
},
"work_queue_name": {
"operator": "and_",
"any_": [
"work_queue_1",
"work_queue_2"
],
"is_null_": true
},
"state": {
"operator": "and_",
"type": {
"any_": [
"SCHEDULED"
],
"not_any_": [
"SCHEDULED"
]
},
"name": {
"any_": [
"<string>"
],
"not_any_": [
"<string>"
]
}
},
"flow_version": {
"any_": [
"<string>"
]
},
"start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z",
"is_null_": true
},
"end_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z",
"is_null_": true
},
"expected_start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z"
},
"next_scheduled_start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z"
},
"parent_flow_run_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"parent_task_run_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_null_": true
},
"idempotency_key": {
"any_": [
"<string>"
],
"not_any_": [
"<string>"
]
}
},
"task_runs": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"my-task-run-1",
"my-task-run-2"
],
"like_": "marvin"
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"is_null_": true
},
"state": {
"operator": "and_",
"type": {
"any_": [
"SCHEDULED"
]
},
"name": {
"any_": [
"<string>"
]
}
},
"start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z",
"is_null_": true
},
"expected_start_time": {
"before_": "2023-11-07T05:31:56Z",
"after_": "2023-11-07T05:31:56Z"
},
"subflow_runs": {
"exists_": true
},
"flow_run_id": {
"operator": "and_",
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_null_": false
}
},
"deployments": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"not_any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"my-deployment-1",
"my-deployment-2"
],
"like_": "marvin"
},
"flow_or_deployment_name": {
"like_": "<string>"
},
"paused": {
"eq_": true
},
"tags": {
"operator": "and_",
"all_": [
"tag-1",
"tag-2"
],
"any_": [
"tag-1",
"tag-2"
],
"is_null_": true
},
"work_queue_name": {
"any_": [
"work_queue_1",
"work_queue_2"
]
},
"concurrency_limit": {
"ge_": 123,
"le_": 123,
"is_null_": true
}
},
"work_pools": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"<string>"
]
},
"type": {
"any_": [
"<string>"
]
}
},
"work_pool_queues": {
"operator": "and_",
"id": {
"any_": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"name": {
"any_": [
"wq-1",
"wq-2"
],
"startswith_": [
"marvin",
"Marvin-robot"
]
}
},
"limit": 123
}
'[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"state_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deployment_version": "1.0",
"work_queue_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_queue_name": "<string>",
"flow_version": "1.0",
"parameters": {},
"idempotency_key": "<string>",
"context": {},
"empirical_policy": {
"max_retries": 0,
"retry_delay_seconds": 0,
"retries": 123,
"retry_delay": 123,
"pause_keys": [
"<string>"
],
"resuming": false,
"retry_type": "in_process"
},
"tags": [
"<string>"
],
"labels": {},
"parent_task_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state_type": "SCHEDULED",
"state_name": "<string>",
"run_count": 0,
"expected_start_time": "2023-11-07T05:31:56Z",
"next_scheduled_start_time": "2023-11-07T05:31:56Z",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"total_run_time": 0,
"estimated_run_time": 0,
"estimated_start_time_delta": 0,
"auto_scheduled": false,
"infrastructure_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"infrastructure_pid": "<string>",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_value": "<string>"
},
"work_pool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_pool_name": "my-work-pool",
"state": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "SCHEDULED",
"name": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"message": "Run started",
"data": "<unknown>",
"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": false,
"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>",
"deployment_concurrency_lease_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
},
"job_variables": {}
}
]Defines flow run sorting options.
ID_DESC, START_TIME_ASC, START_TIME_DESC, EXPECTED_START_TIME_ASC, EXPECTED_START_TIME_DESC, NAME_ASC, NAME_DESC, NEXT_SCHEDULED_START_TIME_ASC, END_TIME_DESC x >= 0Filter for flows. Only flows matching all criteria will be returned.
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for Flow.name
Filter criteria for Flow.tags
Show child attributes
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
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for FlowRun.name
Show child attributes
Filter criteria for FlowRun.tags
Show child attributes
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
Show child attributes
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
Show child attributes
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
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for FlowRun.state_type
Show child attributes
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.start_time
Show child attributes
Only include flow runs starting at or before this time
Only include flow runs starting at or after this time
If true, only return flow runs without a start time
Filter criteria for FlowRun.end_time
Show child attributes
Filter criteria for FlowRun.expected_start_time
Filter criteria for FlowRun.next_scheduled_start_time
Show child attributes
Filter criteria for subflows of the given flow runs
Filter criteria for FlowRun.parent_task_run_id
Show child attributes
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
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for TaskRun.name
Show child attributes
Filter criteria for TaskRun.tags
Show child attributes
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
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for TaskRun.state_type
Show child attributes
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
Show child attributes
Only include task runs starting at or before this time
Only include task runs starting at or after this time
If true, only return task runs without a start time
Filter criteria for TaskRun.expected_start_time
Filter criteria for TaskRun.flow_run_id
Show child attributes
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.
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for Deployment.name
Show child attributes
Filter criteria for Deployment.name or Flow.name
Show child attributes
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.tags
Show child attributes
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
DEPRECATED: Prefer Deployment.concurrency_limit_id over Deployment.concurrency_limit. If provided, will be ignored for backwards-compatibility. Will be removed after December 2024.
Show child attributes
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
Filter work pools. Only work pools matching all criteria will be returned
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter work queues. Only work queues matching all criteria will be returned
Show child attributes
Operator for combining filter criteria. Defaults to 'and_'.
and_, or_ Filter criteria for WorkQueue.name
Show child attributes
A list of work queue names to include
["wq-1", "wq-2"]A list of case-insensitive starts-with matches. For example, passing 'marvin' will match 'marvin', and 'Marvin-robot', but not 'sad-marvin'.
["marvin", "Marvin-robot"]Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.
Successful Response
The id of the flow being run.
The name of the flow run. Defaults to a random slug if not specified.
The id of the flow run's current state.
The id of the deployment associated with this flow run, if available.
The version of the deployment associated with this flow run.
"1.0"
The id of the run's work pool queue.
The work queue that handled this flow run.
The version of the flow executed in this flow run.
"1.0"
Parameters for the flow run.
An optional idempotency key for the flow run. Used to ensure the same flow run is not created multiple times.
Additional context for the flow run.
Defines of how a flow run should retry.
Show child attributes
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.
The delay time between retries, in seconds.
Tracks pauses this run has observed.
Indicates if this run is resuming from a pause.
The type of retry this run is undergoing.
in_process, reschedule A list of tags on the flow run
If the flow run is a subflow, the id of the 'dummy' task in the parent flow used to track subflow state.
The type of the current flow run state.
SCHEDULED, PENDING, RUNNING, COMPLETED, FAILED, CANCELLED, CRASHED, PAUSED, CANCELLING The name of the current flow run state.
The number of times the flow run was executed.
The flow run's expected start time.
The next time the flow run is scheduled to start.
The actual start time.
The actual end time.
Total run time. If the flow run was executed multiple times, the time of each run will be summed.
A real-time estimate of the total run time.
The difference between actual and expected start time.
Whether or not the flow run was automatically scheduled.
The block document defining infrastructure to use this flow run.
The id of the flow run as returned by an infrastructure block.
The id of the flow run's work pool.
The name of the flow run's work pool.
"my-work-pool"
The current state of the flow run.
Show child attributes
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.
Show child attributes
Variables used as overrides in the base job template
Was this page helpful?