Yes. In Prefect 3.x you can run:
prefect --no-prompt deploy --prefect-file prefect.yaml --all
This works regardless of the work pool type, including hybrid. That command just registers deployments from your `prefect.yaml`; it doesn’t execute them.
A few notes:
-
--no-prompt
is a global CLI toggle, so placing it before
deploy
is correct.
-
--prefect-file
points to your project’s YAML (default is
prefect.yaml
, so it’s optional if you’re using the default name).
-
--all
deploys all flows defined in the YAML; if you also pass an entrypoint or flow name,
--all
is ignored.
For a hybrid work pool specifically:
- Make sure your deployments in
prefect.yaml
reference your hybrid pool name.
- Ensure a worker is running for that pool so scheduled runs get picked up:
prefect work-pool create my-hybrid-pool --type docker
prefect worker start --pool my-hybrid-pool
Example
prefect.yaml
snippet:
name: my-project
prefect-version: ">=3.0.0"
deployments:
- name: my-flow
entrypoint: flows/my_flow.py:my_flow
work_pool:
name: my-hybrid-pool
job_variables:
# e.g. image, env, resources, etc.
References:
- CLI root (global --no-prompt):
prefect/cli/root.py
- Deploy command implementation (includes --prefect-file and --all):
prefect/cli/deploy/_commands.py
- Work pools (concepts):
Work pools docs
- Deployments overview:
Deployments docs