Something will fail. The question is what the workflow does about it, and most designs leave the default, which is to stop and tell nobody.
What are the options?
- Retry. For transient problems.
- Skip and continue. Processing the rest.
- Stop and alert. Where continuing is unsafe.
- Route aside. For later attention.
How do you choose?
By whether the failure is transient and whether continuing is safe. A timeout should be retried; a malformed record should be set aside; a failure that leaves things inconsistent should stop everything.
What is a dead letter queue?
A place failed items go for later attention. That single pattern is what lets an automation keep working on the ninety-eight items that are fine while preserving the two that are not.
Why is it better than stopping?
Because one bad item should not halt everything. A malformed record blocking a whole batch is a common and frustrating failure, and setting it aside costs nothing.
Why is it better than skipping?
Because skipping loses the item. A skipped record is silently absent, and nobody discovers it until somebody asks why something never arrived.
What about the queue growing?
A signal worth monitoring in its own right. A dead letter queue accumulating items means something systematic is failing, and the individual errors may each look like one-offs.
Alerting on the size, rather than on individual failures, catches that. A queue with three items is routine and one with sixty is telling you about a change upstream that nobody noticed.
What should you not retry?
Permanent failures. A malformed input, a missing permission or a rejected value will fail identically every time, and retrying wastes runs while hiding the real problem.
How many retries?
Three, with increasing waits, is a reasonable default. Beyond that a transient problem has become a persistent one, and continuing to try is not a strategy.
What about failures partway through an item?
The awkward case. An item half processed leaves inconsistent state, which is why recording progress per item matters and why idempotent operations make recovery tractable.
What about errors that succeed on retry?
Worth logging even though nothing failed. A step that consistently needs two attempts is telling you something about the upstream system, and it will eventually need three.
That pattern is invisible if only outright failures are recorded. Tracking retry counts alongside outcomes turns a future incident into something somebody saw coming.
What about failures you cannot classify?
Treat as permanent by default. An error nobody recognises is safer routed aside for somebody to look at than retried, since retrying an unknown problem is as likely to compound it as resolve it.
Those are also the most informative failures. A queue of unclassified errors, reviewed weekly, tends to reveal a pattern that turns into a proper handling rule, which is how error handling improves over time.
Who looks at the failures?
The question that decides whether any of this works. A dead letter queue nobody checks is a place items go to be forgotten, and it needs a person and a routine.
Checking the rejection rate is the quickest way to find out whether a review step is a control or a formality.
What is the design worth copying?
Retry transient failures a few times, route permanent ones aside with the reason, continue with the rest, and alert somebody who will look. That handles nearly everything.