Lock queue items with same reference number for other BOTS

I am working on a usecase where the BOTs will be picking up the queue item on the basis of reference number and more than one queue item can have same reference number so if BOT1 has picked up a queue item then BOT2/BOT3 should not pick any queue items that have same reference number .
Only when BOT1 successfully finishes the transaction then other queue items of same reference number should be available for other BOTS to work on it.
Can anyone please suggest the way to do so.

Hi @Zara ,

What you can do in this case is to use the activity “Get Queue Items” with the property “In Progress” activated, and the filter set to the Reference that you want to use

(Assuming that you’re referring to the QueueItem Reference with this reference number)

If the activity returns any items, it means that you already have an item with that reference already running. Then you’d skip it or process it later, depends on the process needs.

var_ItemsFound.Count > 0

On the other hand, if the activity returns 0 items, it means that no other item with the same reference is being worked in parallel.

var_ItemsFound.Count = 0




1 Like

can u please share a sample flow of the same?..would be really helpful

Hi @Zara

There you go

Demo_ItemsRunning.xaml (7.9 KB)

Hope this helps!

in the xaml you have shown to skip the process but when the job will be running…as per business requirement if BOT1 is accessing a queue item of 1 reference number then BOT2/bot3 needs to pick the next queue item of different reference number…it needs to keep on skipping the queue items of same reference number which is “INPROGRESS” state of BOT1…

I think I get your point.

If you’re using REFramework, you can still integrate the code I did provide before, to get a list of all the items in “new” state, and all the items in “new status” (in 2x different requests).

For each item in progress, if the list of “New” items has any of the same reference, you remove it from the list, meaning that you remove all the New Items, that have a “In Progress” item with the same reference:

1,2,5 are running, therefore I remove them from the “New” list.


When you’ve decided that “3” will be your next item since it is the 1st one found, and not running, you send it to the “GetTransactionItem” as Reference Filter:

Hope this is what you need now.
If I’m not getting it correctly, please if you could provide more information, it would really help!

Best Regards