prefect.client.orchestration
Functions
get_client
Classes
PrefectClient
An asynchronous client for interacting with the Prefect REST API.
Args:
api
: the REST API URL or FastAPI application to connect toapi_key
: An optional API key for authentication.api_version
: The API version this client is compatible with.httpx_settings
: An optional dictionary of settings to pass to the underlyinghttpx.AsyncClient
api_healthcheck
None
.
api_url
api_version
apply_slas_for_deployment
client_version
count_flow_runs
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queues
- count of flow runs
create_artifact
create_automation
create_block_document
include_secrets
: whether to include secret values on the stored Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. Note Blocks may not work as expected if this is set toFalse
.
create_block_schema
create_block_type
create_concurrency_limit
tag
: a tag the concurrency limit is applied toconcurrency_limit
: the maximum number of concurrent task runs for a given tag
httpx.RequestError
: if the concurrency limit was not created for any reason
- the ID of the concurrency limit in the backend
create_deployment
flow_id
: the flow ID to create a deployment forname
: the name of the deploymentversion
: an optional version string for the deploymenttags
: an optional list of tags to apply to the deploymentstorage_document_id
: an reference to the storage block document used for the deployed flowinfrastructure_document_id
: an reference to the infrastructure block document to use for this deploymentjob_variables
: A dictionary of dot delimited infrastructure overrides that will be applied at runtime; for exampleenv.CONFIG_KEY=config_value
ornamespace='prefect'
. This argument was previously namedinfra_overrides
. Both arguments are supported for backwards compatibility.
RequestError
: if the deployment was not created for any reason
- the ID of the deployment in the backend
create_deployment_branch
create_deployment_schedules
deployment_id
: the deployment IDschedules
: a list of tuples containing the schedule to create and whether or not it should be active.
RequestError
: if the schedules were not created for any reason
- the list of schedules created in the backend
create_flow
flow
: aFlow
object
httpx.RequestError
: if a flow was not created for any reason
- the ID of the flow in the backend
create_flow_from_name
flow_name
: the name of the new flow
httpx.RequestError
: if a flow was not created for any reason
- the ID of the flow in the backend
create_flow_run
flow
: The flow model to create the flow run forname
: An optional name for the flow runparameters
: Parameter overrides for this flow run.context
: Optional run context datatags
: a list of tags to apply to this flow runparent_task_run_id
: if a subflow run is being created, the placeholder task run identifier in the parent flowstate
: The initial state for the run. If not provided, defaults toPending
.work_pool_name
: The name of the work pool to run the flow run in.work_queue_name
: The name of the work queue to place the flow run in.job_variables
: The job variables to use when setting up flow run infrastructure.
httpx.RequestError
: if the Prefect API does not successfully create a run for any reason
- The flow run model
create_flow_run_from_deployment
deployment_id
: The deployment ID to create the flow run fromparameters
: Parameter overrides for this flow run. Merged with the deployment defaultscontext
: Optional run context datastate
: The initial state for the run. If not provided, defaults toScheduled
for now. Should always be aScheduled
type.name
: An optional name for the flow run. If not provided, the server will generate a name.tags
: An optional iterable of tags to apply to the flow run; these tags are merged with the deployment’s tags.idempotency_key
: Optional idempotency key for creation of the flow run. If the key matches the key of an existing flow run, the existing run will be returned instead of creating a new one.parent_task_run_id
: if a subflow run is being created, the placeholder task run identifier in the parent flowwork_queue_name
: An optional work queue name to add this run to. If not provided, will default to the deployment’s set work queue. If one is provided that does not exist, a new work queue will be created within the deployment’s work pool.job_variables
: Optional variables that will be supplied to the flow run job.
RequestError
: if the Prefect API does not successfully create a run for any reason
- The flow run model
create_flow_run_input
flow_run_id
: The flow run id.key
: The input key.value
: The input value.sender
: The sender of the input.
create_global_concurrency_limit
create_logs
logs
: An iterable ofLogCreate
objects or already json-compatible dicts
create_task_run
task
: The Task to runflow_run_id
: The flow run id with which to associate the task rundynamic_key
: A key unique to this particular run of a Task within the flowid
: An optional ID for the task run. If not provided, one will be generated server-side.name
: An optional name for the task runextra_tags
: an optional list of extra tags to apply to the task run in addition totask.tags
state
: The initial state for the run. If not provided, defaults toPending
for now. Should always be aScheduled
type.task_inputs
: the set of inputs passed to the task
- The created task run.
create_variable
create_work_pool
work_pool
: Desired configuration for the new work pool.
- Information about the newly created work pool.
create_work_queue
name
: a unique name for the work queuedescription
: An optional description for the work queue.is_paused
: Whether or not the work queue is paused.concurrency_limit
: An optional concurrency limit for the work queue.priority
: The queue’s priority. Lower values are higher priority (1 is the highest).work_pool_name
: The name of the work pool to use for this queue.
prefect.exceptions.ObjectAlreadyExists
: If request returns 409httpx.RequestError
: If request fails
- The created work queue
decrement_v1_concurrency_slots
names
: A list of limit names to decrement.task_run_id
: The task run ID that incremented the limits.occupancy_seconds
: The duration in seconds that the limits were held.
- “Response”: The HTTP response from the server.
delete_artifact
delete_automation
delete_block_document
delete_block_type
delete_concurrency_limit_by_tag
tag
: a tag the concurrency limit is applied to
ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
delete_deployment
deployment_id
: The deployment id of interest.
delete_deployment_schedule
deployment_id
: the deployment IDschedule_id
: the ID of the deployment schedule to delete.
RequestError
: if the schedules were not deleted for any reason
delete_flow
flow_id
: ID of the flow to be deleted
delete_flow_run
flow_run_id
: The flow run UUID of interest.
delete_flow_run_input
flow_run_id
: The flow run id.key
: The input key.
delete_global_concurrency_limit_by_name
delete_resource_owned_automations
delete_task_run
task_run_id
: the task run ID of interest
delete_variable_by_name
delete_work_pool
work_pool_name
: Name of the work pool to delete.
delete_work_queue_by_id
id
: the id of the work queue to delete
prefect.exceptions.ObjectNotFound
: If request returns 404httpx.RequestError
: If requests fails
filter_flow_run_input
find_automation
get_most_recent_block_schema_for_block_type
block_type_id
: The ID of the block type.
httpx.RequestError
: If the request fails for any reason.
- The most recent block schema or None.
get_runs_in_work_queue
id
: the id of the work queue to read fromlimit
: a limit on the number of runs to returnscheduled_before
: a timestamp; only runs scheduled before this time will be returned. Defaults to now.
prefect.exceptions.ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
- List[FlowRun]: a list of FlowRun objects read from the queue
get_scheduled_flow_runs_for_deployments
get_scheduled_flow_runs_for_work_pool
work_pool_name
: The name of the work pool that the work pool queues are associated with.work_queue_names
: The names of the work pool queues from which to get scheduled flow runs.scheduled_before
: Datetime used to filter returned flow runs. Flow runs scheduled for after the given datetime string will not be returned.
- A list of worker flow run responses containing information about the
- retrieved flow runs.
hello
increment_concurrency_slots
names
: A list of limit names for which to occupy slots.slots
: The number of concurrency slots to occupy.mode
: The mode of the concurrency limits.
increment_concurrency_slots_with_lease
names
: A list of limit names for which to occupy slots.slots
: The number of concurrency slots to occupy.mode
: The mode of the concurrency limits.lease_duration
: The duration of the lease in seconds.holder
: Optional holder information for tracking who holds the slots.
increment_v1_concurrency_slots
names
: A list of limit names for which to increment limits.task_run_id
: The task run ID incrementing the limits.
loop
match_work_queues
prefixes
: a list of strings used to match work queue name prefixeswork_pool_name
: an optional work pool name to scope the query to
- a list of WorkQueue model representations of the work queues
pause_automation
pause_deployment
deployment_id
: The deployment ID of interest (can be a UUID or a string).
ObjectNotFound
: If request returns 404RequestError
: If request fails
raise_for_api_version_mismatch
read_artifacts
read_automation
read_automations
read_automations_by_name
name
: the name of the automation to query
- a list of Automation model representations of the automations
read_block_document
block_document_id
: the block document idinclude_secrets
: whether to include secret values on the Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. These fields are automatically obfuscated by Pydantic, but users can additionally choose not to receive their values from the API. Note that any business logic on the Block may not work if this isFalse
.
httpx.RequestError
: if the block document was not found for any reason
- A block document or None.
read_block_document_by_name
name
: The block document name.block_type_slug
: The block type slug.include_secrets
: whether to include secret values on the Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. These fields are automatically obfuscated by Pydantic, but users can additionally choose not to receive their values from the API. Note that any business logic on the Block may not work if this isFalse
.
httpx.RequestError
: if the block document was not found for any reason
- A block document or None.
read_block_documents
block_schema_type
: an optional block schema typeoffset
: an offsetlimit
: the number of blocks to returninclude_secrets
: whether to include secret values on the Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. These fields are automatically obfuscated by Pydantic, but users can additionally choose not to receive their values from the API. Note that any business logic on the Block may not work if this isFalse
.
- A list of block documents
read_block_documents_by_type
block_type_slug
: The block type slug.offset
: an offsetlimit
: the number of blocks to returninclude_secrets
: whether to include secret values
- A list of block documents
read_block_schema_by_checksum
read_block_schemas
- A BlockSchema.
read_block_type_by_slug
read_block_types
- List of BlockTypes.
read_concurrency_limit_by_tag
tag
: a tag the concurrency limit is applied to
ObjectNotFound
: If request returns 404httpx.RequestError
: if the concurrency limit was not created for any reason
- the concurrency limit set on a specific tag
read_concurrency_limits
limit
: the maximum number of concurrency limits returnedoffset
: the concurrency limit query offset
- a list of concurrency limits
read_deployment
deployment_id
: the deployment ID of interest
- a Deployment model representation of the deployment
read_deployment_by_name
name
: A deployed flow’s name: <FLOW_NAME>/<DEPLOYMENT_NAME>
ObjectNotFound
: If request returns 404RequestError
: If request fails
- a Deployment model representation of the deployment
read_deployment_schedules
deployment_id
: the deployment ID
- a list of DeploymentSchedule model representations of the deployment schedules
read_deployments
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queueslimit
: a limit for the deployment queryoffset
: an offset for the deployment query
- a list of Deployment model representations of the deployments
read_flow
flow_id
: the flow ID of interest
- a Flow model representation of the flow
read_flow_by_name
flow_name
: the name of a flow
- a fully hydrated Flow model
read_flow_run
flow_run_id
: the flow run ID of interest
- a Flow Run model representation of the flow run
read_flow_run_input
flow_run_id
: The flow run id.key
: The input key.
read_flow_run_states
flow_run_id
: the id of the flow run
- a list of State model representations of the flow run states
read_flow_runs
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queuessort
: sort criteria for the flow runslimit
: limit for the flow run queryoffset
: offset for the flow run query
- a list of Flow Run model representations of the flow runs
read_flows
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queuessort
: sort criteria for the flowslimit
: limit for the flow queryoffset
: offset for the flow query
- a list of Flow model representations of the flows
read_global_concurrency_limit_by_name
read_global_concurrency_limits
read_latest_artifacts
read_logs
read_resource_related_automations
read_task_run
task_run_id
: the task run ID of interest
- a Task Run model representation of the task run
read_task_run_states
task_run_id
: the id of the task run
- a list of State model representations of the task run states
read_task_runs
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentssort
: sort criteria for the task runslimit
: a limit for the task run queryoffset
: an offset for the task run query
- a list of Task Run model representations of the task runs
read_variable_by_name
read_variables
read_work_pool
work_pool_name
: The name of the work pool to for which to get information.
- Information about the requested work pool.
read_work_pools
limit
: Limit for the work pool query.offset
: Offset for the work pool query.work_pool_filter
: Criteria by which to filter work pools.
- A list of work pools.
read_work_queue
id
: the id of the work queue to load
prefect.exceptions.ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
- an instantiated WorkQueue object
read_work_queue_by_name
name
: a unique name for the work queuework_pool_name
: the name of the work pool the queue belongs to.
prefect.exceptions.ObjectNotFound
: if no work queue is foundhttpx.HTTPStatusError
: other status errors
- a work queue API object
read_work_queue_status
id
: the id of the work queue to load
prefect.exceptions.ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
- an instantiated WorkQueueStatus object
read_work_queues
work_pool_name
: Name of the work pool for which to get queues.work_queue_filter
: Criteria by which to filter queues.limit
: Limit for the queue query.offset
: Limit for the queue query.
- List of queues for the specified work pool.
read_worker_metadata
read_workers_for_work_pool
work_pool_name
: The name of the work pool for which to get member workers.worker_filter
: Criteria by which to filter workers.limit
: Limit for the worker query.offset
: Limit for the worker query.
release_concurrency_slots
names
: A list of limit names for which to release slots.slots
: The number of concurrency slots to release.occupancy_seconds
: The duration in seconds that the slots were occupied.
- “Response”: The HTTP response from the server.
release_concurrency_slots_with_lease
lease_id
: The ID of the lease corresponding to the concurrency limits to release.
renew_concurrency_lease
lease_id
: The ID of the lease to renew.lease_duration
: The new lease duration in seconds.
reset_concurrency_limit_by_tag
tag
: a tag the concurrency limit is applied toslot_override
: a list of task run IDs that are currently using a concurrency slot, please check that any task run IDs included inslot_override
are currently running, otherwise those concurrency slots will never be released.
ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
resume_automation
resume_deployment
deployment_id
: The deployment ID of interest (can be a UUID or a string).
ObjectNotFound
: If request returns 404RequestError
: If request fails
resume_flow_run
flow_run_id
: the flow run ID of interestrun_input
: the input to resume the flow run with
- an OrchestrationResult model representation of state orchestration output
send_worker_heartbeat
work_pool_name
: The name of the work pool to heartbeat against.worker_name
: The name of the worker sending the heartbeat.return_id
: Whether to return the worker ID. Note: will returnNone
if the connected server does not support returning worker IDs, even ifreturn_id
isTrue
.worker_metadata
: Metadata about the worker to send to the server.
set_deployment_paused_state
deployment_id
: the deployment ID to updatepaused
: whether the deployment should be paused
set_flow_run_name
set_flow_run_state
flow_run_id
: the id of the flow runstate
: the state to setforce
: if True, disregard orchestration logic when setting the state, forcing the Prefect API to accept the state
- an OrchestrationResult model representation of state orchestration output
set_task_run_name
set_task_run_state
task_run_id
: the id of the task runstate
: the state to setforce
: if True, disregard orchestration logic when setting the state, forcing the Prefect API to accept the state
- an OrchestrationResult model representation of state orchestration output
update_artifact
update_automation
update_block_document
update_block_type
update_deployment
update_deployment_schedule
deployment_id
: the deployment IDschedule_id
: the deployment schedule ID of interestactive
: whether or not the schedule should be activeschedule
: the cron, rrule, or interval schedule this deployment schedule should use
update_flow_run
flow_run_id
: The identifier for the flow run to update.flow_version
: A new version string for the flow run.parameters
: A dictionary of parameter values for the flow run. This will not be merged with any existing parameters.name
: A new name for the flow run.empirical_policy
: A new flow run orchestration policy. This will not be merged with any existing policy.tags
: An iterable of new tags for the flow run. These will not be merged with any existing tags.infrastructure_pid
: The id of flow run as returned by an infrastructure block.
- an
httpx.Response
object from the PATCH request
update_flow_run_labels
update_global_concurrency_limit
update_variable
variable
: Desired configuration for the updated variable.
update_work_pool
work_pool_name
: Name of the work pool to update.work_pool
: Fields to update in the work pool.
update_work_queue
id
: the ID of the work queue to update**kwargs
: the fields to update
ValueError
: if no kwargs are providedprefect.exceptions.ObjectNotFound
: if request returns 404httpx.RequestError
: if the request fails
upsert_global_concurrency_limit_by_name
SyncPrefectClient
A synchronous client for interacting with the Prefect REST API.
Args:
api
: the REST API URL or FastAPI application to connect toapi_key
: An optional API key for authentication.api_version
: The API version this client is compatible with.httpx_settings
: An optional dictionary of settings to pass to the underlyinghttpx.Client
api_healthcheck
None
.
api_url
api_version
apply_slas_for_deployment
client_version
count_flow_runs
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queues
- count of flow runs
create_artifact
create_automation
create_block_document
include_secrets
: whether to include secret values on the stored Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. Note Blocks may not work as expected if this is set toFalse
.
create_block_schema
create_block_type
create_concurrency_limit
tag
: a tag the concurrency limit is applied toconcurrency_limit
: the maximum number of concurrent task runs for a given tag
httpx.RequestError
: if the concurrency limit was not created for any reason
- the ID of the concurrency limit in the backend
create_deployment
flow_id
: the flow ID to create a deployment forname
: the name of the deploymentversion
: an optional version string for the deploymenttags
: an optional list of tags to apply to the deploymentstorage_document_id
: an reference to the storage block document used for the deployed flowinfrastructure_document_id
: an reference to the infrastructure block document to use for this deploymentjob_variables
: A dictionary of dot delimited infrastructure overrides that will be applied at runtime; for exampleenv.CONFIG_KEY=config_value
ornamespace='prefect'
. This argument was previously namedinfra_overrides
. Both arguments are supported for backwards compatibility.
RequestError
: if the deployment was not created for any reason
- the ID of the deployment in the backend
create_deployment_branch
create_deployment_schedules
deployment_id
: the deployment IDschedules
: a list of tuples containing the schedule to create and whether or not it should be active.
RequestError
: if the schedules were not created for any reason
- the list of schedules created in the backend
create_flow
flow
: aFlow
object
httpx.RequestError
: if a flow was not created for any reason
- the ID of the flow in the backend
create_flow_from_name
flow_name
: the name of the new flow
httpx.RequestError
: if a flow was not created for any reason
- the ID of the flow in the backend
create_flow_run
flow
: The flow model to create the flow run forname
: An optional name for the flow runparameters
: Parameter overrides for this flow run.context
: Optional run context datatags
: a list of tags to apply to this flow runparent_task_run_id
: if a subflow run is being created, the placeholder task run identifier in the parent flowstate
: The initial state for the run. If not provided, defaults toPending
.work_pool_name
: The name of the work pool to run the flow run in.work_queue_name
: The name of the work queue to place the flow run in.job_variables
: The job variables to use when setting up flow run infrastructure.
httpx.RequestError
: if the Prefect API does not successfully create a run for any reason
- The flow run model
create_flow_run_from_deployment
deployment_id
: The deployment ID to create the flow run fromparameters
: Parameter overrides for this flow run. Merged with the deployment defaultscontext
: Optional run context datastate
: The initial state for the run. If not provided, defaults toScheduled
for now. Should always be aScheduled
type.name
: An optional name for the flow run. If not provided, the server will generate a name.tags
: An optional iterable of tags to apply to the flow run; these tags are merged with the deployment’s tags.idempotency_key
: Optional idempotency key for creation of the flow run. If the key matches the key of an existing flow run, the existing run will be returned instead of creating a new one.parent_task_run_id
: if a subflow run is being created, the placeholder task run identifier in the parent flowwork_queue_name
: An optional work queue name to add this run to. If not provided, will default to the deployment’s set work queue. If one is provided that does not exist, a new work queue will be created within the deployment’s work pool.job_variables
: Optional variables that will be supplied to the flow run job.
RequestError
: if the Prefect API does not successfully create a run for any reason
- The flow run model
create_flow_run_input
flow_run_id
: The flow run id.key
: The input key.value
: The input value.sender
: The sender of the input.
create_global_concurrency_limit
create_logs
create_task_run
task
: The Task to runflow_run_id
: The flow run id with which to associate the task rundynamic_key
: A key unique to this particular run of a Task within the flowid
: An optional ID for the task run. If not provided, one will be generated server-side.name
: An optional name for the task runextra_tags
: an optional list of extra tags to apply to the task run in addition totask.tags
state
: The initial state for the run. If not provided, defaults toPending
for now. Should always be aScheduled
type.task_inputs
: the set of inputs passed to the task
- The created task run.
create_variable
variable
: Desired configuration for the new variable.
create_work_pool
work_pool
: Desired configuration for the new work pool.
- Information about the newly created work pool.
decrement_v1_concurrency_slots
names
: A list of limit names to decrement.task_run_id
: The task run ID that incremented the limits.occupancy_seconds
: The duration in seconds that the limits were held.
- “Response”: The HTTP response from the server.
delete_artifact
delete_automation
delete_block_document
delete_block_type
delete_concurrency_limit_by_tag
tag
: a tag the concurrency limit is applied to
ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
delete_deployment
deployment_id
: The deployment id of interest.
delete_deployment_schedule
deployment_id
: the deployment IDschedule_id
: the ID of the deployment schedule to delete.
RequestError
: if the schedules were not deleted for any reason
delete_flow
flow_id
: ID of the flow to be deleted
delete_flow_run
flow_run_id
: The flow run UUID of interest.
delete_flow_run_input
flow_run_id
: The flow run id.key
: The input key.
delete_global_concurrency_limit_by_name
delete_resource_owned_automations
delete_variable_by_name
delete_work_pool
work_pool_name
: Name of the work pool to delete.
filter_flow_run_input
find_automation
get_most_recent_block_schema_for_block_type
block_type_id
: The ID of the block type.
httpx.RequestError
: If the request fails for any reason.
- The most recent block schema or None.
get_scheduled_flow_runs_for_deployments
get_scheduled_flow_runs_for_work_pool
work_pool_name
: The name of the work pool that the work pool queues are associated with.work_queue_names
: The names of the work pool queues from which to get scheduled flow runs.scheduled_before
: Datetime used to filter returned flow runs. Flow runs scheduled for after the given datetime string will not be returned.
- A list of worker flow run responses containing information about the
- retrieved flow runs.
hello
increment_concurrency_slots
names
: A list of limit names for which to occupy slots.slots
: The number of concurrency slots to occupy.mode
: The mode of the concurrency limits.
increment_concurrency_slots_with_lease
names
: A list of limit names for which to occupy slots.slots
: The number of concurrency slots to occupy.mode
: The mode of the concurrency limits.lease_duration
: The duration of the lease in seconds.holder
: Optional holder information for tracking who holds the slots.
increment_v1_concurrency_slots
names
: A list of limit names for which to increment limits.task_run_id
: The task run ID incrementing the limits.
pause_automation
pause_deployment
deployment_id
: The deployment ID of interest (can be a UUID or a string).
ObjectNotFound
: If request returns 404RequestError
: If request fails
raise_for_api_version_mismatch
read_artifacts
read_automation
read_automations
read_automations_by_name
name
: the name of the automation to query
- a list of Automation model representations of the automations
read_block_document
block_document_id
: the block document idinclude_secrets
: whether to include secret values on the Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. These fields are automatically obfuscated by Pydantic, but users can additionally choose not to receive their values from the API. Note that any business logic on the Block may not work if this isFalse
.
httpx.RequestError
: if the block document was not found for any reason
- A block document or None.
read_block_document_by_name
name
: The block document name.block_type_slug
: The block type slug.include_secrets
: whether to include secret values on the Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. These fields are automatically obfuscated by Pydantic, but users can additionally choose not to receive their values from the API. Note that any business logic on the Block may not work if this isFalse
.
httpx.RequestError
: if the block document was not found for any reason
- A block document or None.
read_block_documents
block_schema_type
: an optional block schema typeoffset
: an offsetlimit
: the number of blocks to returninclude_secrets
: whether to include secret values on the Block, corresponding to Pydantic’sSecretStr
andSecretBytes
fields. These fields are automatically obfuscated by Pydantic, but users can additionally choose not to receive their values from the API. Note that any business logic on the Block may not work if this isFalse
.
- A list of block documents
read_block_documents_by_type
block_type_slug
: The block type slug.offset
: an offsetlimit
: the number of blocks to returninclude_secrets
: whether to include secret values
- A list of block documents
read_block_schema_by_checksum
read_block_schemas
- A BlockSchema.
read_block_type_by_slug
read_block_types
- List of BlockTypes.
read_concurrency_limit_by_tag
tag
: a tag the concurrency limit is applied to
ObjectNotFound
: If request returns 404httpx.RequestError
: if the concurrency limit was not created for any reason
- the concurrency limit set on a specific tag
read_concurrency_limits
limit
: the maximum number of concurrency limits returnedoffset
: the concurrency limit query offset
- a list of concurrency limits
read_deployment
deployment_id
: the deployment ID of interest
- a Deployment model representation of the deployment
read_deployment_by_name
name
: A deployed flow’s name: <FLOW_NAME>/<DEPLOYMENT_NAME>
ObjectNotFound
: If request returns 404RequestError
: If request fails
- a Deployment model representation of the deployment
read_deployment_schedules
deployment_id
: the deployment ID
- a list of DeploymentSchedule model representations of the deployment schedules
read_deployments
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queueslimit
: a limit for the deployment queryoffset
: an offset for the deployment query
- a list of Deployment model representations of the deployments
read_flow
flow_id
: the flow ID of interest
- a Flow model representation of the flow
read_flow_by_name
flow_name
: the name of a flow
- a fully hydrated Flow model
read_flow_run
flow_run_id
: the flow run ID of interest
- a Flow Run model representation of the flow run
read_flow_run_input
flow_run_id
: The flow run id.key
: The input key.
read_flow_run_states
flow_run_id
: the id of the flow run
- a list of State model representations of the flow run states
read_flow_runs
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queuessort
: sort criteria for the flow runslimit
: limit for the flow run queryoffset
: offset for the flow run query
- a list of Flow Run model representations of the flow runs
read_flows
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentswork_pool_filter
: filter criteria for work poolswork_queue_filter
: filter criteria for work pool queuessort
: sort criteria for the flowslimit
: limit for the flow queryoffset
: offset for the flow query
- a list of Flow model representations of the flows
read_global_concurrency_limit_by_name
read_global_concurrency_limits
read_latest_artifacts
read_logs
read_resource_related_automations
read_task_run
task_run_id
: the task run ID of interest
- a Task Run model representation of the task run
read_task_run_states
task_run_id
: the id of the task run
- a list of State model representations of the task run states
read_task_runs
flow_filter
: filter criteria for flowsflow_run_filter
: filter criteria for flow runstask_run_filter
: filter criteria for task runsdeployment_filter
: filter criteria for deploymentssort
: sort criteria for the task runslimit
: a limit for the task run queryoffset
: an offset for the task run query
- a list of Task Run model representations of the task runs
read_variable_by_name
read_variables
read_work_pool
work_pool_name
: The name of the work pool to for which to get information.
- Information about the requested work pool.
read_work_pools
limit
: Limit for the work pool query.offset
: Offset for the work pool query.work_pool_filter
: Criteria by which to filter work pools.
- A list of work pools.
read_workers_for_work_pool
work_pool_name
: The name of the work pool for which to get member workers.worker_filter
: Criteria by which to filter workers.limit
: Limit for the worker query.offset
: Limit for the worker query.
release_concurrency_slots
names
: A list of limit names for which to release slots.slots
: The number of concurrency slots to release.occupancy_seconds
: The duration in seconds that the slots were occupied.
- “Response”: The HTTP response from the server.
release_concurrency_slots_with_lease
lease_id
: The ID of the lease corresponding to the concurrency limits to release.
renew_concurrency_lease
lease_id
: The ID of the lease to renew.lease_duration
: The new lease duration in seconds.
reset_concurrency_limit_by_tag
tag
: a tag the concurrency limit is applied toslot_override
: a list of task run IDs that are currently using a concurrency slot, please check that any task run IDs included inslot_override
are currently running, otherwise those concurrency slots will never be released.
ObjectNotFound
: If request returns 404httpx.RequestError
: If request fails
resume_automation
resume_deployment
deployment_id
: The deployment ID of interest (can be a UUID or a string).
ObjectNotFound
: If request returns 404RequestError
: If request fails
resume_flow_run
flow_run_id
: the flow run ID of interestrun_input
: the input to resume the flow run with
- an OrchestrationResult model representation of state orchestration output
send_worker_heartbeat
work_pool_name
: The name of the work pool to heartbeat against.worker_name
: The name of the worker sending the heartbeat.return_id
: Whether to return the worker ID. Note: will returnNone
if the connected server does not support returning worker IDs, even ifreturn_id
isTrue
.worker_metadata
: Metadata about the worker to send to the server.
set_deployment_paused_state
deployment_id
: the deployment ID to updatepaused
: whether the deployment should be paused
set_flow_run_name
set_flow_run_state
flow_run_id
: the id of the flow runstate
: the state to setforce
: if True, disregard orchestration logic when setting the state, forcing the Prefect API to accept the state
- an OrchestrationResult model representation of state orchestration output
set_task_run_name
set_task_run_state
task_run_id
: the id of the task runstate
: the state to setforce
: if True, disregard orchestration logic when setting the state, forcing the Prefect API to accept the state
- an OrchestrationResult model representation of state orchestration output
update_artifact
update_automation
update_block_document
update_block_type
update_deployment
update_deployment_schedule
deployment_id
: the deployment IDschedule_id
: the deployment schedule ID of interestactive
: whether or not the schedule should be activeschedule
: the cron, rrule, or interval schedule this deployment schedule should use
update_flow_run
flow_run_id
: The identifier for the flow run to update.flow_version
: A new version string for the flow run.parameters
: A dictionary of parameter values for the flow run. This will not be merged with any existing parameters.name
: A new name for the flow run.empirical_policy
: A new flow run orchestration policy. This will not be merged with any existing policy.tags
: An iterable of new tags for the flow run. These will not be merged with any existing tags.infrastructure_pid
: The id of flow run as returned by an infrastructure block.
- an
httpx.Response
object from the PATCH request
update_flow_run_labels
update_global_concurrency_limit
update_variable
variable
: Desired configuration for the updated variable.
update_work_pool
work_pool_name
: Name of the work pool to update.work_pool
: Fields to update in the work pool.