Schedule a process to run continuously 24/7 forever

Hello, I have a process which must run 24/7. The workflow is in a loop and works fine, but I am worried because sometimes robot itself or server fails. Of course the process must be stopped manually sometimes for maintenance.

First what comes to mind is to schedule the process each hour for example. But then if process runs let’s say for 48 hours and then failure occurs - I have 48 pending jobs created…

Another approach to set Execute process X times via orchestrator, but it also creates unnecessary pending jobs.

What are your suggestions? Perhaps I can create a Queue trigger which never gets completed? And if I want to stop the job, I disable the trigger and Kill process?

Hi @NotFranmax ,
for your problem I would suggest a queue based trigger which will be generated only after completing a successful run. So if a run is unsuccessful the next run cannot be initiated because of no trigger. It will only get started if the previous one completes a successful run.

Thanks & Regards,
Shubham Dutta

Thank You for quick reply. I have set up trigger and Queue item and also created a new Item via studio. I intentionally created process which throws an error. Process was executed one time. I expected that process would run again immediately but it ran after 10 minutes.

image

Hi @NotFranmax ,
how much time the process takes to execute a single run?

Currently it is test process so it is few seconds.

The intention is to rerun the process immediately after it is finished. Actually, the process will never be Successful because it is in an infinite loop. So on Fault it should run again. Except when manually disabled for maintenance. A good way would be to disable trigger and then kill process. Perhaps I am doing something wrong. I have never worked with Queues before.

vs.

grafik

3 Likes

Hi @NotFranmax ,
then you can use scheduled trigger with a cron expression which will run the process every 5 minutes every day: */5 * * * *

And for disabling during modifications and all you can disable the schedule trigger.
Please go through this documentation link:Managing Schedules

But then it will create many pending jobs if process will run for let’s say 50 minutes…

Kindly note that we highlighted above the setting of regulating the number of pending jobs

1 Like

Hi @NotFranmax ,
did you try it? Because I don’t think so it will create 50 pending jobs if you do what @ppr suggested.

correct, if this value is 1 at any given point of time there will be only 1 pending job

Hello,

you could also use a try catch around your process and in the finally block use the start job activity. In this case, no matter if succesful or failed the process will start a new instanace of it self once it is ending.

Thank You all, I have created a Queue item, added a trigger for that Queue item and then Added a Queue with fake transaction which just hangs there. It fires a process, but at first, I didn’t understand how Orchestrator behaves and how a process gets launched. Turns out a queue trigger only checks it every 30 minutes as explained here:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.