@nicholas - I'm trying to implement my own currency through a couple of calls to the graphql api.
basically at the start of my flow I'm just going to query the graphql api, see if there are any other active runs and stop the current run if there are.
I would do this by making these api calls:
1. Fetch the most recent flow runs, not including the current flow run (I need to figure out how to filter the current flow run out)
{
flow_run(where: {flow_id: {_eq: flow_id}}, limit: 1, order_by: {created: asc}) {
id
}
}
2. I'd then check the flow_run_state for the most recent flow run and make sure that status is success, failed, or cancelled
{
flow_run_state(where: {flow_run_id: {_eq: flow_run_id}} limit: 1, order_by: {timestamp: desc}) {
state, timestamp
}
}
Does this make sense to you? Is there a better way of querying the graphql api to see if there are any active runs for flow, regardless of flow version?