Get Queue Item
Get Queue Item
Section titled “Get Queue Item”Type: queue-get-item · Package: Queue Activities v1.0.0 · Output: ZoanQueueItem
Takes the next item from a work queue and locks it for this execution. It is the activity that the consumer (performer) uses in each turn of its loop. If the queue is empty, returns null.
How it works
Section titled “How it works”The operation is atomic: Zoan Cloud delivers the item, changes it to state in_progress and reserves it for your execution, so that no other bot can take it. That’s why several performers can read the same queue in parallel without processing an item twice.
The delivery order respects priority (high before normal before low) and deferUntil (postponed items are not delivered before their time).
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
queueName | expression | Queue name. It must exist in the execution environment. |
Output
Section titled “Output”Returns a ZoanQueueItem, or null if the queue has no pending items. Always check null to get out of the loop:
Example
Section titled “Example”The typical performer loop: take items until the queue is empty.
While condition = true └─ body: Get Queue Item queueName = "facturas-por-validar" → output: item
If condition = = item == null └─ then: Break (cola vacía → terminar)
(… procesar = item.SpecificContent["facturaId"] …)
Set Transaction Status item = = item status = successfulRelated activities
Section titled “Related activities”- Set Transaction Status — report item success or failure.
- Postpone Transaction — postpone the item until later.
- Add Queue Item — encolar trabajo.