Appearance
Claims triage
First-notice triage of a claim: the policyholder answers a claim form with evidence, four rules check the policy, the amount and how often they claim, and anything unusual goes to an adjuster. Pack: examples/policies/claims-triage/.
A pattern for expressing a insurance policy, not compliance guidance: the thresholds, lists and fields are placeholders chosen to make the example run; a real policy comes from the business's own rules. It calls no app, so it runs in an empty workspace as it is.
The decision it automates
Whether to fast-track the claim, refer it to an adjuster, or decline it, when the claim form is submitted.
Data expected
- The policyholder as a subject with
policyStatusandpolicyAgeDays, which your claims system keeps current before it starts the run. - The claim form's answers under
submission:claimType,incidentDate,amount,description, apoliceReferencefor thefts, and optional photos and invoice. - A
claim.filedevent for every claim, posted throughPOST /events, so the frequency rule sees the history.
Steps and rules
| Step | Type | Why |
|---|---|---|
collect | wait_for_collection | The claim-form flow; thefts add a police-reference step. |
rules | evaluate_rules | The claims-triage rule set under max_severity. |
route | branch | rules.outcome == manual_review opens a case. |
review | create_case | claims_adjuster, 72-hour SLA. |
decide | emit_decision | From the rules, or the reviewer's decision. |
The rule set claims-triage (useCase: custom) uses max_severity: a failed block rule rejects, a failed warn rule sends the run to review, and the weights add up to the score.
| Rule | Type | Severity, weight | Fails when |
|---|---|---|---|
claim_policy_active | comparison | block, 100 | subject.policyStatus is not active |
claim_early | comparison | warn, 30 | subject.policyAgeDays is under 60 |
claim_amount | score threshold | warn, 30 | amount is above 5 000 |
claim_frequency | velocity | warn, 40 | more than two claim.filed events in 90 days |
What a reviewer sees
A claims_adjuster case with the form, the photos and invoice when attached, and the rule results. case.sla.breached reaches your systems if the SLA slips.
How to adapt it
Add a call_app step for your policy administration system (an app you build) to confirm cover instead of trusting the subject's fields, a document check on the invoice, and payee screening with mock-sanctions while you wire up a real vendor (Seller and payout screening shows the pattern).
Run it
bash
pnpm policy:import examples/policies/claims-triage --publishThe fixture files a 1 800 damage claim 21 days into the policy: the early-claim rule fails, a claims_adjuster case opens, the check approves it and the run completes with a manual approve.