Running a process 24/7

Hello guys,

I am having serious doubts as how to schedule a process to execute 24/7 for at least a month straight. For context, the process I’m working has no queue, basically it just takes screenshots of a website and adds them to a report to be sent.

I think I have two options here:

  • Add a While Activity to the process and allow it to keep running until the process is needed to stop which I know it has its own list of problems associated to it.
  • Create a trigger that would launch the process every time the process finishes (it really does not matter if it failed or not) but I have no idea how to create a trigger everytime the process ends (I have just seen time triggers not event triggers).

How would you guys solve this issue? I will apreciate eny input you could give me because this is the first time I’m dealing with this situation.

Thank you in advance.

Hi @ulises.ariza

You can build that logic to run the Process for 24/7 in the code. Use the while loop as your said and give the conditions to it how many days it has to run. If it got reach that day then break the loop to stop the execution.

Here is a logic I don’t know weather it was correct or not to give. Use condition in while loop, I want to run the code untill date changes to tomorrow

- Condition -> DateTime.Now.equals(DateTime.Now.adddays(1))

For one month use below,

- Condition -> DateTime.Now.equals(DateTime.Now.Addmonths(1))

Inside while insert all the activities to be executed 24/7. But it’s not recommend to do it because if any exception encounters in the middle of the execution the bot will abort itself automatically you have to handle each and every exception to continuous flow.

Hope you understand!!

@ulises.ariza,

You can setup a time trigger for this to run every minute.

You can change it as per time requires for a single execution.

If you need below 30 seconds, Use advance option and put this cron expression 0/30 * * ? * * *

Thanks,
Ashok :slight_smile:

A Flowchart would be better than a Do While, it makes error handling easier. Basically each time around the Flowchart you’d take one screenshot - and all the processing steps would be inside a Try/Catch so the Job doesn’t fault if there’s a problem.

don’t forget to use the shouldstop Activity. if you don’t use it then you cannot stop it.

Hi @ulises.ariza ,

  • Use a time trigger in UiPath Orchestrator to start the process at regular intervals (e.g., every minute).
  • Configure retry policies to handle failures.
  • Ensure the process handles completion and exceptions gracefully.

This approach ensures continuous execution without the risks associated with a single, long-running process.

Regards
Sandy

Hello @sandyarpa767, @irahmat, @postwick, @ashokkarale and @mkankatala. Thank you so much for your answers, I was only able to see them now as I had already finished my workday.

I will try answer all of you one by one.

  • @mkankatala: Thank you for the input, I did now know you could use while conditions that way but I do understand why it’s not recommended. When I presented this option in my mind was like the brute force option that would be used only if I couldn’t work with any other option. I will have your input in mind if this situation happens. Thank you!

  • @ashokkarale: Thank you afor the input. I have some doubts about this, because I looked for answers in the forum before posting and when reading about setting up a time trigger every minute the main question that came to mind was - wouldn’t that generate A LOT OF JOBS? It is true that my process runs for 3-4 minutes every time so I could set up the time trigger every 5 minutes and it would simulate that it’s processing 24/7 and then when I need to stop it I would just disable the trigger. Thank you!

  • @postwick: Thank you for the input. I must admit that I can’t visualize this solution in my head, how would you create the Flowchart to make it run 24/7? Would you loop the flow everytime the processing steps finish? Thank you

  • @irahmat: Thank you for the input. I did not know there was a shouldstop Activity and I will have it in mind in case I end up doing the “While option” as a last resort.

  • @sandyarpa767: Thank you for the input. My concerns are the same that I told Ashok, wouldn’t that create too many jobs or it would just create one and will have it stored until the job currently processing finishes?

Again, thank you all for the input :smiley:

Yes. A Flowchart IMO just makes it easier to visualize the loop and to separate processing steps from non-processing steps.

Hello all,

Sorry for my delay for the answer but I have good news regarding my process. I talked with the client and they told me that even though the process should simulate 24/7 monitoring the process should only be executed once every hour.

That means that I will use @ashokkarale solution to trigger the process to run every hour and because the process does not last nearly as long I don’t think I’ll have any problems with it.

Thank you so much for all the input given in for my issue.

1 Like

@ulises.ariza,

That’s great! Kindly close the thread by marking my answer as solution.

Thanks,
Ashok :slight_smile:

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