Set Transaction Status
Set Transaction Status
Section titled “Set Transaction Status”Type: queue-set-transaction-status · Package: Queue Activities v1.0.0 · Output: —
Close the transaction of an item: mark it as successful (processed correctly) or failed (processed with error). It is what the performer does when finishing each item. The item must be in_progress and have been taken by this run with Get Queue Item.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
item | expression | The ZoanQueueItem returned by Get Queue Item (e.g. = item). |
status | enum | successful (success) or failed (error). |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
output | JSON | Object with the result of the processing. Only for status = successful. It is saved in item.Output. |
exception | JSON | Object with error detail (e.g. { "type": "...", "message": "..." }). Only for status = failed. |
retryable | boolean | Only for failed. true (default) = respects auto-retry of the queue. false = flag failure immediate without retry. |
When to use retryable = false
Section titled “When to use retryable = false”By default, a failed item is retried if the queue has auto-retry and retries remain. That’s correct for system errors (the website went down, a timeout). But for business errors — an invalid data, a missing field — retrying would give exactly the same error: there it uses retryable = false to fail once and for all. See retries.
Example
Section titled “Example”Process the item within a Try / Catch and report based on the result:
Try └─ body: (… procesar la factura …) Set Transaction Status item = = item status = successful output = { "validada": true, "revisadaPor": "bot" } └─ catch (err): Set Transaction Status item = = item status = failed exception = { "message": = err.Message } retryable = trueRelated activities
Section titled “Related activities”- Get Queue Item — grab the item before closing it.
- Postpone Transaction — instead of closing, postpone the item.
- Try / Catch — catch the error to report it.