Now booking new projects — book a free 30-minute consultation. Book now
Engineering

Webhook Reliability: A Practical Guide for SaaS Founders

14 Sep 2026 8 min read
Webhook Reliability: A Practical Guide for SaaS Founders

If your product sends or receives webhooks — payment confirmations from Stripe, shipping updates from a courier API, status changes from a CRM — you have an integration that will, at some point, fail silently unless you’ve designed for it. Webhooks look simple in a demo: an event happens, a POST request arrives, your code updates a record. In production they’re one of the most common sources of “the data’s just wrong” bugs we get called in to fix. This guide is for founders and technical leads who are building or maintaining webhook integrations and want to understand what webhook reliability actually requires, not just how to wire up an endpoint.

Why webhooks are harder than they look

A webhook is just an HTTP request, so it’s tempting to treat it like any other endpoint in your API. The difference is who’s in control. With a normal API call, your server decides when to ask for data and can retry on its own terms. With a webhook, a third party decides when to send it, how many times, and in what order — and your endpoint has to cope with whatever arrives.

Most webhook providers (Stripe, GitHub, Shopify, Twilio, and nearly everyone else) use at-least-once delivery. That’s a deliberate design choice: it’s safer for the sender to occasionally deliver the same event twice than to risk losing one. The consequence is that duplicate deliveries are not an edge case — they are guaranteed to happen, usually because of network timeouts, deployment restarts, or a slow response on your end that the sender interprets as a failure. If your handler isn’t built to cope with that, “webhook reliability” isn’t optional polish; it’s the difference between accurate data and silent corruption.

The core principles of webhook reliability

1. Verify the signature before you trust anything

Webhook endpoints are public URLs. Anyone who finds one can send a fake payload unless you verify it. Reputable providers sign each request with a secret key; your handler should recompute that signature and reject anything that doesn’t match, before touching the payload. This is a five-minute job that prevents a genuinely serious class of vulnerability, so treat it as non-negotiable rather than a nice-to-have.

2. Acknowledge fast, process later

The single biggest mistake we see is a webhook handler that does everything inline: verify, parse, update the database, call another API, send a confirmation email, all before returning a response. Any one of those steps being slow causes a timeout, which the sender reads as failure and retries — multiplying the problem. The fix is to record the event durably and return a 2xx response immediately, then do the actual work asynchronously in a background worker or queue. This single change resolves the majority of “flaky” webhook integrations we’re asked to debug.

3. Make every event idempotent

Because duplicates are guaranteed, your processing logic must be safe to run twice on the same event without side effects. The standard approach: every event carries a unique ID (most providers include one). Store processed IDs — in Postgres for durability, or Redis with a TTL for speed — and check before processing. Set that TTL to comfortably outlast the provider’s retry window, or a late retry will slip past your deduplication and reprocess.

4. Handle retries and backoff deliberately

If you’re the one sending webhooks to your customers’ systems, the same discipline applies in reverse. Use exponential backoff with jitter — increasing delays between attempts, with some randomness added so a burst of failures doesn’t retry in lockstep and hammer a recovering endpoint. Cap the total retry window (72 hours is a common ceiling) rather than retrying indefinitely, and after a handful of consecutive failures, disable the subscription and notify the customer instead of quietly burning resources against a dead endpoint.

5. Validate the payload schema, then keep an audit trail

Reject malformed payloads early rather than letting bad data propagate into your database. And keep a log of every event received or sent — timestamp, type, status, and response — including the ones that ultimately failed. When a customer says “we never got that notification”, you need to be able to answer definitively, not guess.

Where webhooks fit in your wider architecture

None of this works well if webhook handling is bolted onto a request-response web server with no queueing layer underneath it. A dependable setup usually looks like: endpoint receives and verifies the request, writes the raw event to storage, pushes a message onto a queue, and returns 2xx — with a separate worker pulling from that queue to do the real processing, complete with retries and a dead-letter queue for events that fail repeatedly. This is the same pattern behind reliable payment integrations, where a missed or duplicated webhook can mean a customer is charged but never provisioned, or provisioned twice. If you’re already thinking about the cost and scope of connecting to an external provider, it’s worth reading how we approach third-party API integration cost more broadly — webhook handling is usually the part that’s underestimated.

