Mike asked: intake unification — emails + chat go through the same path so I only have one place to look. This shows how every inbound signal (5 email mailboxes, chat, admin pages, cron, webhook, direct API) flows through the event ledger and subscription engine into the workflow runner and the HITL gate. The bottom lane is the fan-out: NS push queue, D1 writes, KV invalidations, notifications, Vectorize writes, event re-fire.
| Source | Surface | Authn proof | Default priority |
|---|---|---|---|
| bids@ai-globalfoodsolutions.co | sender-domain + optional DKIM | high | |
| pricing@ai-globalfoodsolutions.co | sender-domain | high | |
| customer@ai-globalfoodsolutions.co | sender-domain | normal | |
| vendor@ai-globalfoodsolutions.co | sender-domain | normal | |
| pricerequest@ai-globalfoodsolutions.co | email (alias for pricing@) | sender-domain | high |
| chat.html | chat UI | X-Role-Id | inline |
| ops.html, proposed-actions.html, cost-ingestion.html, ... | admin pages | X-Edit-Token | inline |
| 22 cron schedules | scheduled handler | none (CF-internal) | background |
| /api/ns-webhook | NS SystemNote CDC | HMAC verify | reactive |
| /api/workflow/execute, /api/tools/invoke | direct API | CF Access JWT + X-Edit-Token | inline |
Every surface, regardless of authn proof, lands a row in the events table (R553) as the first persistent write. The events row carries event_type (e.g. email.parsed, chat.tool_invoked, cron.tick, ns.systemnote) + a JSON payload + idempotency_key. The subscription engine reads forward from its cursor, matches event_type + filter against event_subscriptions, and dispatches the bound contract through executeWorkflowContract. This is the substrate guarantee: one place to instrument, one place to gate.
| Color | Meaning |
|---|---|
| frontend | User-facing surface (chat UI, admin HTML pages) |
| backend | Worker logic / agent code / business rules |
| database | D1 table / R2 object / KV key / Vectorize index |
| cloud | External system (NetSuite, Anthropic, etc.) |
| security | Gate / policy / HITL approval / kill switch |
| messagebus | Event ledger, Queues, async fan-out |
| external | Inbound source (email, webhook, cron tick, user input) |
| → solid | Synchronous call (request → response) |
| → green | Approved / happy-path |
| → red dashed | Policy or security check |
| → grey dashed | Optional / conditional / async |