Jeandre de Bruyn
05/27/2026, 8:39 AMMarvin
05/27/2026, 8:39 AMMarvin
05/27/2026, 8:41 AMprefect.yaml / serve process.
If you want failure isolation, do not call one flow directly from another unless you want parent/child behavior.
Recommended patterns
1. Best for independence: separate deployments for each flow
- flow_a -> deployment A
- flow_b -> deployment B
- flow_c -> deployment C
These can live in the same repo and same prefect.yaml, but they are still separate deployments.
2. If one should trigger another without cascading failure:
- trigger another deployment
- not a direct flow-to-flow call
3. Avoid this if you want isolation:
`
@flow
def parent():
flow_a()
flow_b()
`
If flow_a() fails, that failure is part of the parent run and can affect the whole orchestration.
What to do instead
Option A: Multiple deployments in one prefect.yaml
yaml
deployments:
- name: flow-a
entrypoint: flows.py:flow_a
- name: flow-b
entrypoint: flows.py:flow_b
- name: flow-c
entrypoint: flows.py:flow_c
Then deploy them with:
bash
prefect deploy
I verified the CLI exists:
- Deployments docs
Option B: Serve multiple deployments together
`
from prefect import flow, serve
@flow
def flow_a():
print("A")
@flow
def flow_b():
print("B")
@flow
def flow_c():
print("C")
if __name__ == "__main__":
serve(
flow_a.to_deployment(name="flow-a"),
flow_b.to_deployment(name="flow-b"),
flow_c.to_deployment(name="flow-c"),
)
`
This groups them operationally, but each is still its own deployment/run.
Option C: Trigger deployments instead of calling flows directly
If you need one workflow to kick off others but keep failures isolated, use deployment-triggering patterns rather than direct subflows.
Conceptually:
- orchestrator starts deployment A
- orchestrator starts deployment B
- each flow run succeeds/fails independently
Rule of thumb
- Need true isolation? Separate deployments.
- Need shared orchestration state? Subflows/direct flow calls.
- Need “grouped but independent”? Multiple deployments in one project.
If you'd like, I can show you the exact Prefect 3 pattern for either:
1. multiple deployments from one file, or
2. an orchestrator flow that launches other deployments independently.Jeandre de Bruyn
05/27/2026, 8:42 AM