Open-source webhook reliability

Webhooks that arrive. Exactly one effect.

Relay accepts signed events, stores them durably, delivers them asynchronously and retries transient failures with backoff. Duplicates and crashes never turn into duplicate business effects.

  • NestJS
  • PostgreSQL
  • Redis
  • BullMQ
# signed request
x-relay-event-id: evt_123
x-relay-signature: 9f2c…b41e

# first delivery
{ "accepted": true, "duplicate": false }

# the provider retries the same event
{ "accepted": true, "duplicate": true }
  1. Attempt 1ECONNREFUSED
  2. Attempt 2HTTP 503
  3. Attempt 3Delivered
Events sent
5
Requests, with duplicates
10
Delivery attempts
15
Business effects applied
5

Measured with the reproducible demo scenario: the receiver is down, every request is duplicated, then the receiver recovers.

How it works

From signed request to confirmed delivery

Relay never blocks the incoming request on your downstream service, and never loses an event it has acknowledged.

  1. 01

    Verify

    HMAC-SHA256 over the raw body, compared in constant time. Invalid ids and signatures are rejected before storage.

  2. 02

    Persist

    The event is written to PostgreSQL with a unique id per source. Replays are recognised, not duplicated.

  3. 03

    Deliver

    BullMQ delivers a signed request. Failures retry on a separate queue with exponential backoff and jitter.

  4. 04

    Recover

    Exhausted events land in a dead-letter queue you can inspect and retry manually.

Guarantees

Designed around failure, not around the happy path

Exactly-once delivery is impossible across a database, a queue and an HTTP service. Relay provides at-least-once delivery and makes repetition safe.

Transactional outbox

A sweeper re-enqueues events lost to a crash or a Redis outage, using row claims with a lease so several instances never collide.

Idempotent ingestion

Event ids are scoped per source. Duplicate requests are acknowledged and re-enqueued only if not yet delivered.

Isolated retries

A dedicated delayed queue means a failing receiver never slows the delivery of new events.

Signed and bounded

Outbound requests are signed, time-limited and never follow redirects, so a receiver cannot stall a worker.

Full attempt history

Status, HTTP code, error cause and duration for every attempt, plus Prometheus metrics on /metrics.

Secure by default

Production refuses to start without strong secrets, and operator routes require an admin bearer token.

Quick start

Running locally in three commands

You need Node.js 24.9 or later and Docker. The PostgreSQL schema is created automatically at startup.

Read the full documentation
Start the stack
npm ci
docker compose up -d
npm run start:dev
Send a signed event
BODY='{"event":"payment.created","amount":4200}'
SIGNATURE=$(printf '%s' "$BODY" |
  openssl dgst -sha256 -hmac dev-secret -hex |
  sed 's/^.* //')

curl -i http://localhost:3000/webhooks/stripe \
  -H 'content-type: application/json' \
  -H 'x-relay-event-id: evt_123' \
  -H "x-relay-signature: $SIGNATURE" \
  --data "$BODY"

Honest by design

What Relay is not

Relay is a single-tenant webhook relay, not a full webhook platform. Knowing the limits is part of using it well.

  • One destination and one secret for all events.
  • No multi-tenancy; operators share a single admin token.
  • At-least-once delivery: receivers should deduplicate on x-relay-event-id.
  • Not load tested; throughput limits are unknown.

See it recover from failure

Open the live console, or run the reliability demo on your machine.

The demo runs on Render's free tier; the first request after a period of inactivity can take a moment.