Claims Integration — Overview

PolicyOne subscribes to ClaimsOne's events:claims Redis Stream to receive real-time notification when claims are settled. This drives automated underwriting reactions without any polling or API coupling between the services.

← Integration Guide  |  Architecture →


Why This Integration Exists

When a high-value claim is settled, the underwriting team needs to know — quickly. A $150,000 settlement on a $200,000 policy triggers very different renewal decisions than a $5,000 windshield claim. Without the event bus, underwriters would have to manually check ClaimsOne, cross-reference claim data, and update PolicyOne — a slow, error-prone process.

With the event bus:

  • Settlement in ClaimsOne → PolicyOne reacts within 2 seconds (default poll)
  • A durable policy.agent_tasks record is created for the underwriting team to review
  • No UW action is missed, even if PolicyOne was restarted during the settlement

What PolicyOne Does

Rendering diagram…

Only isLargeLoss = true events trigger an agent task. Small claims are acknowledged and discarded. The LARGE_LOSS_THRESHOLD is configured in ClaimsOne (default $100,000).


Consumer Group Details

PropertyValue
Streamevents:claims
Consumer Grouppolicy-center
Block timeout5000ms (5 seconds)
Batch size10 messages per read
Max retries3
DLQ streamevents:dlq
Worker fileapps/policyone/lib/workers/claims-events-consumer.ts
Started byapps/policyone/instrumentation.ts

Stream Map

StreamDirectionEvents consumed
events:claimsInbound (ClaimsOne publishes)claim.settled
events:policyOutbound (PolicyOne publishes)policy.issued, policy.endorsed, policy.cancelled, policy.renewed
events:dlqInbound (failed messages)Any event that failed MAX_RETRIES

Key Facts

  • PolicyOne never writes to ClaimsOne's database. It only reads from the shared Redis stream.
  • The policy.agent_tasks insert is idempotent only if your consumer deduplicates on event.id. Consider adding a unique index on trigger_event_id if needed.
  • If ClaimsOne's Redis publish is delayed (outbox lag), PolicyOne's reaction is delayed by the same amount. Use the ClaimsOne Operations guide to monitor outbox lag.

← Previous: Integration Guide  |  Next → Architecture