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:
- Queries the Robomotion Orchestrator for the next available item (highest priority first)
- If Start Transaction is true:
- Marks the item as "inProgress"
- Decrements the try count
- Assigns the item to this robot
- If no item is available, outputs null for Item ID and Item
- If an item exists:
- Retrieves encrypted data
- Decrypts using AES or RSA decryption
- Outputs Item ID and decrypted Item data
- 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 Code | Description | Solution |
|---|---|---|
| Core.Queue.Get.ErrOnCreate | Failed to parse node configuration | Verify node configuration is valid JSON |
| Core.Queue.Get.OnMessage | Message parsing failed | Check input message format is valid |
| Core.Queue.Get.ErrCredentials | Invalid or missing credentials | Verify 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.AESKeyItem | AES decryption failed | Verify AES key matches the one used to add items |
| Core.Queue.Get.RSAKeyPairItem | RSA decryption failed | Verify RSA key pair matches |
| Core.Queue.Get.OnMessage | "Unsupported vault item type" | Use AES Key or RSA Key Pair |
| Core.Queue.Get.OnMessage | HTTP request error | Check network connectivity |
| Core.Queue.Get.OutputMarshal | Failed to serialize output | Check 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 Erroris 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
Related Nodes
- Wait Item - Alternative that waits for items instead of returning null
- Update Item State - Required to complete transaction
- Delete Item - For removing processed items
- Add Item - For adding items to queue
- Get Items - For monitoring queue status