Get Queue Items - Order

Why is it that “Get Transaction Item” always gets the oldest “New Item” But Get “Queue Items” the list is from newest to oldest.

Could the option to reverse the list be added instead of having to mess around with skipping items.

Reasoning

We have one process that downloads pdfs.
The process runs twice a week Monday and Tuesdays
We then have to wait a period of time,
Run the Download process for Mondays additions.
Then run the process for the Tuesdays Additions.

However with out messing around with counts and skipping items theres no easy way of doing them in the required order.

Hi @rmorgan

Get Transaction Item always returns the oldest New item because queues are processed in a FIFO transactional model.

Get Queue Items, however, returns a collection, and UiPath orders that list descending by QueueItemCreationTime (newest → oldest).

If you need the same FIFO order when working with Get Queue Items, you can simply re‑sort the list:

queueItems = queueItems.OrderBy(Function(q) q.QueueItem

This gives you a clean oldest → newest sequence without using skip logic or counters.

For scenarios like processing Monday items first and Tuesday items after a delay, just apply your date filter + the sort above, and the execution order will match the transactional FIFO behaviour.

Happy Automation

1 Like

The issue with this is that there could potenially be 2000+ queue items, and get queue items only returns 100 aat each request?

@rmorgan

Yes, that’s correct Get Queue Items returns a maximum of 100 items per call (API limitation).

If you need to handle 2000+ items, the proper approach is to use pagination:

Use Skip and Top parameters in a loop
Increment Skip by 100 each iteration
Continue until no more items are returned

However, if strict processing order matters, it’s usually better to design the queue accordingly (e.g., use Priority, filtering via SpecificData, or separate queues) rather than pulling large batches and reordering client-side — especially in concurrent scenarios.

Got you @rmorgan

The recommended approach is to paginate using the Offset property:

  1. Use a While loop
  2. Inside it, call Get Queue Items with
  • Top = 100
  • Offset = offsetCounter
  1. Add the returned items to a List
  2. Increase offsetCounter = offsetCounter + 100
  3. Stop when the batch count = 0

After all items are collected, sort them in FIFO:
allItems = allItems.OrderBy(Function(q) q.QueueItemCreationTime).ToList()

This avoids skipping logic, works for 2000+ items, and gives you the same ordering as Get Transaction Item.

Hi @rmorgan

Yes by default Get Transaction item will pick on the first come first serve basis. So it will pick the oldest new item.

Coming to Get Queue items activity, yes it will get only 100 transaction items per once. So you have to keep the Get Queue items activity in the loop and append the transactions to one variable. So it will all the transactions which are in new in a Queue by this method.

Hope it helps!!