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_tasksrecord is created for the underwriting team to review - No UW action is missed, even if PolicyOne was restarted during the settlement
What PolicyOne Does
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
| Property | Value |
|---|---|
| Stream | events:claims |
| Consumer Group | policy-center |
| Block timeout | 5000ms (5 seconds) |
| Batch size | 10 messages per read |
| Max retries | 3 |
| DLQ stream | events:dlq |
| Worker file | apps/policyone/lib/workers/claims-events-consumer.ts |
| Started by | apps/policyone/instrumentation.ts |
Stream Map
| Stream | Direction | Events consumed |
|---|---|---|
events:claims | Inbound (ClaimsOne publishes) | claim.settled |
events:policy | Outbound (PolicyOne publishes) | policy.issued, policy.endorsed, policy.cancelled, policy.renewed |
events:dlq | Inbound (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_tasksinsert is idempotent only if your consumer deduplicates onevent.id. Consider adding a unique index ontrigger_event_idif 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