Core Types
CaseEvidenceSource
Source text used for validation and citation. Carries a
sourceId, raw text, and optional metadata like page number or document type.CaseCitation
A citation with a
sourceId, exact quote, optional page number, and optional fieldPath. Used to ground claims in case items back to real source text.CaseValidationIssue
An
info, warning, or blocking issue tied to an itemId and fieldPath. Blocking issues must be resolved before a submission packet is considered ready.MissingInfoQuestion
A question tied to an
itemId and optional fieldPath. Surfaces required information that could not be inferred from the request or evidence sources.CasePacketArtifact
A generated artifact — email draft, underwriter summary, JSON packet, or validation report — associated with a submission packet.
CaseState
The durable workflow state object. Carries items, evidence sources, validation issues, missing-info questions, citations, and execution status.
Evidence Validation
UsevalidateQuotedEvidence() to check that a citation’s quote is genuinely present in the referenced source. Call this any time you accept a new citation — from a model, from a user, or from an external system.
string
required
The ID of the case item this citation belongs to.
string
Optional dot-separated field path the citation supports (e.g.
vehicle.vin).string
required
The text that should appear verbatim in the referenced source.
CaseCitation
required
The citation object to validate. Must include
sourceId and quote.CaseEvidenceSource[]
required
The evidence sources to check against. The validator looks for the
sourceId in this list and confirms the quote is present in the source text.validateQuotedEvidence() performs an exact substring match by default. Normalisation (whitespace collapsing, case folding) is applied before comparison so minor formatting differences don’t produce false negatives.Proposal Scoring
When your workflow generates multiple competing proposals for a case item — for example, different interpretations of an ambiguous request — useevaluateCaseProposals() to select the best one before committing.
Stable IDs
Case workflows often run as async jobs that may be retried or deduplicated. UsestableCaseId() to generate deterministic, hash-based identifiers so the same logical case always produces the same ID regardless of how many times it’s processed.
string
required
A short label prepended to the hash — e.g.
"case", "item", "packet". Helps you identify the ID type at a glance.string[]
required
Array of strings that uniquely identify the entity. The hash is computed from the concatenation of these values in order.
Building a Custom Workflow
These primitives compose naturally. Here’s a sketch of a claims intake workflow built from case primitives:PCE Overview
See how these primitives are assembled in the built-in Policy Change Endorsement agent.
Application Pipeline
Explore how case state patterns apply to the application processing pipeline.