How to Stop all bots but one running a process

Hey all,

Right now I have a single process that has 3 bots running at the same time. Each loop on each bot will pull an item from the queue, process that data, store the processed data into a global DataTable, and repeat until the queue is empty and then put the DataTable into an excel file and email that file. I am trying to stop 2 of the bots early so the last bot can collect all the data from all three bots and only send one email & api call, instead of 3. The gist of the logic I am currently using is below:

Get Queue Item

Get Queue Count

If Queue Count = 15 or Queue Count = 5 process that Queue Item, then stop

Else continue processing until queue is empty.

The two numbers are arbitrary, just used to flag the bot to stop. The issue we are running into is that sometimes two bots will hit the same number and the rest of the process won’t finish (ex. two of the bots will hit 15 and the last one will hit 5 and leaving a couple items in the queue and no email gets sent). From what I understand, the orchestrator queue count doesn’t refresh fast enough when the bots are checking the count. Is there a way to make sure two bots will never hit the same stop number?

Thanks all!


Indeed, the orchestrator does not refresh fast enough. If you know the average time the robot takes to process one item, you can play with the boundary? For example, you put two same boudaries (in input arguments) for the first two processes, and one bigger for the last one, so you’re sure the last one will finish after the others. You can put this value in the Get Transaction Data, as below:

Good luck!


We changed up the methodology for sending the email. Instead of using numbers as a stop flag, we are using the output files. Since we have 3 bots running, if there are less than 3 files I stop the process on the current bot. If there are 3 files, I check the file with the most recent creation date and the bot that created that file will collect the three files and email them.

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