micro-flow — webhook inbox demo

A fictional payment provider, Paystream, sends signed webhooks to the server. The receiver checks the signature, drops duplicates and acks right away. Two worker workflows then drain the queue, and each event runs in its own workflow. Everyone shares one inbox.

How to use this demo

A webhook is an HTTP request a service sends you when something happens, such as a payment failing. You don't control the sender, so the receiver must check that each request is genuine, expect the same event more than once, and answer fast. Slow work goes to a background queue.

  1. ConsolePaystream signs an event
  2. Receiverchecks signature & time, drops repeats, replies 202
  3. Queueup to 30 waiting events
  4. Workers2 workflows take events one at a time
  5. Handlerspicked by event type, retried on failure

Try these, in order

  1. Happy path. Press order.created. In Deliveries it goes queued → processing → done, and its three handler chips turn green one by one.
  2. Duplicates. Press Duplicate last. The receiver answers 200 and marks it duplicate, but nothing runs again. Real providers retry deliveries, so a receiver has to remember event ids.
  3. Forged or replayed requests. Press Tampered (body changed after signing) and Stale (signed 10 minutes ago). Both get 401 rejected and never reach the queue.
  4. Load. Press Burst ×8. Watch the queue fill up in Workers and both lanes work through it at the same time.
  5. Retries and the dead letter queue. Tick CRM outage, then press customer.updated. sync-crm is tried 3 times (the chip shows ×3), then the event lands in Dead letter. Untick the outage and press Redeliver: the same workflow runs again and finishes.
  6. Partial failures. Tick Flaky email and send a few order.created or payment.failed events. Email handlers often succeed on a retry. If one still ends up in the dead letter queue, redeliver it: handlers that already succeeded show as skipped, so stock isn't reserved twice.
  7. Unknown events. Press invoice.finalized. No handler is registered for it, so the switch's default case just logs it (log-unhandled).

Reading the deliveries log

Paystream console POST /api/webhooks/simulate

Send an event to see the receiver's response.

Send your own with curl

The receiver is a real endpoint. Sign <timestamp>.<body> with HMAC-SHA256 and the demo secret whsec_demo_microflow, and send it in the paystream-signature header as t=<timestamp>,v1=<hex>.


      
    

Workers 2 workflows, each a while loop over the queue

Queue 0/30

    Dead letter failed after retries

    1. Nothing here. Turn on CRM outage and send customer.updated.

    Deliveries GET /api/webhooks/state

    1. No deliveries yet.

    GET /api/webhooks/state

    Workflow Status browser

    —
    Step —
    Callable —
    Events sent from this tab: 0