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
Contributor III

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
Contributor III

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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group