Wait Item
Waits to retrieve a new item from the specified Robomotion Queue.
Common Properties
- Name - The custom name of the node.
- Color - 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 - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if Catch node is used.
Input
- Queue Name - Name of the queue to retrieve an item from.
Output
- Item ID - Retrieved item's unique ID.
- Item - Retrieved data of the item.
Options
- AES Key / RSA Key Pair - The AES/RSA Key encryption used to encode/decode the message contents.
- Timeout (s) - The time until the queue retrieval will be cancelled.
- Poll Time (s) - The time between each retry attempt to try to retrieve an item from the Robomotion Queue.
- Start Transaction - Whether to start a transaction before retrieving the item. If it is true.
How It Works
The Wait Item node continuously polls a queue until an item becomes available or timeout occurs:
- Immediately checks for available items (first attempt)
- If item found:
- If Start Transaction is true, marks as "inProgress" and decrements try count
- Decrypts and outputs the item
- Execution continues
- If no item found and timeout not reached:
- Waits for Poll Time duration
- Checks again (repeats)
- If timeout reached without finding item:
- Throws timeout error
- Minimum Poll Time is 30 seconds (automatically adjusted if set lower)
Requirements
- Queue Name must be specified
- Valid encryption key (AES or RSA key pair) matching the one used when adding items
- Poll Time should be reasonable (minimum 30 seconds, default 30 seconds)
- Timeout should be greater than Poll Time (or 0 for infinite wait)
Error Handling
| Error Code | Description | Solution |
|---|---|---|
| Core.Queue.Wait.ErrOnCreate | Failed to parse node configuration | Verify node configuration is valid JSON |
| Core.Queue.Wait.OnMessage | Message parsing failed | Check input message format is valid |
| Core.Queue.Wait.ErrCredentials | Invalid or missing credentials | Verify encryption key exists in vault |
| Core.Queue.Wait.OnMessage | "Get queue name error" | Ensure Queue Name is provided |
| Core.Queue.Wait.ErrTimeout | "Wait item timed out" | Item not available within timeout period - increase timeout or check queue |
| Core.Queue.Wait.Terminate | "Wait item terminated" | Flow was closed/stopped during wait |
| Core.Queue.Wait.OnMessage | HTTP request error | Check network connectivity |
| Core.Queue.Wait.OnMessage | "Hex decode error" | Data corruption - verify encryption keys match |
Usage Examples
Example 1: Continuous Queue Processor
Wait for items and process them continuously:
[Label: "ProcessLoop"]
↓
[Wait Item]
Queue Name: "OrderProcessing"
Timeout: 3600 (1 hour)
Poll Time: 30
Start Transaction: true
Output: itemId, itemData
↓
[Process Order: itemData]
↓
[Update Item State: Successful]
↓
[Delete Item]
↓
[Go To: "ProcessLoop"]
Example 2: Event-Driven Processing
Wait indefinitely for webhook data:
[Wait Item]
Queue Name: "WebhookEvents"
Timeout: 0 (infinite)
Poll Time: 60
Start Transaction: true
Output: itemId, eventData
↓
[Process Webhook Event]
↓
[Update Item State: Successful]
Example 3: Scheduled Processing with Timeout
Wait for a limited time during business hours:
[Wait Item]
Queue Name: "DailyReports"
Timeout: 300 (5 minutes)
Poll Time: 30
Start Transaction: true
↓ (success)
[Process Report]
↓ (timeout error caught)
[Log: "No reports to process today"]
Usage Notes
- When
Continue On Erroris enabled, errors are not caught even if Catch node is present - Default and minimum Poll Time is 30 seconds (values below 30 are adjusted to 30)
- Timeout of 0 means wait indefinitely until item arrives
- Unlike Get Next Item, Wait Item blocks until item available or timeout
- Checks occur at: t=0s, t=PollTime, t=2×PollTime, etc.
- If timeout occurs exactly when checking, still attempts to get item before failing
- Start Transaction true: marks item as inProgress and decrements try count
- Network errors during polling will throw error and stop waiting
- Closing the flow during wait triggers "Terminate" error
Tips
- Use Wait Item for event-driven workflows where you expect items to arrive
- Use Get Next Item for polling-based workflows where items may not always be available
- Set Poll Time based on expected item arrival frequency (30s for frequent, 60-300s for infrequent)
- For continuous processing, use infinite timeout (0) and graceful shutdown with Should Stop
- Combine with Should Stop node to allow clean shutdown during long waits
- Handle timeout errors appropriately (they're not always failures)
- Use reasonable timeouts to avoid indefinite blocking
- For critical processes, use shorter poll times (30-60s)
- For background processes, longer poll times (120-300s) reduce API load
- Always use Start Transaction: true for processing workflows
- Catch timeout errors if empty queue is a valid state
- Monitor polling frequency to avoid overloading the Orchestrator
Related Nodes
- Get Next Item - Non-blocking alternative
- Update Item State - For completing transactions
- Delete Item - For removing processed items
- Should Stop - For graceful shutdown during waits
- Add Item - For adding items to queue