Manual vs. Scheduled Job Flag

ChristianRRL
Honored Contributor II

Hi all,

Simple question here. Is there some kind of "flag" accessible during a job run to tell if a job has been run via manual run vs. via scheduled run? I'm wanting to have the job behave slightly differently when running in either mode and ideally it would be nice to leverage an existing flag/variable of some kind during job execution.

ChristianRRL
Honored Contributor II

For a bit more context, basically I would like to know *during the job run* (in Python) how the job was triggered (Manual vs Scheduled):

ChristianRRL_0-1724279082565.png

 

Hi @ChristianRRL, you could get this information using the dynamic value references {{job.trigger.type}}
In your task settings, assign it to a parameter.

menotron_0-1724320172007.png

And then you could access it from within your notebook using dbutils widgets

menotron_1-1724320259741.png

 

View solution in original post

ChristianRRL
Honored Contributor II

This is exactly what I needed. Thanks!