WhatsApp flow

Live view of the 14-component message spine. Every webhook traced end-to-end.

THROUGHPUT · 24H
482

webhooks received

AVG PDF LATENCY
6.04s

across 2 traces

PIPELINE HEALTH
13/14

93% healthy stages

BLOCKED · TODAY
3

off-topic / injection / rate-limit

Pipeline spine

14 components · Postgres-only state · concurrency via SELECT … FOR UPDATE

HealthyDegradedDown
  1. 1
    Webhook receiver

    raw-body + Meta signature verification

    Healthylast 4ms482 / 24h
  2. 2
    Tenant router

    phone E.164 → tenant_id + idempotency dedupe

    Healthylast 12ms482 / 24h
  3. 3
    3-tier message router

    active flow → keyword → Haiku 4 classifier → Sonnet 4.5

    Healthylast 38ms478 / 24h
  4. 4
    FSM stack engine

    JSONB stack (depth=3, auto-cancel-on-overflow)

    Healthylast 6ms478 / 24h
  5. 5
    Input pipelines

    voice/photo/text · auto-retry-once · text fallback

    Healthylast 1820ms247 / 24h
  6. 6
    DPDPA consent gate

    Option D — fires before first voice/photo

    Healthylast 8ms12 / 24h
  7. 7
    7-layer prompt-injection defense

    regex → template → claude → post-validate → send → rate → tnc

    Degradedlast 22ms478 / 24h
  8. 8
    Claude extraction (Sonnet 4.5)

    Tools API + Zod schema · prompt-cached system prompt

    Healthylast 2840ms218 / 24h
  9. 9
    Correction loop

    default cap 10 · configurable per-tenant

    Healthylast 12ms41 / 24h
  10. 10
    Quotation revision system

    4 lookup methods · parent_quote_id chain

    Healthylast 14ms73 / 24h
  11. 11
    PDF pipeline (Puppeteer)

    Handlebars + p-queue (concurrency=2) · pre-warmed browser

    Healthylast 1640ms187 / 24h
  12. 12
    R2 storage layer

    logos/PDFs permanent · voice/photos 30-day lifecycle

    Healthylast 320ms421 / 24h
  13. 13
    WhatsApp SEND middleware

    idempotency · signature · opt-out · 24h window · block-rate · template lookup

    Healthylast 184ms396 / 24h
  14. 14
    Background jobs (node-cron)

    7 jobs + scheduled_job_runs idempotency

    Healthylast 8ms49 / 24h
Recent traces
Last 6 webhooks · click a row to expand path
Live

How a message flows

Five canonical paths through the spine.

Voice quote → PDF sent
PDF sent

Active flow advances → Whisper transcribes → Sonnet extracts → Puppeteer renders → R2 stores → SEND delivers.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 8
  7. 11
  8. 12
  9. 13
Keyword match → templated reply
Confirm pending

Tier-2 keyword rule fires (e.g. STATUS, HELP). No LLM call. Direct response via SEND.

  1. 1
  2. 2
  3. 3
  4. 13
Haiku classifier → off-topic blocked
Off-topic blocked

Tier-3a Haiku 4 classifies as off_topic. Strike counter incremented (OPS-05). No Sonnet call.

  1. 1
  2. 2
  3. 3
  4. 13
Layer 7 → injection blocked
Injection blocked

Regex / template / post-validate guard fires before Claude. Logged to security_events. Tenant warned.

  1. 1
  2. 2
  3. 7
  4. 13
Rate limit → dropped
Rate limited

Per-tenant block-rate or per-customer flood guard trips. No SEND call. May auto-suspend at 4%.

  1. 1
  2. 2
  3. 7