These actions don’t transform an order — they take it out of the normal flow. archive puts a record away cleanly; fail halts it with an error; print writes a debug message you can see in the trace harness.
archive
archive order
Archives the record. It’s no longer active in DropStream’s processing but stays available for reference and reporting. Use this for orders that are intentionally not going to be fulfilled — test orders, training orders, deliberate cancellations.
when
order.notes contains "TEST"
then
archive order
end
Archive is terminal — once a record is archived, no further rules run against it.
fail
fail order with "Missing required shipping address"
Marks the record as failed and attaches a human-readable error message. Failed orders show up in the Errors queue in the DropStream UI, where someone can investigate, fix the underlying issue, and retry.
The with "..." part is required and should describe what went wrong:
when order.shipping_address.country is blank then
fail order with "Missing shipping country for order " & order.id
end
when order.subtotal <= 0 then
fail order with "Order has zero or negative subtotal"
end
A good error message tells the operator:
- What’s wrong — name the missing field, the bad value, or the unexpected condition.
- What to do — explicit if possible. “Set the shipping country in the source system and re-import.”
-
Where it came from — include identifying info like
order.idororder.external_idif relevant.
Like archive, fail is terminal — no further rules run against a failed record.
Combinations
These actions usually appear with a condition — they’re not run unconditionally. Common patterns:
Validate, then fail:
when order.shipping_address.country is blank then
fail order with "Missing shipping country"
end
Archive a class of orders:
when
order.notes contains "TEST"
or order.notes contains "DO NOT FULFILL"
or order.customer_email ends_with "@example.com"
then
archive order
end
Tips
-
failis louder thanreject. reject silently removes a record from processing;failflags it for human attention. Usefailwhen something is genuinely wrong and a person needs to see it. -
Archive non-fulfillable orders, don’t fail them. Test orders aren’t errors.
archivekeeps them out of processing without filling the error queue.
Comments
Please sign in to leave a comment.