Event Flow

Detailed sequence diagrams for every scenario: happy path, pre-bind payment plan selection, failure/retry, and DLQ.

← Architecture  |  Payload Reference →


1. Pre-Bind: Agent Selects a Payment Plan

Before the agent can bind, they must visit the Payment Plan wizard step. This makes two synchronous HTTP calls to BillingOne to load available plans and preview the installment schedule.

Rendering diagram…

2. Bind: Happy Path (policy.bound → BillingOne creates account)

After the agent confirms billing and clicks Bind Quote on the Review step.

Rendering diagram…

3. Retry Path — Transient Redis Failure

If XADD fails (Redis unreachable), the row stays processing. On next startup, OutboxPublisher.resetStalledRows() resets it to pending.

Rendering diagram…

4. Retry Path — BillingOne Consumer Failure

If BillingOne's PolicyEventsConsumer crashes mid-processing, Redis retains the message as unacknowledged. On restart, the consumer reclaims it via XAUTOCLAIM.

Rendering diagram…

5. DLQ — Permanently Failed Messages

After STREAM_MAX_RETRIES (default 3) attempts, messages are forwarded to events:dlq.

Rendering diagram…

6. Policy Issued — Payment Schedule Activation

After underwriting approval, issuePolicyRecord() emits policy.issued. BillingOne activates the payment schedule and sends the first invoice.

Rendering diagram…