Happy New Year everyone! Is there a way, from with...
# ask-community
c
Happy New Year everyone! Is there a way, from within an active Flow, to know whether the flow was triggered by cron vs Quick run vs Run?
k
Not really unless you know the interval you scheduled at because the Quick Run just creates a schedule with “scheduled_start_time” = “now”
Actually one sec let me look
a
there is an
auto_scheduled
flag set to True when the flow runs on schedule:
Copy code
query = """ 
query($id: uuid!) {
  flow_run(where: {id: {_eq: $id} }) {
    id
    auto_scheduled
  }
}
"""
client.graphql(query=query, variables=dict(id=prefect.context["flow_run_id"]))
upvote 2
c
is this available within the flow context?
k
It’s not so I think you would have to query it
c
😞 ok - thanks for the info