Skip to content
- Developer calls Gateway API with Bearer key.
- Gateway authenticates, validates payload, writes notification row, and enqueues message.
- Delivery Worker consumes queue entries.
- Delivery Worker resolves
tg_chat_id and asks DO rate limiter to send to Telegram.
- Delivery results are written back to D1.
- Global pacing enforced in Durable Object.
- Per-chat cooldown enforced at 1 second.
- Queue retries handle transient failures (
429, 5xx, network errors).
users: tenant/user chat mapping + phone verification status.
api_keys: auth and key lifecycle metadata.
notifications: delivery status surface for /v1/status/:tracking_id.
notification_attempts: granular attempt logs.
- KV token stores: short-lived onboarding session state.