Pulse

notification dispatch, from accept to delivery
api unreachable
Send

SMS, from the seeded template. The channel allows 20 per minute, so a burst of 25 overflows the bucket — the excess waits in rate limited until it refills.

Rate limiter

redis token bucket

waiting for metrics…

A worker that cannot take a token puts the job back with a 10s delay instead of blocking.

Transitions

diffed each poll
API0

POST /notifications

accepted in last 60s

validate → idempotency key → insert

Postgres0

notifications table

scheduled
0
pending
0
delivered
0
failed
0
Scheduler0

advisory lock · promotes due jobs

nothing scheduled

Queue0

depth 0 · visible 0

queue empty

Workers0

polling for visible jobs

no jobs claimed

Dispatch0

provider handlers

no sends in the last minute

fail 0% / 1m

Delivered0

terminal · providerMessageId stored

nothing delivered yet

Retry backoff0

invisible until the timeout expires → back to queue

no jobs waiting on backoff

Dead letter queue0

permanent 4xx, or maxAttempts exhausted

no dead letters