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
Queue Trigger: You already have a queue trigger that starts the robot when a new queue item is added. Keep this trigger as is.
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.
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.