Skip to main content

prefect.server.api.deployments

Routes for interacting with Deployment objects.

Functions

create_deployment

Creates a new deployment from the provided schema. If a deployment with the same name and flow_id already exists, the deployment is updated. If the deployment has an active schedule, flow runs will be scheduled. When upserting, any scheduled runs from the existing deployment will be deleted. For more information, see https://docs.prefect.io/v3/concepts/deployments.

update_deployment

read_deployment_by_name

Get a deployment using the name of the flow and the deployment.

read_deployment

Get a deployment by id.

read_deployments

Query for deployments.

paginate_deployments

Pagination query for flow runs.

get_scheduled_flow_runs_for_deployments

Get scheduled runs for a set of deployments. Used by a runner to poll for work.

count_deployments

Count deployments.

delete_deployment

Delete a deployment by id.

bulk_delete_deployments

Bulk delete deployments matching the specified filter criteria. Returns the IDs of deployments that were deleted.

schedule_deployment

Schedule runs for a deployment. For backfills, provide start/end times in the past. This function will generate the minimum number of runs that satisfy the min and max times, and the min and max counts. Specifically, the following order will be respected.
  • Runs will be generated starting on or after the start_time
  • No more than max_runs runs will be generated
  • No runs will be generated after end_time is reached
  • At least min_runs runs will be generated
  • Runs will be generated until at least start_time + min_time is reached

resume_deployment

Set a deployment schedule to active. Runs will be scheduled immediately.

pause_deployment

Set a deployment schedule to inactive. Any auto-scheduled runs still in a Scheduled state will be deleted.

create_flow_run_from_deployment

Create a flow run from a deployment. Any parameters not provided will be inferred from the deployment’s parameters. If tags are not provided, the deployment’s tags will be used. If no state is provided, the flow run will be created in a SCHEDULED state.

bulk_create_flow_runs_from_deployment

Create multiple flow runs from a deployment. Any parameters not provided will be inferred from the deployment’s parameters. If tags are not provided, the deployment’s tags will be used. If no state is provided, the flow runs will be created in a SCHEDULED state.

work_queue_check_for_deployment

Get list of work-queues that are able to pick up the specified deployment. This endpoint is intended to be used by the UI to provide users warnings about deployments that are unable to be executed because there are no work queues that will pick up their runs, based on existing filter criteria. It may be deprecated in the future because there is not a strict relationship between work queues and deployments.

read_deployment_schedules

create_deployment_schedules

update_deployment_schedule

delete_deployment_schedule