Interview question - please help

  1. Is there any limit in fetching the queues from orchestrator?
  2. It is known that " The In Progress status indicates that the item is currently being worked on by a robot." Therefore no other bots take the In Progress queue, instead it takes only New queue. I have been asked several times that, what happens when 2 robots are fetching the same New queue? Will it go to any suspended state. I have answered as no, since bot takes only New queue and not In progress queue. But still the question is asked again.

@Navya_Thomas

  1. There’s no strict “limit” from a usage perspective. Orchestrator is designed to handle large volumes
  2. When both robots try to get a New transaction item, they will not receive the same item. The fetch is atomic, so once one robot picks an item, that item is immediately locked/marked In Progress for that robot. The other robot will either get the next available New item or no item if nothing is left. Hence, it will not go to Suspended just because 2 robots fetch from the same queue.

I assume question is about fetching queue items.
Yes there is limit of 100 for fetching queue items in one attempt using Get Queue items activity. To overcome the limit or get more than 100 queue items, you will have to use pagination in the activity to skip previously fetched number of queue items.

May be the interviewer wasn’t clear about the question but there is no Suspend status for queue items and you were correct even 100 bots simultaneously try to get a single queue item, it will be fetched by only the bot which reaches to the queue first. Rest will get no data.

Hey,

Your understanding is actually correct :+1: but I think the interviewer is trying to push you a bit deeper into how Orchestrator handles concurrency and locking.

From experience:

  • When multiple robots call Get Transaction Item (or similar), the operation is atomic on the Orchestrator side
  • That means:
    • Only one robot will successfully lock a given New queue item
    • The item is instantly marked as In Progress for that robot
    • Other robots will never see that same item as New

So even if 2 (or 100) robots hit the queue at the exact same time:

  • No duplication happens
  • No conflict state
  • No “suspended” state (this doesn’t exist for queue items anyway)

The others will simply:

  • Get another New item if available
  • Or get no item (null result) if the queue is empty

Best Regards,
Ghaith ABDESSALEM

  1. In UiPath Studio, the Get Queue Items activity is capped at 100 items per execution by default. When using Orchestrator API it is 1000.

  2. When a robot executes the Get Transaction Item activity, Orchestrator performs an atomic database operation.

  • The Request: Both Robot A and Robot B send a request to the New queue simultaneously.
  • The Lock: Orchestrator’s database uses a “Row-Level Lock.” It picks the oldest New item and instantly changes its status to In Progress while assigning it to Robot A.
  • The Result: This happens in milliseconds. By the time the database processes Robot B’s request (even if it was only 0.001 seconds later), that specific item is already In Progress. Robot B is then given the next available New item.