Idan Elhalwani
07/02/2025, 10:39 AMMarvin
07/02/2025, 10:40 AMMarvin
07/02/2025, 10:40 AMflow.from_source()
. This gives you the flexibility to:
- Run subflows on different infrastructure
- Use different work pools for different parts of your workflow
- Scale execution across multiple machines
Here's a simple example of how you might set this up:
python
from prefect import flow
@flow
def subflow(x):
return x + 1
@flow
def parent_flow():
# This runs in the same process
result1 = subflow(1)
# This can run on a different worker
deployment_flow = flow.from_source(
source="<https://github.com/your-repo>",
entrypoint="flows.py:subflow"
)
result2 = deployment_flow(2)
The links to the documentation provide more details about workers and workflow patterns if you'd like to dive deeper into distributed execution configurations.