does anyone know the best way to look up how a flo...
# prefect-server
l
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
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
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)