Hi, is it possible to identify from inside a flow ...
# ask-metaflow
f
Hi, is it possible to identify from inside a flow whether a flow run is a cron job or not?
v
you can see the presence of
@schedule
in a run through a special
_graph_info
artifact like here
if you have a flow that is sometimes started manually and sometimes automatically by
@schedule
- those may be harder to tell apart 🤔
one indirect way is to set up a separate flow,
CronFlow
, that gets triggered by
@schedule
and have a second flow triggered based on it with
trigger_on_finish(flow='CronFlow')
it's easy to see if
CronFlow
triggered you by using
current.trigger.run
f
if you have a flow that is sometimes started manually and sometimes automatically by
@schedule
- those may be harder to tell apart
This is the exact use case 🙂 I have a flow that I expect to have some inputs provided by user when started manually and throw error but not for cron jobs.
Yeah separating it in 2 flows would be a way to go
👍 1