https://prefect.io logo
#prefect-server
Title
# prefect-server
l

Lana Dann

07/25/2022, 5:26 PM
does anyone know the best way to look up how a flow was kicked off? (manually, via schedule, via run flow task) i assume we’d be able to find this info using the graphql api
m

Mason Menges

07/26/2022, 5:09 PM
Hey @Lana Dann this can kinda depend on your use case a bit but this is a simple graphql query that'll return the created_by account type for your flow runs
Copy code
query { 
  flow_run {
    auto_scheduled
    created
    created_by {
      account_type
    }
    id
    
  }
}
I'm not 100% sure on this but I believe If Auto_scheduled is true it was created by the shcedule, if the account_type is User is was triggered manually and an account type of service indicates it was created during a flow, i.e by the create flow run task. (account type is Null for auto_scheduled runs.
l

Lana Dann

07/26/2022, 5:28 PM
thanks @Mason Menges! do you know if there’s a way to identify the task id that kicked off a flow run? (if the account type is service)
8 Views