AI workflow error handling starts with sorting the failure: retry rate limits, overloads, timeouts and server errors, but never spend caps or billing errors, because a capped Anthropic account stays blocked until next month unless the limit is raised. SwiftBiz's Fallback Ladder then adds 4 rungs: retry with backoff, a second model, a queue for a person, and an alert.
This guide is for an owner and whoever maintains their workflows. SwiftBiz's founder, Harry, was a Senior SDET for 10+ years. Every error code and setting below was checked against Anthropic, OpenAI, n8n, Make and Zapier documentation on November 14, 2026. Below: which errors to retry, the five setup steps, how to test them, and when the full ladder is overkill.
Which AI API errors are worth retrying?
Retry errors that mean "busy". Do not retry errors that mean "blocked" or "wrong". The trap: one status code, 429, means both a short rate limit and a spend cap that can last weeks. Read the error type, not just the number.
| Failure | Anthropic (Claude) | OpenAI | Retry? | What the workflow should do |
|---|---|---|---|---|
| Too many requests | 429 rate_limit_error | 429 rate limit or slow_down | Yes | Wait for the retry-after header, then retry |
| Provider overloaded | 529 overloaded_error | 503 server_is_overloaded | Yes, briefly | Back off, then switch to the second model |
| Server error | 500 api_error | 500 server error | Yes, unless x-should-retry is false | Exponential backoff, a few tries |
| Timeout | 504 timeout_error | Request timeout | Once | Retry once, then second model or queue |
| Spend cap or no credit | Tier spend-cap 429, 400 for your own spend limit, 402 billing_error | 429 credit_balance_exhausted, organization or project spend limit | No | Queue the work, alert the owner now |
| Bad request or key | 400, 401, 403, 413 | 400, 401, 403 | No | Queue, alert the maintainer, fix the workflow |
| Malformed output | HTTP 200, but the reply fails your checks | Same | Once | Ask again once, then queue for a person |
Anthropic's API errors page says a tier spend-cap 429 "has no retry-after header and keeps failing until access resumes." Its rate limits page lists monthly spend caps of $500 USD on the Start tier, $1,000 on Build and $200,000 on Scale, and says usage pauses "until 00:00 UTC on the first day of the next month" unless you get a higher limit. OpenAI's error codes guide puts it in one line: "Retrying billing, spend, or quota errors won't restore API access."
The busy rows are temporary. Anthropic calls a 529 "temporarily overloaded" and says to retry a 500 only if the response's x-should-retry header is not false; its SDKs back off exponentially between tries. OpenAI says to follow Retry-After and, without it, to use exponential backoff with jitter and a limited number of retries.
What is SwiftBiz's Fallback Ladder?
The Fallback Ladder is SwiftBiz's four-rung design for an AI step that fails: retry the same model with backoff, switch to a second model, put the item in a queue for a person, and alert someone, climbing a rung only when the one below is used up or does not apply. A spend-cap error skips straight to rungs three and four, because rungs one and two cannot fix it.
What do you need before you start?
- A list of every AI step in the workflow and what the customer sees if it stops: a chat reply, an email draft, a sorted ticket, an extracted invoice.
- A second model on a different provider, with its own API key, tested on your real prompts.
- A queue a person already checks: a Slack channel, a shared inbox label, a spreadsheet tab or a helpdesk view.
- A named person for alerts, plus a backup.
- For steps that write data (send an email, create an invoice), a way to tell whether the first attempt went through, so a retry does not repeat it.
Step 1: How do you send each error down the right path?
Catch the error instead of letting the workflow stop, then handle the node's two outputs separately. In n8n, open the AI node's Settings and set On Error to Continue (using error output), which n8n's node settings docs describe as passing "error information to the next node for potential handling."
Error output. It carries only the calls the provider or the node rejected. Connect it to a Switch node with two branches:
- Retry branch: 429 rate limits, 500, 503, 504 and 529.
- Stop branch: spend caps, credit and billing errors, 400, 401, 403 and 413.
Success output. A call that returns HTTP 200 with a malformed reply never reaches the error output, so the Switch cannot see it. Put a validator on the success output before anything else uses the reply: an If node or a Code node that checks the reply parses, the required fields are present and the values are in range. Replies that pass carry on. Replies that fail go to the Output branch: ask the model again once, then queue the item for a person.
In the Switch, match on the error type and code (overloaded_error, OpenAI's credit_balance_exhausted, Anthropic's enforced_spend_limit_reached), not only the status code, so the two kinds of 429 land in different branches. Anthropic's spend-cap 429 has the same rate_limit_error type as a rate limit, so its code is the only reliable tell. In Make, the error split is an error handling route on the AI module; in Zapier, it is an error handler added to the AI action step, which runs a separate Error path when that step fails. On both, the output check is a separate filter placed after the AI step on the normal route, because an error route never sees a successful call with a bad reply.
Step 2: How should retries and backoff be set?
Retry fast and few times for anything a customer is waiting on, and slower for background work. Each platform caps its built-in retries differently:
| Platform | Built-in retry | Limits on the publisher's page |
|---|---|---|
| n8n | Retry On Fail in node Settings | Wait Between Tries up to 5,000 ms, Max Tries up to five; the HTTP Request node doesn't honour Retry-After |
| Make | Automatic retry of incomplete executions | Rate limit, connection and timeout errors retried 8 times over 7 hours 51 minutes; the Retry error handler defaults to 3 attempts, 15 minutes apart |
| Zapier | Autoreplay | Replays errored runs; not on the Free plan |
| Claude SDK in code | Built into the official SDK | Two retries by default with exponential backoff, honouring retry-after |
Sources: n8n's rate limits guide, Make's automatic retry page, Zapier's autoreplay article and Anthropic's errors page.
Three rules keep retries from making things worse:
- Size the wait to the reader. A live chat can absorb a few seconds; n8n's five-second ceiling fits it. A nightly report can wait for Make's hours-long schedule. For a longer wait in n8n, n8n's guide says to use Loop Over Items with a Wait node.
- Don't stack retries. If your own code calls an SDK that already retries twice, and the node around it allows five tries, one overloaded call can become up to 15 requests (3 × 5). OpenAI's guide tells you to account for SDK retries when you add your own.
- Retry only steps that are safe to repeat. Asking a model to classify an email twice costs a little extra. Sending the customer two replies costs trust.
Step 3: When should the workflow switch to a second model?
Switch after the retries for an overload, server error or timeout are used up, and choose a backup on a different provider so one outage cannot take out both.
n8n documents an Enable Fallback Model parameter on its AI Agent Tool node: "When enabled, n8n prompts you to connect a backup chat model to use in case the primary model fails or isn't available." The main AI Agent node's documentation page does not list that parameter, so check that the toggle appears in your n8n version before you design around it. If it does not, n8n's template gallery has a model failover chain that loops through models with a fail_count counter and, in its own words, stops with an error "if all connected models are tried and fail."
Two checks:
- Test the backup on your real prompts. Claude and GPT models format output differently, and a prompt tuned for one can break a parser downstream. Our Claude vs ChatGPT comparison covers where they differ.
- Decide whether a spend cap should fail over. Routing around a cap you set yourself defeats the budget control. If the cap is there to stop runaway cost, let the item fall to the queue instead.
Step 4: What should the customer see when every model fails?
The customer should get an honest holding reply and a human path, and the work item should land in a queue where nothing is lost. That queue is often called a dead-letter queue: a holding list of items the automation could not finish, kept with their original input so a person can complete them or replay them later.
In practice: a chat says "I can't answer that right now; leave your email and someone will reply today," an inbound email goes to a "needs a person" label, and a failed invoice goes to a review folder with the error attached.
The minimum version is a canned reply. A low-volume site chat with one model can still fail honestly: when the model does not answer, the visitor gets a short message with an email address and a booking link, not a spinner. That suits a site chat, not a support line.
A failure queue is not an approval gate. If you also want people to approve risky actions on normal days, that is a separate design, covered in our human-in-the-loop approval guide.
Step 5: Who gets alerted, and when?
Alert a person when the ladder runs out, and immediately on any spend-cap or key error. Alerting on every retry trains people to mute the channel.
In n8n, this is an error workflow. Per n8n's error handling docs, it starts with the Error Trigger node, you pick it under Settings > Error workflow in each workflow you want covered, and one error workflow can serve many workflows. Its payload includes the failed node and the error message. Two details catch people out, both from the Error Trigger docs: you have to publish the workflow that uses the Error Trigger, and "you can't test error workflows when running workflows manually." Add a Stop And Error node at the end of your queue branch so a fully failed item also fires the alert.
In Make, an item is marked Unresolved when all its automatic retries fail, so point your alert at that final state rather than at the first error.
Want the ladder designed and tested on your workflows? SwiftBiz's AI Readiness Audit maps every AI step and its failure path for $3,500 CAD, credited toward your retainer.
Step 6: How do you know the fallbacks actually work?
Break each rung on purpose in a copy of the workflow. Run each test as a triggered production execution, because n8n's error workflow does not fire on manual runs:
- Bad key: swap in an invalid API key. You should see the stop branch, a queued item and an immediate alert.
- Simulated outage: point the primary model's connection at an address that does not respond. After the retries, the second model should answer.
- Forced failure: drop a Stop And Error node after the AI step and check that the error workflow fires on a scheduled or production run.
- Bad output: feed an input that produces a reply your parser rejects, and confirm it is retried once and then queued.
Then write down, for each workflow, the longest a customer can wait before rung three kicks in.
When isn't the full ladder worth it?
- For an internal nightly report, choose retry plus an alert. Nobody is waiting, and a person can rerun it in the morning.
- For a regulated output (credit, health, legal), skip the automatic second model unless it has been reviewed and approved like the first. Queue the item instead.
- For a workflow that runs a few times a day, a queue and an alert usually beat a second provider, which means another account, key and prompt to maintain.
- For malformed output that keeps happening, a retry hides a prompt or schema problem. Structured output features help, but OpenAI's Structured Outputs guide still says your application needs to handle "refusals, incomplete responses, and API errors." Fix the cause.
If you want this built rather than read about, our AI workflow automation service includes failure paths in every build. Retainers start at $4,500 per month, an extra workflow is +$2,500 per month, and all SwiftBiz prices are in Canadian dollars. Our target is 20+ hours saved per week per client and a first production workflow in 4 to 8 weeks. For the n8n basics behind these settings, see our guide to building AI workflows in n8n.
Written by Harry, Founder & Lead AI Engineer at SwiftBiz. Error codes and settings were checked in Anthropic, OpenAI, n8n, Make and Zapier documentation on November 14, 2026. Vendor prices are in USD as listed.