---
id: STATE-PFM-NOT-015
title: Marketing sending lane
object: DOM-PFM-NOT-005
product_area: platform
module: notifications
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
states:
- name: unlimited
  meaning: No quota observation has established a rate limit yet.
- name: running
  meaning: Marketing uses its sixty-percent rate share without borrowing.
- name: paused
  meaning: Daily usage reached the brake threshold and Marketing consumption is stopped.
transitions:
- from: unlimited
  to: running
  trigger: The quota guard obtains its first rate observation.
  guard: Daily usage is below the pause threshold.
  side_effects:
  - Store the rate allocation for both lanes.
  who: Quota guard (every minute)
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
- from: running
  to: paused
  trigger: Daily usage reaches ninety percent of the account quota.
  guard: No additional condition is imposed beyond the threshold.
  side_effects:
  - Disable Marketing queue consumption.
  - Emit the pause metric for its alarm.
  who: Quota guard
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
- from: paused
  to: running
  trigger: Daily usage drops below the pause threshold.
  guard: No additional condition is imposed beyond the threshold.
  side_effects:
  - Enable Marketing queue consumption again.
  who: Quota guard
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
- from: unlimited
  to: paused
  trigger: The first quota observation already exceeds the daily threshold.
  guard: No additional condition is imposed beyond the threshold.
  side_effects:
  - Disable Marketing queue consumption.
  - Emit the pause metric for its alarm.
  who: Quota guard
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
invalid:
- from: running
  to: paused
  why: The transactional lane is excluded from the Marketing pause.
concurrency: Every quota run reapplies the stored pause to the queue mapping, repairing disagreement on
  a subsequent successful minute run. Token allocation locks both lane records within one transaction.
evidence:
- 'services-platform at ad3f6a65: modules/communications/services/dispatch/{quota-guard,lane-budget,lane-bucket,lanes}.ts;
  db/communication-lane-budgets.table.ts; docs/communications/architecture.md §21.'
---
# Marketing sending lane

## The Lifecycle

```mermaid
stateDiagram-v2
    state "unlimited" as s0
    state "running" as s1
    state "paused" as s2
    s0 --> s1
    s1 --> s2
    s2 --> s1
    s0 --> s2
```

## Transitions Explained

The transition rows describe stored state changes, their checks and their recorded effects. A queue receive, provider outcome and staff action can reach different lifecycle boundaries.

## What Cannot Happen

The transactional lane is excluded from the Marketing pause.

## Concurrency and Timing

Every quota run reapplies the stored pause to the queue mapping, repairing disagreement on a subsequent successful minute run. Token allocation locks both lane records within one transaction.