You also need visibility into the system once it’s live. Queue depth, processing latency, and dead-letter queue volume are exactly the kind of signals we cover in our guide to observability for startups — without them, a webhook integration that’s silently failing can go unnoticed for weeks, because from the outside nothing looks “down”.

Common failure modes worth designing around

  • Out-of-order delivery. Events can arrive in a different order than they were sent. If your logic assumes strict ordering (e.g. “subscription created” before “subscription updated”), build in a check for that rather than trusting arrival order.
  • Deployment windows. If your endpoint is unreachable during a deploy, events sent in that window need to be retried by the sender and correctly processed afterwards — don’t assume a clean start.
  • Traffic spikes. A provider replaying a backlog of events, or a marketing campaign driving a surge of orders, can hit your endpoint far harder than normal. Queue-based processing absorbs this; a synchronous handler doesn’t.
  • Silent schema drift. Providers occasionally add or rename fields. Validate defensively and alert on unexpected shapes rather than letting a handler throw an unhandled exception on every event.

When to build this properly vs when to keep it simple

Not every webhook integration needs a full queueing infrastructure on day one. If you’re processing a handful of low-stakes events a day, a simple, idempotent, fast-acknowledging endpoint may be entirely adequate. The investment in queues, dead-letter handling, and dashboards is worth making once webhooks touch money, provisioning, or anything a customer will notice going wrong — payments, account state, inventory. The cost of getting it wrong isn’t a crashed server; it’s a customer who was silently double-charged or never got access to what they paid for, discovered days later in a support ticket.

If you’re scoping a new integration or trying to work out why an existing one keeps producing inconsistent data, that’s exactly the kind of problem worth a proper look before it compounds. Book a free consultation and we’ll help you work out what’s actually needed for your situation.

FAQ

Do I need a message queue for a simple webhook integration?
Not always. If volume is low and the events aren’t business-critical, a fast, idempotent endpoint without a queue can be fine. Once webhooks affect payments, provisioning, or customer-visible state, a queue with retries and a dead-letter queue becomes worth the investment.

How do I stop the same webhook event being processed twice?
Store the unique event ID each provider includes in the payload, check it against previously processed IDs before doing any work, and set your storage TTL longer than the provider’s retry window so late retries don’t slip through.

What should my webhook endpoint return, and how fast?
Return a 2xx response as soon as you’ve durably recorded the event — ideally within a few seconds. Do the actual processing (calling other APIs, updating records, sending emails) afterwards in a background worker, not inline in the request.

What happens if a webhook endpoint keeps failing?
Most reliable systems retry with exponential backoff and jitter for a bounded period (commonly up to 72 hours), then stop and flag the subscription rather than retrying indefinitely against a dead endpoint.

Related: Background Job Queues: When Startups Actually Need One — if flaky webhook deliveries are the symptom, a background job queue is often the fix that makes retries and processing reliable.

Related: Transactional Email Deliverability: A Founder’s Guide — the same reliability discipline you’d apply to webhooks matters just as much for the password resets and receipts your app sends by email.

Related: API Rate Limiting Best Practices for SaaS Founders — a useful companion once your webhooks are reliable, covering how to protect that same API surface from abuse and overload.

Related: WebSockets vs Server-Sent Events vs Polling: A Founder’s Guide — useful if you’re weighing webhooks against a persistent connection for delivering real-time updates to your users.

#api integration #backend architecture #reliability #saas #webhooks
Keep reading

More insights.

Serverless vs Containers vs VPS: A Founder’s Guide
Engineering

Serverless vs Containers vs VPS: A Founder’s Guide

A plain-English guide to choosing between serverless, containers and a VPS, built around traffic patterns, team size and cost, not hype.

9 min read
i18n for Web Apps: A Founder’s Guide to Going Global
Engineering

i18n for Web Apps: A Founder’s Guide to Going Global

What internationalisation actually involves, why it's cheaper to build in from day one, and how to roll it out market by market without a rebuild.

7 min read
File Upload Architecture: A Founder’s Guide to Scaling Uploads
Engineering

File Upload Architecture: A Founder’s Guide to Scaling Uploads

A practical breakdown of how to architect file uploads that scale safely, from presigned URLs and multipart uploads to security, processing and cost.

8 min read

Have a project in mind?

Let's talk about what you're building.

Chat on WhatsAppBook a 30-min call

A senior engineer replies personally — usually within the hour.

Chat on WhatsAppBook a call