Python API: Get Last Trigger Fire or Scenario Run in a Scenario
![importthepandas](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar11.png)
I cannot seem to find a solution for this on the community. I know we can get last runs, but I need the scenario to be aware of itself while running to call dataiku api_client methods. Unless I am missing something, is there a solution for this?
Answers
-
importthepandas Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 115 Neuron
Scenario im using this in is for custom triggers which work in a window around a user specified time to ensure they fire within +/- 5m, we've been seeing inconsistency so would like to be able to grab the last trigger fire time to do some quick logical checking and take action
-
Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 318 Neuron
-
importthepandas Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 115 Neuron
not quite. I cannot call the Scenario object and its method from the trigger directly. I'm just trying to back into a way to check when the trigger last fired... some how some way... within the trigger itself. I can get to the trigger ID, iterate over scenarios... trying to find the ID and then potentially there's a way to get to the trigger's history but it's not entirely clear. Reason I'm doing this is because I'm trying to stick the landing on times provided in a custom trigger which only lets us use run every and shifts time based on trigger time runs -- I really wish we could fix times as another option for these custom trigger fires.