Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

using scenarioTriggerName in a scenario step condition

Level 3
using scenarioTriggerName in a scenario step condition


how can I reference the trigger name in a step condition of a scenario. 

In my situation I want to run step 1 only if the scenario has not been triggered manually, that means triggerName != 'Manual trigger'. But the variable 'triggerName' does not return any value.

Thank you,


6 Replies

@Romana This is a good question and one that I thought would be relatively easy to find an answer for. Says that all triggers pass at least a name and type and some pass additional data (SQL or Python).

Looking here: doesn't say anything about accessing the trigger name or type, just the params (if they are defined) as. Upon further inspection of the scenario variables I also did not find it.


One alternative way to do this is without too much difficulty is to make your very first step a Python Step that checks if the scenario was fired manually and then sets a scenario variable (accessible to subsequent scenario steps).

The Python Code:


from dataiku.scenario import Scenario

sc = Scenario()  # get the handle of the current running scenario
trigger_type = sc.get_trigger_type()  # get the type of trigger causing sc to run

# if triggered manually, set a scenario variable that can be used by other steps
if trigger_type == 'manual':

# NOTE: the name of your variable in subsequent steps should match the name of the keyword argument in the set_scenario_variables() method call - Here I chose to Use 'scenario_trigger_type'.


To skip a downstream step if the event was triggered manually.




Let us know if this solution will do what you need it to. I'm fairly certain it does (if I understood the original question).




Level 3

Hi @tim-wright ,

thank you very much for your answer. The solution does exactly what I want, but frankly I wanted to avoid python code. The official documentation claims there is a built in variable (which would make sense). I even found a variable "scenarioTriggerParams"  that returns a JSON - unfortunately empty. 

Would be great to get an official answer directly from Datiaku admins since it contradicts the documentation. 



@Romana I completely agree and was also confused by the discrepancy from what I saw and what is in the documentation. It would indeed be great to hear from Dataiku on this.

One thing I stumbled across that could help awareness. I created a Python step in a scenario that just prints the available variables -- which I then inspect in the log after running the scenario: 

from dataiku.scenario import Scenario

sc = Scenario()  # get the handle of the current running scenario

print('<<<<<<<< SCENARIO VARIABLES >>>>>>>>>> : {}'.format(sc.get_all_variables()))

# All the '<<<<..' just makes spotting this in the Log a little easier 

 .get_all_variables() will (reportedly) return all of the variables, including global, project and scenario specific ones. I see the a bunch of scenario specific variables including: 


 But, I see nothing related to Trigger Name or Trigger Type. I would screenshot what I see in my logs, but it also contains some API keys (stored in my project variables).

Just an FYI

0 Kudos
Thanks for raising this up. We will be passing this to Product to consider implementing better UX functionality around this logic.
For the time being, please follow Tim’s suggestion
0 Kudos

@dima_naboka in addition to the UX logic, I think the part that is potentially misleading is here: where it states "All triggers pass at least their name and type" - not sure if that can be clarified in the documentation until it is implemented. 

Thanks @dima_naboka

0 Kudos
Level 2


Do we have any update for the above discussed feature. we have the same use case and trying to check the manual / auto trigger scenarios. Appreciate your help.

Thank you - Damo

0 Kudos


Labels (1)
A banner prompting to get Dataiku