Hi! can you share graphql example to get the task ...
# ask-community
s
Hi! can you share graphql example to get the task result of a flow run
k
Are you trying to load in or just see the location?
s
We are storing metrics of our tasks as s3Result, We want to call graphql from our Portal and load the result.
k
Using the
get_task_run_result
task will be easier. You can just call
get_task_run_result.run(...)
to use the Python under the hood
s
there is no GraphQl API to load the result?
k
GraphQL alone will find the result, and then you need to make the Storage for it and then call
Storage().load()
with the location, but this task logic will do it all for you in one call
Otherwise you want something like:
Copy code
query {
  flow_run(where: {id: {_eq: "bb37bbfd-7fae-4357-8cf2-3d85cd8b1c6f"}}) {
    task_runs{
      state_result
    }
  }
}
and then you get the json, and then figure out how to load it
s
Ok
We are in standard plan, all the flow related info gets expired in 14 days, how we can use our own mechanism to store all flow metadata?
k
What do you need from the metadata? Success/Failed for all run sover time? Because normally what people do is they just send all of the logs to something like DataDog
s
Flow run status, task status, result state
k
Yeah I think you need to use the GraphQL API and run a batch job to get those