https://prefect.io logo
v

Valentin Willscher

09/17/2020, 7:58 AM
Hey guys - is their a way to list all registered flows? I couldn’t find a way in the API docs
s

sark

09/17/2020, 8:33 AM
you can use the graphql API, e.g. to get the flow id by the flow name
Copy code
import prefect

client = prefect.Client()

flow_id = client.graphql('''query {
  flow(where: {_and: [
    {name: {_eq: "flow name"}}    ,
    {archived: {_eq: false}}
  ]}) {
    id
  }
}''').data.flow[0].id
💯 2
👍 1