Architecture — C4 Diagrams

← Claims Overview  |  Event Flow →


L1 — System Context

Where does PolicyOne sit in the platform, and how does it connect to ClaimsOne?

Rendering diagram…

L2 — Container View

Which PolicyOne containers participate in the claims integration?

Rendering diagram…

Database: policy.agent_tasks

The policy.agent_tasks table is the integration output. Each large-loss claim settlement creates one row.

-- Relevant columns written by ClaimsEventsConsumer
INSERT INTO policy.agent_tasks (
    tenant_id,          -- from event.tenantId
    task_kind,          -- 'large_loss_review'
    entity_type,        -- 'policy'
    entity_id,          -- policy.id (looked up by policyNumber)
    agent_kind,         -- 'deterministic'
    status,             -- 'pending' (default)
    trigger_event,      -- 'claim.settled'
    trigger_source,     -- 'claims_one'
    human_review_required, -- true
    human_review_note,  -- 'Large loss settlement: CLM-2026-001234, amount: $15,000.00'
    inputs              -- { claimId, claimNumber, policyNumber, settlementAmountCents,
                        --   deductibleCents, isLargeLoss, settlementDate }
)

Component Responsibilities

ComponentRole
ClaimsEventsConsumerReads stream, parses ClaimSettledEvent, routes to handler, XACKs
PostgreSQL (policy schema)Stores agent_tasks and policies — no cross-DB dependency
PolicyOne AppRenders agent_tasks in the UW review queue UI
RedisStateless transport — the consumer manages its own offset via the consumer group

Deployment

ClaimsEventsConsumer runs inside the same Next.js process as the PolicyOne app, started via instrumentation.ts. No separate container or service is required.

┌─────────────────────────────────────────┐
│  PolicyOne Docker Container             │
│                                         │
│  ┌───────────────────────────────────┐  │
│  │  Next.js 15 (Node.js runtime)     │  │
│  │                                   │  │
│  │  ┌────────────────────────────┐   │  │
│  │  │ ClaimsEventsConsumer       │   │  │
│  │  │ (instrumentation.ts)       │   │  │
│  │  └────────────────────────────┘   │  │
│  │  ┌────────────────────────────┐   │  │
│  │  │ OutboxPublisher            │   │  │
│  │  │ (instrumentation.ts)       │   │  │
│  │  └────────────────────────────┘   │  │
│  └───────────────────────────────────┘  │
└─────────────────────────────────────────┘

← Previous: Claims Overview  |  Next → Event Flow