Managing Bot Activity: Scheduled Idle Periods for Project Efficiency

Hi,

I need some insight. In one of my projects, the Bot runs for 48 hours. However, the Bot needs to stay idle or pause for exactly 1 hour from 11 am to 12 pm IST, and then continue the process until 11 am, after which it should idle again. How can I achieve this?

Any help is appreciated. Thanks in advance!

Hi @jai_kumar2

You can schedule ending of job execution using stop or kill based on your process design.

Create multiple triggers with your required running periods and mention how long the bot should run. Assuming in your case the bot actually starts running at 12pm and ends at 11pm end set the scheduling time for 11 hours and stop option if you are dealing with queues.

@jai_kumar2 Idle means you want to run another process through same bot or just want to wait for 1 hr!?

If you want to resume the process and trigger it again from the same point you can use Resume After Delay Activity

→ Download a package UiPath.Persistance.Activities Version 1.4.6
→ Add If Activity before getting the next transaction item
→ Condition: Now.Hour>=11 Or Now.Hour<=12
→ Add Resume After Delay Activity before getting the next transaction item,
→ Value for Resume Activity:CDate(Now.ToString("MM/dd/yyyy 12:00:00"))

Screenshot for your reference:

Note: Using Persistance Activities in a process needs one more step,
→ Goto Project setting.
→ Enable Support Persistance option

Screenshot for your reference:

Reference Video:

And, If you just want to wait the bot execution for that one hour

In UiPath, you can achieve this by using the “Delay” activity to pause the execution of the bot for the required duration.

So before getting the next transaction item, In Get transaction State.

  1. Get the current time.
  2. Check if the current time is between 11 am and 12 pm IST.
  3. If the current time is between 11 am and 12 pm IST, use the “Delay” activity to pause the bot for 1 hour.
  4. Bot will resume after 1 hr.

Best Regards,
Ajay Mishra

Hi, thanks for the reply. I’m currently working on implementing an if condition where the process should go to the ‘else’ part if the time is between 1:20 AM and 2:31 AM. I’m using the following condition:

DateTime.Now.TimeOfDay >= New TimeSpan(1, 20, 0) AndAlso DateTime.Now.TimeOfDay <= New TimeSpan(2, 31, 0)

image

However, it seems that the process is not behaving as expected. It’s going to the ‘else’ part at the wrong time. Any insights on what might be causing this issue?

Hey @jai_kumar2

The Condition which you provided is correct, I tried it!

DateTime.Now.TimeOfDay >= New TimeSpan(1,20,0) AndAlso DateTime.Now.TimeOfDay <= New TimeSpan(2,31,0)

It is giving me expected output!

Screenshot for your reference:

image

I think, this condition is not executing in between 1:20 AM to 2:30 AM, that why it is not going to then part.

For actual implementation you have to run above query between that time.

or try below query:

DateTime.Now.AddHours(9).TimeOfDay >= New TimeSpan(1,20,0) AndAlso DateTime.Now.AddHours(9).TimeOfDay <= New TimeSpan(2,31,0)

Note: While executing above query time was 17 hr & 13 mins that’s why I added 9 hrs to satisfy the condition as mentioned in below screenshot. (You can change accordingly)

image

Regards,
Ajay Mishra

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