https://prefect.io logo
v

Vipul

01/15/2021, 2:10 PM
Hi everyone, was wondering if there is any easy way to find the result of all the task inside the flow through GraphQL. The rationale being we trigger the task from Flask and wanted to show the result for each task from Flask UI
n

nicholas

01/15/2021, 3:18 PM
Hi @Vipul - you should be able to do something like this:
Copy code
query {
  task_run(where: {flow_run_id: {_eq: "<<id>>"}}) {
    id
    state_result
  }
}
assuming you're using the Results API. If you're using the Artifacts API, you'll want to grab all the task run ids from your flow run and then query for their artifacts like this:
Copy code
task_run_artifact(where:{task_run_id:{_eq:"<<id>>"}}) {
  id
  data
}
v

Vipul

01/15/2021, 4:40 PM
Thanks @nicholas it worked
n

nicholas

01/15/2021, 4:41 PM
Great! 🙂
2 Views