Is there a way to check in a Python recipe if it was called by a scenario?

info-rchitect
info-rchitect Registered Posts: 198 ✭✭✭✭✭✭
edited July 2024 in Using Dataiku

Hi,

I have a scenario that triggers a Python recipe if a dependent dataset has changed. I would like to be able to call some method to handle the logic in my recipe:

if triggerd_by_scenario:
    print('triggerd by a scenario')

thx


Operating system used: Windows 10

Best Answer

  • NN
    NN Neuron, Registered, Neuron 2022, Neuron 2023, Circle Member Posts: 150 Neuron
    edited July 2024 Answer ✓

    Hi @info-rchitect

    PLease check if something like below works

    if 'scenarioTriggerRunId' in dataiku.get_custom_variables():
        print('Run by Scenario')
Setup Info
    Tags
      Help me…