Is there a way to get the current Scenario id?

Jorge
Jorge Registered Posts: 5 ✭✭✭

I'm buiilding a macro step for an scenario in which i need to obtain the last successful run of that scenario. I've been able to get the las successful time, but I'm struggling to limit this to only the current scenario. any suggestions on how to tackle this?

Answers

  • FlorentD
    FlorentD Dataiker, Dataiku DSS Core Designer, Registered, Moderator Posts: 52 Dataiker
    edited July 2025

    Hi Jorge,

    And what about using project.list_scenarios()?

    If you prefer another approach, you can find the ID, in the URL when viewing the scenario. The URL should look like:

    https:://${DATAIKU_HOST}:${DATAIKU_PORT}/projects/${PROJECT_KEY}/scenarios/${SCENARIO_ID}

    Best

  • Jorge
    Jorge Registered Posts: 5 ✭✭✭

    Thank you!. the issue that i'm facing is that i'm lookign to find the current scenario that is being executed.. i was able to work around by requesting to the user to input it manually and the validating agianst the list. Thank you

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023, Circle Member Posts: 2,722 Neuron
    edited August 2025

    @Jorge You can get the Scenario ID from within a running scenario using the "Scenario in a scenario" object inside a Custom Python script scenario step for instance:

    from dataiku.scenario import Scenario

    scenario = Scenario()

    print(scenario.scenario_trigger['scenarioId'])

Setup Info
    Tags
      Help me…