API Error Handling
Handling API failures: rate limits, timeouts, retries, idempotency, circuit breakers and schema drift.
Articles in API Error Handling
- Idempotent AI Automation: How to Stop Duplicates, Retries and Replays from Doing Damage — A retry creates two CRM records and two welcome emails, and nothing was technically a bug. Idempotency is the design idea that prevents it. This guide covers where duplicates come from and the concrete patterns, code and tests that make workflows safe to repeat.
- Circuit Breakers for AI Automation: Stopping Calls to a Failing Service Before It Makes Things Worse — A single failing LLM call is a nuisance. An automation that keeps retrying that same failing call, at volume, while the provider is degraded, turns a nuisance into a pile-up -- slower failures, wasted spend, and a queue that never drains. A circuit breaker exists to stop that from happening.
- Upstream API Schema Drift: What It Silently Breaks in Your AI Automation — A version bump tells you an API changed. A silent field rename doesn't — and your automation keeps running, just on assumptions that stopped being true.
- Setting AI Automation Timeouts Correctly for Long-Running LLM Calls — A timeout copied from a typical API integration is often wrong for an LLM call — long reasoning tasks legitimately take longer, but a stuck request shouldn't hang forever either. Here's how to actually set it.
- Designing AI Automations That Survive Provider Rate Limits and Outages — A 429 from the model provider shouldn't mean a lost webhook event. Here's the queue-and-backoff pattern that keeps an AI automation alive during an outage.