sark
09/21/2020, 10:55 AMdef get_flow_run_state(client, flow_run_id):
q = parse_graphql(
{'query': {
with_args('flow_run',
{'where': {'id': {'_eq': flow_run_id}}}): {
'state'
}
}
})
state = client.graphql(q).data.flow_run[0].state
return state
def wait_flow_complete(flow_run_id):
client = Client()
state = None
while state != 'Success':
sleep(10)
state = get_flow_run_state(client, flow_run_id)
question: is it possible to avoid the polling and achieve the same thing?Julian
09/21/2020, 11:31 AMwait=True
downstream tasks will wait for the completed FlowRun,
although, this terminal state must not be a success state.Nuno
09/21/2020, 12:05 PMsark
09/22/2020, 2:14 AMFlowRunTask
because i didn’t want the task to start immediately but want to schedule it for later (while still having upstream and downstream dependencies for the task)