Skip to content

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.

ParameterEditorDescription
itemexpressionThe ZoanQueueItem returned by Get Queue Item (e.g. = item).
statusenumsuccessful (success) or failed (error).
ParameterEditorDescription
outputJSONObject with the result of the processing. Only for status = successful. It is saved in item.Output.
exceptionJSONObject with error detail (e.g. { "type": "...", "message": "..." }). Only for status = failed.
retryablebooleanOnly for failed. true (default) = respects auto-retry of the queue. false = flag failure immediate without retry.

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.

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 = true