Usage guide
Run a flow with managed infrastructure in three steps.Step 1: Create a new work pool
Create a new work pool of type Prefect Managed in the UI or the CLI. Use this command to create a new work pool using the CLI:Step 2: Create a deployment
Create a deployment using the flowdeploy
method or prefect.yaml
.
Specify the name of your managed work pool, as shown in this example that uses the deploy
method:
managed-execution.py
Step 3: Run the deployment
Run the deployment from the UI or from the CLI. This process runs a flow on remote infrastructure without any infrastructure setup, starting a worker, or requiring a cloud provider account.Add dependencies
Prefect can install Python packages in the container that runs your flow at runtime. Specify these dependencies in the Pip Packages field in the UI, or by configuringjob_variables={"pip_packages": ["pandas", "prefect-aws"]}
in your deployment creation like this:
requirements.txt
file and reference it in your prefect.yaml
pull_step
.
Limitations
Managed execution requires Prefect 2.14.4 or newer.Concurrency and work pools
Free tier accounts are limited to:- Maximum of 1 concurrent flow run per workspace across all
prefect:managed
pools - Maximum of 1 managed execution work pool per workspace
- Maximum of 10 concurrent flow runs per workspace across all
prefect:managed
pools. - Maximum of 5 managed execution work pools per workspace.
Images
Managed execution requires that you run the official Prefect Docker image:prefecthq/prefect:3-latest
.
However, as noted above, you can install Python package dependencies at runtime.
If you need to use your own image, we recommend using another type of work pool.