cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Manual vs. Scheduled Job Flag

ChristianRRL
Valued Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

3 REPLIES 3

ChristianRRL
Valued Contributor

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

 

This is exactly what I needed. Thanks!

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now