Setup robot to run through queue elements only in opening hours 8.00-17.00?

Hi

I have a process where our end users generate 2-300 queue elements for a queue with the press of a button. Each queue element takes about 2-3 minutes for the robot to process.

I have currently made a queue trigger that makes the robot run as soon as a new queue element lands in the queue.

Would it be possible somehow, to run the robot as soon as a new queue element is added, but only during opening hours 8-17.00? If it is about to pick up a new queue element after this i want to send a stop message to my robot so that it stops.

My robot uses REFramework and we have an on-premise Orchestrator 2023.4.0

Hello @fredslund7889, try this:

  1. Queue Trigger: You already have a queue trigger that starts the robot when a new queue item is added. Keep this trigger as is.
  2. Add Time Check: Inside your REFramework, you can add a custom logic to check the current time before processing a new queue item. You can add this logic in the Process.xaml or within your specific workflow.
  3. Time Check Logic: To restrict the robot from running outside of the specified hours, you can use a simple IF condition to compare the current time with your defined time range (e.g., 8:00 AM to 5:00 PM).Here’s a basic example in pseudocode:
If CurrentTime >= 8:00 AM AND CurrentTime <= 5:00 PM
    Process the Queue Item
Else
    Log "Outside of working hours. Pausing the process."
    Terminate the workflow gracefully
End If

You can use DateTime functions in UiPath to get the current time and compare it with your specified hours.
4. Graceful Termination: When the robot is running outside of working hours, use the “Terminate Workflow” activity to gracefully stop the execution.
5. Notification: Optionally, you can set up a notification mechanism to alert you or the relevant team when the robot is paused due to being outside of working hours.
6. Monitoring: Continuously monitor the process and logs to ensure that it’s behaving as expected.

By implementing these steps, your robot will only process queue items during the specified hours and pause if a new item is added outside of those hours.

Cheers! :slight_smile:

1 Like

Seems like a solid approach (until UiPath introduces some inbuilt functionality in Orchestrator that achieves the same :stuck_out_tongue:)

I have marked your reply as the solution and given you a rocket as a token of my gratitude :smiley:

1 Like

Hi @fredslund7889 ,

Maybe also configuring the Postpone Property in Add Queue Item would work for your case :

That is also a good idea. The queue elements are not added by a robot in this case, but it’s nice to know the feature is there :slight_smile:

1 Like

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