Integration · Webhooks

Webhook Fanout Patterns — A Field Guide

One inbound webhook often needs to trigger several independent actions. Fanout is how you distribute that event without coupling the actions to each other or to the sender.

John Kihiu12 min read

A single event — an order was paid — frequently needs to do several unrelated things: update the ledger, email the customer, notify the warehouse, refresh analytics. Cramming all of that into the webhook handler makes it slow, fragile, and impossible to retry one part without redoing the rest. Fanout separates the one inbound event from the many things it triggers.

Ingest fast, process separately

The first move is to make the webhook endpoint do almost nothing: verify the signature, persist the raw event, publish it to an internal queue or pub/sub topic, and return 2xx. All the real work happens downstream, decoupled from the sender's timeout. The endpoint's only job is to durably accept the event and get out of the way.

One event, many consumers

With the event on a topic, each action becomes an independent subscriber. Pub/sub delivers a copy to every subscriber; each processes at its own pace and retries on its own without affecting the others.

Text · fanout topology
  inbound webhook
        │  (verify, persist, publish, 2xx)
        ▼
   [ order.paid topic ]
        ├──▶ ledger consumer      (own retries, own DLQ)
        ├──▶ email consumer
        ├──▶ warehouse consumer
        └──▶ analytics consumer

The win is isolation. If the email service is down, its consumer retries while the ledger and warehouse consumers carry on. In a single monolithic handler, that same email outage would fail the whole event and force a full re-process.

Keep consumers independent

The queue is your buffer against spikes

Fanout through a durable queue also absorbs bursts. A flood of inbound events fills the topic and consumers drain it at a sustainable rate, instead of a traffic spike knocking over every downstream system at once. The buffer is half the reason to fan out.

Fanout turns a brittle, do-everything webhook handler into a fast ingest endpoint plus a set of small, independent, individually retryable consumers. Each action can fail, retry, and scale on its own — and the sender only ever sees a quick acknowledgement.

John Kihiu
Acumatica ERP Developer · Laravel Engineer

Independent software engineer in Nairobi specialising in Acumatica customisations, Laravel backends, and tax fiscalisation integrations across East and Southern Africa.