What is best practice for Process Suspend / Resume?


Suppose we have a Process that runs whenever a certain email is received (therefore it does NOT run on a schedule). Now, suppose this Process has to execute some action, then validate the action outcome (e.g. script has completed successfully) and then proceed according to this outcome.

If said action takes too long to complete (in my book, anything > 5 mins is too long) it is unacceptable to keep the Process waiting because that would be wasting valuable resources (in this context, the valuable resource being the Robot, which could be executing some other Process instead of just waiting for an action to complete).

Therefore, in this case, the proper thing to do is have the Process, somehow, suspended after it executes the action, so that it frees up the Robot to do something else, and then at a later time have the Process resume its operation, check the action outcome and proceed accordingly…

After all, that is exactly what a human operator would do. Nobody keeps staring at the screen just waiting for a script to complete its execution.

My question is, what is the best practice for handling this scenario? A quick and dirty way of handling it would be to create a “one use only” schedule, but that does not sound like a best practice to me.

Thank you

following this because I’m interested to see the solutions

How I think I will do it:

Scenario: Since the process took too long, the robot decides to do a different process and later get back to the first one.

If the process took too long, I will need to make the bot save the “state” the current process is in so that once I run again, it will retrieve the “state” and continue. Once the “state” is saved it redirects to the End state and proceed to the next scheduled process on its queue.

I would like to know other answers here as well. :slight_smile:

Thank you for the replies :slight_smile:

What you are suggesting is correct and it has to be part of the solution: Suppose there are 3 steps to the process and you have to suspend before step 3. You assign the value “step3” to a state parameter, which you retrieve at step 1 when the process restarts and so you skip to step 3.

There is one important thing missing however, before you end the process at suspend, how do you “schedule” the process to resume, say, 30 minutes later? Yes, you could create a temp schedule for this run only, but this is far from an optimal solution. What if the process is triggered many times within the hour? You would end up with so many temp schedules that your permanent, fixed schedules would get buried.

I actually have figured out some better (I think) way to do this, using add Queue Item and Postpone to a Queue that some other Process keeps getting Items from to issue Start Job requests, but I would not call this a best practice either and this is why I started this thread.

It all depends on the SLA. How long is the AHT of a single transaction? Is it repetitive? From there we can formulate the best interval for the schedule. I think schedules can work fine. Say for example: the process stopped, Bot does another process then proceed in checking if the first process completed, since it is only validation and usually may involved “Activating” the window and checking if an element is present, I think it will incur less time so robot can proceed again to the next process.


Nice update coming up. This is exactly what I was asking for: