Issue with allocation Dynamically to execute process twice or more

Greeting community,

I am having an issue where i run a process twice using the “Execute the process _ times” option.
The problem is that i have a schedule where if the process takes more than 2 hours it should be stopped(“killed”) because it is common that the tool where is process interacts has connection issues the and process does not crash but stays running, since the process takes at max 1,5 hour i have it to be stopped if it takes 2 hours.

The Issue is that the 2nd job that started as pending, the time where is stays pending counts towards the 2 hours of the scheduler to kill the job.
Meaning that the 1st job run for 1,5 Hour and the second job runs for 30minutes and gets killed as there have been 2 hours since it was added in the queue.

Is there a way to work around this without having a trigger and select 2 different running times 1,5 hours apart?

Thanks for any input.

One option could be not using the Orchestrator ‘stop/kill after…’ option, but keep track of the time within your automation.

If using a REFramework option just apply a time check after each transaction to see if the time has expired. The advantage is then that the timer starts when the actual job starts, and not the original trigger time.

If you are using another framework or sequence you might need to tweak it a wee bit more to keep track of the time, and/or do the intervention, but the principle will be the same.

The end result is that your trigger creates 2 jobs, 1 running, 1 pending, where the 1.5/2h timer starts at the start point of each individual job. Should you ever run the jobs in parallel over multiple machines, or scale up to 3 ore more runs, each will still run for max 1.5/2 hours.

And if built properly, you of course use assets to make this configurable allowing you to change the option and run duration on the fly without altering your code in the future.