---
id: WF-PFM-NOT-012
title: Pace association sending across lanes
trigger: Minute quota observation or message sending needs lane capacity.
product_area: platform
module: notifications
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
- CAP-PFM-NOT-018
moves:
- STATE-PFM-NOT-015
crosses:
- SVC-PFM-NOT-communications
hops:
- n: 1
  actor_or_service: Quota guard
  action: Fetch current account sending capacity and daily usage from SES.
  anchor: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
  seam: schedule
  on_failure: Retry on a later minute run while retaining prior rates.
  left_inconsistent: Capacity information can remain stale until a successful read.
  observer: Quota-guard function errors.
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
- n: 2
  actor_or_service: Quota guard
  action: Store the forty-percent transactional reservation with borrowing and sixty-percent Marketing
    share without borrowing; apply the ninety-percent daily brake.
  anchor: services-platform:modules/communications/services/persistence/lane-budgets.ts
  seam: schedule
  on_failure: Retry the quota update on a later minute run.
  left_inconsistent: Stored pause and queue consumption may disagree until reconciliation succeeds.
  observer: Marketing pause metric and alarm.
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/quota-guard.ts:runQuotaGuard
- n: 3
  actor_or_service: Quota guard
  action: Reapply the stored Marketing pause to its queue event-source mapping every run.
  anchor: services-platform:modules/communications/aws/resources/communications-lanes.iam.ts
  seam: schedule
  on_failure: Retry mapping configuration on a later minute run.
  left_inconsistent: Marketing consumption can continue or remain stopped contrary to stored pause.
  observer: Pause monitoring.
  provenance: documented
  source: services-platform:docs/communications/architecture.md#21.3 The 24-hour quota brake
- n: 4
  actor_or_service: Send consumer
  action: Allocate tokens with both lane rows locked; wait within the invocation when practical, otherwise
    defer the request.
  anchor: services-platform:modules/communications/services/dispatch/lane-bucket.ts:takeFromLanes
  seam: sync
  on_failure: Requeue capacity-held work without using its receive budget.
  left_inconsistent: Remaining messages stay draft until capacity is available.
  observer: Lane-capacity metric.
  provenance: observed
  source: services-platform:modules/communications/services/dispatch/lane-budget.ts
idempotency: Repeated quota observation reapplies the stored mapping state; token allocation consumes
  capacity transactionally.
concurrency: Both lane rows are locked for allocation, coordinating transactional borrowing with Marketing
  use.
branches:
- Transactional sending never takes the Marketing daily pause.
waits:
- Capacity waits fit within the invocation budget or become delayed request work.
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.'
controls: [TC-AVL-001, TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-PRV-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---
# Pace association sending across lanes

## What It Does

Minute quota observation or message sending needs lane capacity.

## The Flow

```mermaid
flowchart TD
    h0["Fetch current account sending capacity and daily usage from SES"]
    h1["Store the forty-percent transactional reservation with borrowing and sixty-percent Marketing share without borrowin"]
    h0 --> h1
    h2["Reapply the stored Marketing pause to its queue event-source mapping every run"]
    h1 --> h2
    h3["Allocate tokens with both lane rows locked"]
    h2 --> h3
```

## When Something Fails

The hop rows identify each retry boundary, any state left behind and the available observer. Repeated quota observation reapplies the stored mapping state; token allocation consumes capacity transactionally. Both lane rows are locked for allocation, coordinating transactional borrowing with Marketing use.

## Open Design Questions

Transactional sending never takes the Marketing daily pause. Capacity waits fit within the invocation budget or become delayed request work.
