Scott Zelenka
04/14/2020, 9:15 PMclient.create_flow_run
but that want's the UUID. I'm looking for a display name to UUID map, similar to how the UI does it.Jeremiah
create_flow_run
method. Here’sa quick example:import prefect
from prefect.utilities.graphql import with_args
query = {
"query": {
with_args("flow", {"where": {"name": {"_eq": "YOUR FLOW NAME"}}, "limit": 1}): {
"id"
}
}
}
client = prefect.Client()
result = client.graphql(query)
client.create_flow_run(flow_id=result.data[0].id)
Scott Zelenka
04/14/2020, 11:01 PMJeremiah
order_by
in to get the most recently created flow… lots of ways to ask for that ID. Once you find a pattern that works, let us know — always looking to streamline the CLI as a canonical accessScott Zelenka
04/16/2020, 3:07 PMquery = {
"query": {
with_args("flow", {"where": "environment": {"_contains": {"labels": ["LABEL_NAME"]}}}, "limit": 100}): {
"name", "version_group_id"
}
}
}
I need to validate that I can put multiple labels on a Flow, and have an Agent pick up the task when it's only listening for a subset of those labels, but it seems to get what I was after!Jeremiah