v1

latestOpenAPI 3.1.0raw.githubusercontent.com2024-11-08170291390.5 KB
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

infra_overridesobject

Deprecated field. Use job_variables instead.

namestring required

The name of the deployment.

flow_idstring uuid required

The ID of the flow associated with the deployment.

is_schedule_activeboolean

Whether the schedule is active.

pausedboolean

Whether or not the deployment is paused.

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 deployment tags.

pull_stepsobject[]
manifest_pathstring
work_queue_namestring
work_pool_namestring

The name of the deployment's work pool.

storage_document_idstring uuid
infrastructure_document_idstring uuid
descriptionstring
pathstring
versionstring
entrypointstring
job_variablesobject

Overrides for the flow's infrastructure configuration.

Example request

{
  "name": "my-deployment",
  "schedules": [
    {
      "schedule": {
        "timezone": "America/New_York"
      }
    }
  ],
  "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
infra_overridesobject

Deprecated field. Use job_variables instead.

namestring required

The name of the deployment.

versionstring

An optional version for the deployment.

descriptionstring

A description for the deployment.

flow_idstring uuid required

The flow id associated with the deployment.

is_schedule_activeboolean

Whether or not the deployment schedule is active.

pausedboolean

Whether or not the deployment is paused.

job_variablesobject

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"
  },
  "schedules": [
    {
      "schedule": {
        "timezone": "America/New_York"
      }
    }
  ],
  "tags": [
    "tag-1",
    "tag-2"
  ]
}