Cancel a trigger after a successful job

Hi all,

I wanted to know if there’s already a configuration that would cancel a trigger set for multiple days, if in one of the days the Job is sucessful.

So the example would be for Robot-A a monthly trigger is on to run once a day between the 10-13th.
If on day 10 the Job is faulted, nothing happens to the trigger. But if then on the 11th the Job is successfully completed, then there’s no need to run on the 12 and 13.

Thank in advance!

Just use an Asset. At the end of the automation if it succeeds, put the current date into the Asset. At the beginning of the automation get the Asset value and if the date is within the desired timeframe, stop without processing.

Hi @Ricardo_Ventura ,

We could use orchestrator api services to disable the trigger if the process is successful. Could you please refer the below thread for more help. Thanks

In that case we should use 2 different assets right?

AssetA - Successful Job Date
AssetB - Limit day of the trigger (would be reset each month)

Still I’m finding an issue when we have a trigger with days from 2 different months, like for days 30/31/1/2.

Another option could be an Asset with a set of the days needed, to compare with the last successful execution day - another Asset.

So we would compare if the the current day’s index within the list is under or equals the last day of execution:

If positive, run.
If successful, update the last day asset with the current day
Else don’t update anything
Else does not run
If today’s index == last day of the list index
Set LastDay asset to last index value (this is the reset)

Using the index of the list of the trigger’s days we have an order that should be followed.

Example

Triggers:
TriggerList = 30/31/1/2 (days of the month)
LastDay = 2

Flow:
We have an unsuccessful run on day 30 (robot runs as index 0 is less then index 3), nothing is updated.

Another run on day 31 that is successful.
Then, update the LastDay to 31

Next day it checks day 1 index = 2 > index of 31 = 1
Then it does not run.

On day 2 index is still higher than 31 index and we dont need to run, but will fall on the condition that check last index of the list. Then we should reset LastDay to 2. (same thing happens if the only successful run is on day 2 as it will update the LastDay, and on day 3 won’t run)

Too overkill? :smiley:

Let me know if it makes sense to you, or if you find a use case in which it does not work :slight_smile:

Happy automation!