Fina Silva-Santisteban
10/31/2021, 2:37 PMAnna Geller
query {
flow_run(
where: { state: { _eq: "Success" } }
order_by: { state_timestamp: desc }
limit: 100
) {
name
flow_id
scheduled_start_time
start_time
end_time
task_runs {
name
id
end_time
start_time
}
version
agent {
type
}
}
}
• using client to execute the query
from prefect import Client
client = Client()
query = """
paste the above
"""
client.graphql(query)
Fina Silva-Santisteban
11/01/2021, 12:31 PMAnna Geller
Fina Silva-Santisteban
11/02/2021, 12:40 PMAnna Geller
from prefect import Client
client = Client()
query = """
query {
flow_run(
where: { state: { _eq: "Success" } }
order_by: { state_timestamp: desc }
limit: 100
) {
name
flow_id
flow {
name
project {name}
}
scheduled_start_time
start_time
end_time
task_runs {
name
id
end_time
start_time
}
version
agent {
type
}
}
}
"""
response = client.graphql(query)
print(response)
Output:
{'data': {'flow_run': [a long list of your flow runs here]}}
Kevin Kho
Fina Silva-Santisteban
11/02/2021, 5:51 PM