https://prefect.io logo
Title
a

Anders Segerberg

01/05/2023, 5:46 PM
Prefect 1.0 If have a "flow of flows", which calls
wait_for_flow_run
several times. I want this parent flow's success to depend on the success of all child flows. I've tried setting
upstream_tasks
to the result of
wait_for_flow_run
, but I realize that that's a
FlowRunView
object, not a
Task
. From the child flow, I can
get_tasks
, and set
upstream_tasks
to that. But I have some tasks I allow to fail in the child flows (they are not reference tasks of the child flow.) What I'd really like to do is to be able to reference
<child_flow>.state
, and set the parent flow's reference tasks to be expecting a
<Success: "All reference tasks succeeded.">
Is there a built-in way of going about this, instead of just manually inspecting the child flow results, and raising the appropriate SIGNAL ?
k

Kalise Richmond

01/05/2023, 8:58 PM
Hi @Anders Segerberg I believe you can use the
raise_final_state
in the
wait_for_flow_run
to accomplish this. https://docs-v1.prefect.io/api/latest/tasks/prefect.html#wait-for-flow-run Here's a great example.
a

Anders Segerberg

01/05/2023, 11:07 PM
thank you