Skip to main content
POST
Create Deployment

Headers

x-prefect-api-version
string

Body

application/json

Data used by the Prefect REST API to create a deployment.

name
string
required

The name of the deployment.

Example:

"my-deployment"

flow_id
string<uuid>
required

The ID of the flow associated with the deployment.

paused
boolean
default:false

Whether or not the deployment is paused.

schedules
DeploymentScheduleCreate · object[]

A list of schedules for the deployment.

concurrency_limit
integer | null

The deployment's concurrency limit.

Required range: x > 0
concurrency_options
ConcurrencyOptions · object | null

The deployment's concurrency options.

global_concurrency_limit_id
string<uuid> | null

The ID of the global concurrency limit to apply to the deployment.

enforce_parameter_schema
boolean
default:true

Whether or not the deployment should enforce the parameter schema.

parameter_openapi_schema
Parameter Openapi Schema · object

The parameter schema of the flow, including defaults.

parameters
Parameters · object

Parameters for flow runs scheduled by the deployment.

tags
string[]

A list of deployment tags.

Example:
labels
Labels · object | null

A dictionary of key-value labels. Values can be strings, numbers, or booleans.

Example:
pull_steps
Pull Steps · object[] | null
work_queue_name
string | null
work_pool_name
string | null

The name of the deployment's work pool.

Example:

"my-work-pool"

storage_document_id
string<uuid> | null
infrastructure_document_id
string<uuid> | null
description
string | null
path
string | null
version
string | null
entrypoint
string | null
job_variables
Job Variables · object

Overrides for the flow's infrastructure configuration.

version_info
VersionInfo · object | null

A description of this version of the deployment.

Response

Successful Response

id
string<uuid>
required
created
string<date-time> | null
required
updated
string<date-time> | null
required
name
string
required

The name of the deployment.

flow_id
string<uuid>
required

The flow id associated with the deployment.

version
string | null

An optional version for the deployment.

description
string | null

A description for the deployment.

paused
boolean
default:false

Whether or not the deployment is paused.

schedules
DeploymentSchedule · object[]

A list of schedules for the deployment.

concurrency_limit
integer | null
deprecated

DEPRECATED: Prefer global_concurrency_limit. Will always be None for backwards compatibility. Will be removed after December 2024.

global_concurrency_limit
GlobalConcurrencyLimitResponse · object | null

The global concurrency limit object for enforcing the maximum number of flow runs that can be active at once.

concurrency_options
ConcurrencyOptions · object | null

The concurrency options for the deployment.

job_variables
Job Variables · object

Overrides to apply to the base infrastructure block at runtime.

parameters
Parameters · object

Parameters for flow runs scheduled by the deployment.

tags
string[]

A list of tags for the deployment

Example:
labels
Labels · object

A dictionary of key-value labels. Values can be strings, numbers, or booleans.

Example:
work_queue_name
string | null

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

work_queue_id
string<uuid> | null

The id of the work pool queue to which this deployment is assigned.

last_polled
string<date-time> | null

The last time the deployment was polled for status updates.

parameter_openapi_schema
Parameter Openapi Schema · object

The parameter schema of the flow, including defaults.

path
string | null

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

pull_steps
Pull Steps · object[] | null

Pull steps for cloning and running this deployment.

entrypoint
string | null

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

storage_document_id
string<uuid> | null

The block document defining storage used for this flow.

infrastructure_document_id
string<uuid> | null

The block document defining infrastructure to use for flow runs.

created_by
CreatedBy · object | null

Optional information about the creator of this deployment.

updated_by
UpdatedBy · object | null

Optional information about the updater of this deployment.

work_pool_name
string | null

The name of the deployment's work pool.

status
enum<string> | null
default:NOT_READY

Whether the deployment is ready to run flows.

Available options:
READY,
NOT_READY
enforce_parameter_schema
boolean
default:true

Whether or not the deployment should enforce the parameter schema.