wonsun
08/09/2022, 4:29 AMBianca Hoch
08/09/2022, 3:02 PMwonsun
08/10/2022, 2:01 AMBianca Hoch
08/11/2022, 8:23 PMimport prefect
client = prefect.Client()
flows = client.graphql(
{
'query': {
'flow': {
'id'
}
}
}
)
flow_run_list = []
for flow in flows['data']['flow']:
flow_runs = client.graphql(
{
'query': {
'flow (where: {id: {_eq: "'+flow['id']+'"}})':{
'name,' #leave comma inside of quotes to get flow name
'id,' #leave comma inside of quotes to get flow id
'project_id,' #leave comma inside of quotes to get project_id
'version,' #leave comma inside of quotes to get flow version
'flow_runs':{
'id',
'name',
'state',
'start_time',
'end_time'
}
}
}
}
)
flow_run_list.append(flow_runs)
print(flows)
print(flow_run_list)
wonsun
08/16/2022, 5:49 AM