System design
Agentic workflow with human approval
Design an agent that processes insurance claims end to end, with a human approving high-value decisions.
45:00
45 minutes in five phases. Talk out loud the whole time.
Ask first
Which actions are irreversible?
How long can approvals take?
What are the audit and regulatory requirements?
How many claims a day?
Core design
Durable orchestration: LangGraph with a persistent checkpointer, Temporal or Step Functions.
Agent steps use tools through MCP: policy lookup, document checks and fraud signals.
A risk score for each proposed action.
An interrupt for approval that shows the evidence, then resume on approve, edit or reject.
An immutable audit log: inputs, model version, tool calls and approver.
Timeouts and escalation when approvals stall.
Trade-offs to raise
Autonomy versus approval fatigue.
State persisted for days versus simplicity.
Agent flexibility versus a fixed workflow for regulated steps.
Curveballs
State is persisted. Send reminders, escalate after a timeout, and never auto-approve.
Put idempotency keys on every tool that has side effects.
Replay it from the audit log: the evidence, model version, reasoning summary and approver.
Numbers to state
Claims per day × share needing approval ÷ approver capacity.