Kyle McChesney
09/10/2021, 2:52 PMLATEST_FLOW_BY_NAME = gql(
'''
query LatestFlowByName($name: String) {
flow(
where: {name: {_eq: $name}},
order_by: {version: desc},
limit: 1,
)
{
id
}
}
''',
)
with: variable_values={'name': name}
• trigger a flow run
CREATE_FLOW_RUN = gql(
'''
mutation CreateFlowRun($input: create_flow_run_input!) {
create_flow_run(input: $input) {id}
}
''',
)
with:
variable_values={
'input': {
'flow_id': flow_id,
'parameters': parameters,
},
},
My goal here is to specify as little as possible, to ensure the flow runs with the defaults configured for it. I.E. I don’t want to muck with the RunConfig, etc. I am mostly concerned about my logic for getting the latest flow run. I tried to grok the flow groups / versions tables but did not have much luck.Kevin Kho
LatestFlowByName
is not guaranteed to pull the right now unless you immediately registered? You may also have different projects that contain a flow with the same name. The other queries look good to be.Kyle McChesney
09/10/2021, 2:59 PMKevin Kho
Kyle McChesney
09/10/2021, 3:04 PMKevin Kho
Kyle McChesney
09/10/2021, 3:10 PM