Skip to main content
Deployments are server-side representations of flows that can be executed: This guide covers how to trigger deployments on demand.

Prerequisites

In order to run a deployment, you need to have:

Run a deployment from the CLI

The simplest way to trigger a deployment run is using the Prefect CLI:

CLI options

Add parameters and customize the run, including setting a custom flow run name using the new —flow-run-name option:

Run a deployment from Python

Use the run_deployment function for programmatic control:
By default, deployments triggered via run_deployment from within another flow will be treated as a subflow of the parent flow in the UI. To disable this, set as_subflow=False.

Async usage

In an async context, you can use the run_deployment function as a coroutine:

Further reading