Hi all, I'm playing around with the prefect python...
# ask-community
c
Hi all, I'm playing around with the prefect python client - wondering if there is a straightforward way to accomplish the following: Given a root node within the DAG of a flow run (say a task run), determine if all child subtasks were successful. In the old graphql API, I was able to do this using the notions of "downstream_edges" and "downstream_tasks", but I'm not finding the equivalent in the new API. Any pointers would be greatly appreciated, thanks!
b
Still learning myself but does this help? https://docs.prefect.io/v3/develop/manage-states
c
Thanks, the state documentation was handy, but now I need to figure out how to parse the DAG of a flow run - that's the missing piece.
I think I found out how to solve it - there is a "task_inputs" dict associated with the TaskRun object, which has fields containing the run ids of the tasks that it depends on (presumably). From the task run ids, I can derive the DAG and solve my problem.
🙌 1
t
If I'm not mistaken you could also use the /api/flow_runs/{flow_run_id}/graph-v2 route and get all DAG info, including relationship between tasks and status.