Etienne Callies
07/10/2026, 2:28 PMMarvin
07/10/2026, 2:28 PMMarvin
07/10/2026, 2:30 PMtimeout=0.
python
from prefect import flow
from prefect.deployments import run_deployment
@flow
def parent_flow():
flow_run = run_deployment(
name="child-flow/my-deployment",
parameters={"x": 1},
timeout=0,
)
print(f"Triggered child flow run: {flow_run.id}")
print("Continuing immediately...")
What this does
- Starts an independent flow run from a deployment
- Returns immediately
- Does not wait for completion
- Gives you a FlowRun object back, so you can keep the run ID if you want to inspect it later
Important note
- run_deployment() does require a deployment
- A worker must be running for that deployment’s work pool
If you call a flow directly like this:
python
child_flow()
that is not fire-and-forget — it behaves like a nested subflow and the parent waits for it.
If you want the child to appear as related to the parent in the UI, run_deployment() does that by default when called from inside a flow. If you want it completely detached, you can set:
python
run_deployment(
name="child-flow/my-deployment",
timeout=0,
as_subflow=False,
)
Recommendation
- Use direct flow calls for true subflows when you want to wait
- Use run_deployment(..., timeout=0) when you want background / independent execution
Relevant docs:
- Run deployments
- Deployments
If you want, I can also show:
1. how to deploy the child flow, or
2. how to trigger it asynchronously from async codeBring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by