Tony Waddle
01/19/2022, 10:14 AMAmanda Wee
01/19/2022, 11:29 AMAnna Geller
from prefect import Flow
from prefect.tasks.prefect import create_flow_run, wait_for_flow_run
with Flow("parent_flow") as flow:
child_flow_run_id = create_flow_run(
flow_name="child_flow_name",
run_name="your_custom_flow_run_name_for_the_child_flow_run",
task_args={"name": "custom_task_name"},
)
child_flowrunview = wait_for_flow_run(
child_flow_run_id,
raise_final_state=True,
stream_logs=True,
task_args={"name": "custom_task_name"},
)
You are definitely not doing anything wrong. We even have a name for this approach called “The Orchestrator Pattern” to handle parent-child-flow relationship in the orchestration and we fully support it.Tony Waddle
01/19/2022, 2:28 PM