Sylvain Hazard
11/22/2021, 2:13 PMwith Flow(name="Parent Flow") as flow:
docs = Parameters("docs", default=[1, 2, 3])
small_task = SmallTask().map(docs)
big_task = create_flow_run.map(flow_name=unmapped("Child flow"), project_name="whatever", parameters=small_task)
wait_big_task = wait_for_flow_run.map(big_task, raise_final_state=unmapped(True))
another_small_task = AnotherSmallTask().map(wait_big_task)
but I'm not sure how or where to define the result of a flow in order to use it downstream.Anna Geller
11/22/2021, 2:28 PMfrom prefect import Flow
from prefect.tasks.prefect import create_flow_run, get_task_run_result
with Flow("parent") as parent_flow:
child_run_id = create_flow_run(flow_name="child")
child_data = get_task_run_result(child_run_id, "create_some_data-1")
# At runtime, `child_data` will be `[0, 1, 2, 3, 4]`
Docs:
• https://docs.prefect.io/orchestration/flow-runs/task-runs.html#task
• https://docs.prefect.io/api/latest/tasks/prefect.html#get-task-run-resultSylvain Hazard
11/22/2021, 2:33 PM