Skip to main content

Get Next Item

Retrieves the next item from a specified queue.

Properties

  • Name (string) - The custom name of the node.
  • Color (hex) - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error (bool) - Automation will continue regardless of any error. The default value is false.
info

If ContinueOnError property is true, no error is caught when the project is executed, even if the Catch node is used.

Output

  • Item ID - The ID of the retrieved item.
  • Item - The data of the retrieved item.

Options

  • Queue Name - The name of the queue you want to retrieve items from.
  • AES Key / RSA Key Pair - The AES key / RSA key pair used to encrypt and decrypt queue items.
  • Start Transaction - Starts a transaction (starts decrementing try count) if set to true.

How It Works

The Get Next Item node retrieves the highest priority available item from a queue:

  1. Queries the Robomotion Orchestrator for the next available item (highest priority first)
  2. If Start Transaction is true:
    • Marks the item as "inProgress"
    • Decrements the try count
    • Assigns the item to this robot
  3. If no item is available, outputs null for Item ID and Item
  4. If an item exists:
    • Retrieves encrypted data
    • Decrypts using AES or RSA decryption
    • Outputs Item ID and decrypted Item data
  5. Robot can then process the item and update its state

Requirements

  • Queue Name must be specified
  • Valid encryption key (AES or RSA key pair) in vault matching the one used when adding items
  • Items must exist in the queue (or outputs will be null)

Error Handling

Error CodeDescriptionSolution
Core.Queue.Get.ErrOnCreateFailed to parse node configurationVerify node configuration is valid JSON
Core.Queue.Get.OnMessageMessage parsing failedCheck input message format is valid
Core.Queue.Get.ErrCredentialsInvalid or missing credentialsVerify encryption key exists in vault
Core.Queue.Get.OnMessage"Get queue name error"Ensure Queue Name is provided
Core.Queue.Get.OnMessage"Hex decode error"Data corruption - verify encryption keys match
Core.Queue.Get.OnMessage"AES key decode error"AES key format is invalid
Core.Queue.Get.AESKeyItemAES decryption failedVerify AES key matches the one used to add items
Core.Queue.Get.RSAKeyPairItemRSA decryption failedVerify RSA key pair matches
Core.Queue.Get.OnMessage"Unsupported vault item type"Use AES Key or RSA Key Pair
Core.Queue.Get.OnMessageHTTP request errorCheck network connectivity
Core.Queue.Get.OutputMarshalFailed to serialize outputCheck message structure

Usage Examples

Example 1: Process Orders from Queue

Standard queue processing pattern:

[Get Next Item]
Queue Name: "OrderProcessing"
Start Transaction: true
Output: itemId, itemData

[If itemId is not null]

[Process Order: itemData]

[Update Item State]
Item ID: ${itemId}
Status: Successful

Example 2: Process with Error Handling

Handle processing errors with retry logic:

[Get Next Item] → itemId, itemData

[Try: Process Item]
↓ (success)
[Update Item State: Successful]
[Delete Item]
↓ (error)
[Update Item State: Failed]
(item will retry based on try count)

Example 3: Batch Processing

Process multiple items in a loop:

[Label: "ProcessLoop"]

[Get Next Item]
Start Transaction: true
Output: itemId, itemData

[If itemId != null]

[Process Item]

[Update Item State: Successful]

[Go To: "ProcessLoop"]

Usage Notes

  • When Continue On Error is enabled, errors are not caught even if Catch node is present
  • Start Transaction true: Decrements try count and marks item as in-progress
  • Start Transaction false: Retrieves item without modifying state (read-only peek)
  • Returns highest priority item first (High > Normal > Low)
  • Within same priority, processes oldest items first (FIFO)
  • If queue is empty, Item ID and Item outputs are null
  • Always check if Item ID is null before processing
  • Transaction must be completed with Update Item State or Delete Item
  • Item remains "inProgress" until state is updated

Tips

  • Always use Start Transaction: true for processing workflows
  • Check if itemId is null before attempting to process
  • Always update item state (Successful/Failed) after processing
  • Use Try-Catch blocks to handle processing errors gracefully
  • Set appropriate Maximum Try Count when adding items (based on expected failure rate)
  • Delete items after successful processing to keep queue clean
  • Use Update Item State with "Failed" for retriable errors
  • Use "Abandoned" status for items that exceeded max retries
  • Monitor failed items and investigate root causes
  • Combine with Should Stop node for graceful shutdown in long-running processes
  • Use Progress field in Update Item State to track processing stages