Deployments

Create Deployment

Gracefully 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.

post/api/deployments/

Headers

x-prefect-api-versionstring

Request body

namestring

The name of the deployment.

flow_idstring uuid

The flow id associated with the deployment.

is_schedule_activeboolean

Whether or not the deployment schedule is active.

enforce_parameter_schemaboolean

Whether or not the deployment should enforce the parameter schema.

parameter_openapi_schemaobject

The parameter schema of the flow, including defaults.

parametersobject

Parameters for flow runs scheduled by the deployment.

tagsstring[]

A list of tags for the deployment

pull_stepsobject[]

Pull steps for cloning and running this deployment.

manifest_pathstring

The path to the flow's manifest file, relative to the chosen storage.

work_queue_namestring

The work queue for the deployment. If no work queue is set, work will not be scheduled.

work_pool_namestring

The name of the deployment's work pool.

storage_document_idstring uuid

The block document defining storage used for this flow.

infrastructure_document_idstring uuid

The block document defining infrastructure to use for flow runs.

descriptionstring

A description for the deployment.

pathstring

The path to the working directory for the workflow, relative to remote storage or an absolute path.

versionstring

An optional version for the deployment.

entrypointstring

The path to the entrypoint for the workflow, relative to the path.

infra_overridesobject

Overrides to apply to the base infrastructure block at runtime.

Example request

{
  "tags": [
    "tag-1",
    "tag-2"
  ],
  "work_pool_name": "my-work-pool",
  "schedule": {
    "timezone": "America/New_York"
  }
}

Response

Successful Response

idstring uuid
createdstring date-time
updatedstring date-time
namestring

The name of the deployment.

versionstring

An optional version for the deployment.

descriptionstring

A description for the deployment.

flow_idstring uuid

The flow id associated with the deployment.

is_schedule_activeboolean

Whether or not the deployment schedule is active.

infra_overridesobject

Overrides to apply to the base infrastructure block at runtime.

parametersobject

Parameters for flow runs scheduled by the deployment.

tagsstring[]

A list of tags for the deployment

work_queue_namestring

The work queue for the deployment. If no work queue is set, work will not be scheduled.

last_polledstring date-time

The last time the deployment was polled for status updates.

parameter_openapi_schemaobject

The parameter schema of the flow, including defaults.

pathstring

The path to the working directory for the workflow, relative to remote storage or an absolute path.

pull_stepsobject[]

Pull steps for cloning and running this deployment.

entrypointstring

The path to the entrypoint for the workflow, relative to the path.

manifest_pathstring

The path to the flow's manifest file, relative to the chosen storage.

storage_document_idstring uuid

The block document defining storage used for this flow.

infrastructure_document_idstring uuid

The block document defining infrastructure to use for flow runs.

work_pool_namestring

The name of the deployment's work pool.

status'READY' | 'NOT_READY'

Enumeration of deployment statuses.

enforce_parameter_schemaboolean

Whether or not the deployment should enforce the parameter schema.

Example response

{
  "schedule": {
    "timezone": "America/New_York"
  },
  "tags": [
    "tag-1",
    "tag-2"
  ]
}

Changes