QUEUE Get next item function

The QUEUE Get next item function in RPA.

Help CentreOrchestration

This article describes the RPA Queue functionality to get the next unprocessed item from a queue.

For a full list of available functions, please read QUEUE functions.


Description

The Get next item function atomically retrieves and locks the next unprocessed item from a queue. The item is assigned to the current bot and its status changes from "new" to "inprogress". Items are returned in priority order (high first), then by creation date. Deferred items are skipped until their defer date has passed. This is typically used in a performer process loop.


Setting it up

To use the Get next item function, follow these instructions:

{{popups:rpas/add:action=queue-get-next}}

Once on a process map:

  1. Navigate to the process where you would like to add the function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the QUEUE Get next item option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
Queue IDYesText-The ID of the queue, or a variable such as {queue_id}
VariableYesText-Variable to store the queue item (null if queue is empty)

Output variables

VariableTypeDescription
VariableObject or nullThe queue item with id, reference, specificContent, priority, status. Null if no items available.

Errors

  • Queue not found – if the queue ID is invalid

Tips

  • Use this in a loop: get next item, process it, mark complete or failed, repeat until null
  • Multiple bots can safely call this on the same queue – each bot gets a different item
  • Access the item’s data via {variable.specificContent.fieldName}
  • Check if the variable is null/empty to know when to stop the loop

Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.