Idempotent Webhook Handler Cheatsheet: Retries Are Normal, Double Work Is the Bug
blaizedsouza · x · 2026-09-12
A dev shares a production pattern for idempotent webhook handlers using a processed key, so retries don't cause double execution:
- Derive a processed key from the event id
- Execute work only on first-seen keys
- Store the result with the key; return it on retry
- Keep keys unique per tenant; test with duplicate deliveries
Core principle: the second delivery should be a no-op. Idempotency belongs in the handler code, not in a prompt instruction for the agent.
More from coding & agent
- Developer streams an AI agent playing Minecraft all day via Codex, aiming to build an auto chicken farm — nickbaumann_ · 2026-09-12
- Why working with AI agents all day is exhausting: delegation adds mental load, not removes it — bendee983 · 2026-09-12
- "Codex is my main interface to the system": user says agent made Linux admin effortless — mark_k · 2026-09-12
- Alchemy's distilled project builds unified agent-friendly SDKs for 60+ SaaS services — samgoodwin89 · 2026-09-12
- RL on just 1,700 tasks lifts Kimi K2.7 across five coding benchmarks — echen · 2026-09-12
- Expected Parrot's universal remote cache hits 30M entries to fix AI-agent reproducibility — soumitrashukla9 · 2026-09-12