Advanced Designer Learning Path is now live! Read More

dataikuapi - python - run a scenario through api and get the status

Level 2
dataikuapi - python - run a scenario through api and get the status


Through this tutorial (, I manage to run a scenario. 

But I don't why I didn't manage to grab the status. I have an error message : "AttributeError: 'DSSScenario' object has no attribute 'running'"


def get_scenario(dss_project, dss_scenario, dss_timer😞
project = client.get_project(dss_project)
scenario = project.get_scenario(dss_scenario)
print("Scenario :" + str(scenario) )
trigger_fire =
scenario_run = trigger_fire.wait_for_scenario_run()
while True:
# Do a bit of other stuff
# ...

if scenario_run.running:
print("Scenario is still running ...")
print("Scenario is not running anymore")

if __name__ == "__main__":
print("-------------> Scenario Start <--------------")
DSS_host = sys.argv[1]
DSS_ApiKey = sys.argv[2]
DSS_ProjectKey = sys.argv[3]
Dss_Scenario = sys.argv[4]
Dss_TimeWaitForStatus = int(sys.argv[5])

client = dataikuapi.DSSClient(DSS_host, DSS_ApiKey)
get_scenario(DSS_ProjectKey, Dss_Scenario, Dss_TimeWaitForStatus)

If someone have an idea ? 

Best regards


0 Kudos
2 Replies


There are two important things here.

First of all, indeed, there is no running attribute on the DSSScenario class. I.e. You cannot do scenario.running

There is however a running flag on the DSSScenarioStatus, obtained by calling scenario.get_status(), and there is also a running flag on the DSSScenarioRun, obtained as a result of or scenario.get_last_runs().


It's however important to note that this documentation is for DSS 8.0 - If you have an older version of DSS, the API was simpler and did not have these helpful helpers. You will find the previous API for DSS 7.0 here:

0 Kudos
Level 2

Merci Clément pour ces infos ! 

0 Kudos
A banner prompting to get Dataiku DSS