A broker's email arrives at nine in the morning. The client wants commercial property cover for a masonry warehouse built in 2012, sprinklered, roof eight years old, wind zone A. This is case UW-002, the straight path. By half past ten an underwriter has approved a recommendation that cites its evidence, and the run is complete.
Between the email and the approval, the quote workflow made about a dozen decisions about what runs next. Code made almost all of them. Three agents did work inside their steps. One person made the decision that counts. Every earlier page of this site explained one of those decisions in isolation. This page puts them back together on one case, then on all eighteen.
It is also the honest place to say what this is. The insurer, the broker, the cases, the rules, the fields, the roof-data provider, the timings and every number here are invented for teaching. This is an illustrative reconstruction, not a description of any real insurer or system, and nothing on this page reports the quality of a real model. The agents here are scripted stand-ins and time is simulated, so these results show how the orchestration works, not how good or how fast any model is.
1. The quote workflow, end to end#
The quote workflow is the name this site uses for the whole process from the broker's email to the underwriter's decision: the definition of the steps and the rules for what follows what. One execution of it, for one submission, is a run. Here is UW-002, the straight path, as the example prints it:
$ $PY run.py --case UW-002 --mode dag
Quote workflow · scripted stand-in agents (no model called) · simulated time · seed 7
UW-002 · Clean warehouse with a young roof · dag mode · run-1ef9 · trace e74ec7ad046e...
path: intake > gather_evidence > check_eligibility > draft_recommendation > verify_process > record_recommendation > await_underwriter > apply_decision
fan-in: roof_assessment ok [ok], guidance ok [ok], similar_decisions ok [ok]
guard: pass (Eligibility ran and every cited rule was retrieved.)
recommendation: approve · cites - · missing - · policy 2026.2 · stored row status stored
signal: underwriter approve -> apply
human_decision: {"decided_by": "underwriter", "decision": "approve", "override": false, "reason": "Clean submission; the recommendation and the evidence agree."}
status: completed · model calls 3 · tool calls 4 · simulated time 1.5 h (includes the wait for a person)
expected: as stated in the case
wrote 1 run file(s) in out/runs/ and out/summary.json
Each step on the path, with who does the work and who decides what comes next:
| # | Step | Who does the work | Who decides the next step | Explained on |
|---|---|---|---|---|
| 1 | intake | intake agent: email to submission | code | primitives |
| 2 | gather_evidence | assessment agent; three lookups in parallel | code: the fan-in rule | concurrency, failures |
| 3 | check_eligibility | code: the rules of the policy fixture | code | primitives |
| 4 | draft_recommendation | underwriting agent, from a structured handoff | code | handoffs |
| 5 | verify_process | code: the guard | code: pass, block or escalate | control plane |
| 6 | record_recommendation | code: the idempotent write | code | durable workflows, limits |
| 7 | await_underwriter | nobody: the run is suspended | a person | human approvals |
| 8 | apply_decision | code: stores the human_decision | code, from the person's signal | human approvals |
The policy fixture is the illustrative rule set the rules step applies: UW-GUIDE, version 2026.2, effective 2026-07-01, with an older version 2025.4 and this site's own 2026.3. Its rules are not insurance practice; the roof limits are invented. The policy version is the version a run used, recorded at the start and checked again when a decision arrives; UW-902 shows why. The underwriter cockpit is the web app where the underwriter reads the stored recommendation and decides; in the example the case file plays the cockpit and sends the decision.
Diagram: The quote workflow · who works and who decides, step by step
Each lane is one role. Left to right is time. Code (the orchestrator) decides what runs next at every step; the agents work inside their own steps; the underwriter decides at the end. A box crossing into another lane is a handoff. The agents are scripted stand-ins and time is simulated.
- Orchestrator (code)
- 3 check_eligibility: Deterministic rules of UW-GUIDE 2026.2. The same facts always give the same outcome.
- 5 verify_process: Checks that eligibility ran and every cited rule was retrieved, before anything is written.
- 6 record_recommendation: Stores the recommendation for the cockpit, with a key that makes a repeat store nothing new.
- 8 apply_decision: Written only from an applied signal of a person: role, decision, override, reason.
- Agents (stand-ins)
- 1 intake: The intake agent turns the broker's email into a submission record. From here on every step reads JSON.
- 2 gather_evidence: Three lookups in parallel; the fan-in rule decides what was enough.
- 4 draft_recommendation: Writes the recommendation from a structured handoff. The model recommends; a person decides.
- Underwriter (a person)
- 7 await_underwriter: The run waits with an approval token; the underwriter reads the recommendation in the cockpit.
2. Eighteen cases, one table#
The example has eighteen cases: UW-001 to UW-010 are shared by the whole series, UW-901 to UW-908 are this site's own. The runner plays each one in its own mode:
$ $PY run.py --all
Quote workflow · scripted stand-in agents (no model called) · simulated time · seed 7
case mode status route cites human decision
UW-001 dag suspended decline R-ROOF-01 -
UW-002 dag completed approve - underwriter: approve
UW-003 dag suspended request_info R-ROOF-02 -
UW-004 dag completed escalate R-ROOF-03 senior_underwriter: approve
UW-005 dag completed decline R-ROOF-01 underwriter: decline
UW-006 dag suspended request_info - -
UW-007 dag suspended decline R-ROOF-01 -
UW-008 loop failed decline R-ROOF-01 -
UW-009 dag completed approve - underwriter: decline (override)
UW-010 loop suspended escalate R-ROOF-03 -
UW-901 dag suspended escalate R-ROOF-03 -
UW-902 dag suspended decline R-ROOF-01 -
UW-903 dag suspended decline R-ROOF-01 -
UW-904 loop suspended escalate - -
UW-905 dag completed approve - underwriter: approve
UW-906 dag cancelled approve - -
UW-907 dag suspended escalate R-ROOF-01 -
UW-908 dag suspended request_info - -
wrote 18 run file(s) in out/runs/ and out/summary.json
A suspended status means the run is waiting for the underwriter: the case file sends no decision, so the run stops where a real one would wait. For UW-008 the route column shows the draft; nothing was stored, because the guard blocked. For UW-906 it shows the recommendation that was stored and then withdrawn.
| Case | Situation | What the orchestrator does | Page |
|---|---|---|---|
UW-001 | Roof 31 years, zone C | Rules route to decline, cites R-ROOF-01; waits for the underwriter | primitives |
UW-002 | Clean warehouse, roof 8 years | Straight path, eight steps, one decision | this page |
UW-003 | Roof age unknown | Branch to request_info, missing names the roof age | primitives |
UW-004 | Application 9 years, provider 22 | escalate under R-ROOF-03; only a senior underwriter may decide | approvals |
UW-005 | An injected passage says "approve" | Retrieved text is data; the route stays decline | handoffs |
UW-006 | Roof provider times out | Retry with attempt_number 2, then the fallback route | failures |
UW-007 | A past approval under 2025.4 | decline under 2026.2; the old decision is not a reason | handoffs |
UW-008 | Loop skips the guidance search | The guard blocks the write; the run fails | control plane |
UW-009 | The underwriter declines an approve | human_decision with override true and a reason | approvals |
UW-010 | Input of UW-004, 20 trials | Loop paths vary, pipeline path never does | shapes |
UW-901 | Process dies after step 2 | Resume from the checkpoint; finished steps not rerun | durable |
UW-902 | Policy moves to 2026.3 while waiting | Stale approval; back to the rules | approvals |
UW-903 | Optional lookup fails, one is slow | Partial failure; the gap is reported | concurrency |
UW-904 | Loop keeps searching | Budget ends the loop; code escalates | limits |
UW-905 | Decision arrives twice | Applied once; the repeat is acknowledged | approvals |
UW-906 | Broker withdraws after the write | Cancellation with compensation | durable |
UW-907 | Draft disagrees with the rules at a boundary | The guard escalates | control plane |
UW-908 | Roof provider fails run after run | The circuit breaker opens; fallback without calling | failures |
The lab below opens any case's run in full: the path through the steps, the events, the attempts, the final status, the recommendation and the human decision.
The table above is the same information for a reader without JavaScript; the full event log of any case is printed by run.py --case UW-00N --verbose.
3. The same task as a pipeline and as a bounded loop#
The site's recommended design, stated as a design, is the hybrid: a deterministic skeleton, a model's choice only inside one bounded step, a code guard at the exit of that step, and a person at the decision. The example runs the same task both ways. In pipeline mode (--mode dag) code decides every next step. In loop mode (--mode loop) steps 2 to 4 become one agent loop in which the stand-in model picks the next tool inside a budget; steps 5 to 8 stay fixed code.
UW-010 runs the input of UW-004 twenty times in each mode:
$ $PY run.py --case UW-010 --mode loop --trials 20
Quote workflow · scripted stand-in agents (no model called) · simulated time · seed 7
UW-010 · loop mode · 20 trials · 9 distinct path(s)
status: suspended 19, failed 1 · route: escalate 20 · calls per run: 8 to 13
x4 get_roof_assessment > search_guidance > check_eligibility > finish
x4 search_guidance > get_roof_assessment > find_similar_decisions > check_eligibility > finish
x2 find_similar_decisions > search_guidance > get_roof_assessment > check_eligibility > finish
x2 find_similar_decisions > get_roof_assessment > search_guidance > check_eligibility > finish
x2 get_roof_assessment > search_guidance > find_similar_decisions > check_eligibility > finish
x2 search_guidance > get_roof_assessment > check_eligibility > finish
x2 get_roof_assessment > find_similar_decisions > search_guidance > check_eligibility > finish
x1 find_similar_decisions > get_roof_assessment > search_guidance > search_guidance > check_eligibility > finish
x1 get_roof_assessment > find_similar_decisions > check_eligibility > finish
wrote 20 run file(s) in out/runs/ and out/summary.json
$ $PY run.py --case UW-010 --mode dag --trials 20
Quote workflow · scripted stand-in agents (no model called) · simulated time · seed 7
UW-010 · dag mode · 20 trials · 1 distinct path(s)
status: suspended 20 · route: escalate 20 · calls per run: 7 to 7
wrote 20 run file(s) in out/runs/ and out/summary.json
Nine paths against one. Calls per run from 8 to 13 against always 7. One trial in loop mode skipped the guidance search, and the guard stopped it before the write. The model's freedom bought nothing in this case and cost calls and one failed run; the guard is what kept that failure safe. Whether freedom pays in another task is a question for the control plane page and for evaluation.
| Mode | Distinct paths in 20 trials | Calls per run | Route | Status |
|---|---|---|---|---|
pipeline (dag) | 1 | 7 | escalate 20 | suspended 20 |
| loop (turn budget 6) | 9 | 8 to 13 | escalate 20 | suspended 19, failed 1 (guard) |
4. The pause, the crash and the fan-out#
Three mechanisms carry most of the production risk, and each has its own page and lab. Here they are on one run each.
The pause. UW-004 suspends after the write with an approval token, waits 180 simulated minutes, and resumes only when a senior underwriter's signal passes five checks (used token, run waiting, token match, role, policy version); an underwriter who is not senior gets reject_role and the run keeps waiting. The lab opens on UW-902 and lets you play the underwriter and switch on the accidents: the policy changes while waiting, the decision arrives twice, the process restarts.
| Your action and accident | What the orchestrator does |
|---|---|
| Approve, nothing goes wrong | apply; run completed |
| The same click twice | first apply, then ignore_duplicate |
Approve after the policy moved to 2026.3 | recheck_eligibility: back to the rules, new wait |
| Process restarts during the wait | the waiting record is read back from the checkpoint; nothing is lost |
The crash. UW-901 dies after step 2; a second process reads the checkpoint, continues with step 3, and makes the same 4 tool calls as a run without a crash. If it dies after the write and before its checkpoint, the idempotency key keeps the store at one row. See durable workflows.
The fan-out. Step 2 runs the three lookups on three workers with a deadline; the fan-in rule says the roof assessment and the guidance are required and similar decisions optional.
| Lookups | Fan-in | Route |
|---|---|---|
all ok (UW-002) | all aggregated | normal |
roof times out twice (UW-006) | required missing | request_info, missing roof_assessment |
similar fails, guidance slow (UW-903) | optional missing, reported | normal |
roof skipped, breaker open (UW-908) | required missing | request_info, without calling the provider |
5. The person at the end#
An override is a human decision that goes against an approve or decline recommendation. In UW-009 the stand-in recommends approve; the underwriter declines because the broker's loss run shows an open water damage claim that is not on the application. The human_decision records the role, the decision, override true and that reason. The reason is information the agents never had.
That is the shape of the whole site in one record. The orchestrator decided what ran next, eight times. Three agents did bounded work. Code checked everything that could be checked. And the decision that matters was made by a person, who could see the evidence, the rules and the gaps, and who was free to disagree.
What this is not. This page runs the orchestration of one synthetic workflow. Measuring how often a real model's recommendations are right is the subject of Eval Engineering; the runtime around each model call is Harness Engineering; the messages between agents are Agent Communication.
6. The same workflow in a coding agent#
The quote workflow is one instance of a general shape. A coding agent that fixes an issue follows the same moves, with different nouns:
| Idea | Quote workflow | Coding agent |
|---|---|---|
| Sequence | intake, evidence, rules, draft, guard, write | plan, edit, test, pull request |
| Branch | the fan-in rule; the guard's verdict | tests pass or fail |
| Loop | bounded agent loop in loop mode | edit and test again |
| Fan-out | three lookups in parallel | CI jobs in parallel |
| Human approval | the underwriter in the cockpit | the reviewer approves the merge |
| Durable state | checkpoints, the stored recommendation | the branch and the pull request |
| Budget | turns, tool calls, tokens, time | turn limit |
The loop inside one coding agent is covered on Harness Engineering; hooks, review and CI on Diff to Deploy.
7. Run it yourself#
The example is standard-library Python 3, in examples/uw-orchestrator/ of this site's repository. No model is called, there is no key and no network.
cd examples/uw-orchestrator
PY=/opt/homebrew/bin/python3
$PY -m unittest # 45 tests
$PY run.py --all # every case in its own mode
$PY run.py --case UW-006 --verbose # with the event log
$PY run.py --case UW-901 --crash-after gather_evidence # the process dies; prints the run_id
$PY run.py --case UW-010 --mode loop --trials 20 # the path varies
Where each idea of the site lives in the code:
| Concept | File and function |
|---|---|
| The orchestrator (what runs next) | engine.py:Engine.advance |
| Transitions and their legality | core.py:RUN_TRANSITIONS, run_transition |
| Pipeline and loop modes | workflow.py:build_workflow, step_agent_loop |
| Fan-out and fan-in | core.py:simulate_fanout, fan_in |
| The guard | core.py:verify_process, workflow.py:step_verify_process |
| Permissions and budgets | tools_sim.py:TOOL_PERMISSIONS, core.py:budget_check |
| Suspend and resume | engine.py:Engine.suspend, Engine.signal; core.py:accept_resume |
| Checkpoint, idempotency, compensation | engine.py:Engine.checkpoint, RecordStore.put_recommendation; workflow.py:compensate_record |
| Circuit breaker | core.py:breaker_before_call, breaker_after_call |
| One trace per run | engine.py:make_trace_id, Engine.add_span, Engine.break_trace |
| Outcome check | run.py:check_expected |
The README in that folder has the full case table, real output of every command, and a longer concept table.
Checklist#
- Every step of the workflow names who does the work and who decides what comes next.
- Every case states its expected outcome, and every run is checked against it.
- The model's freedom lives inside one bounded step, with a guard at its exit.
- Waits, crashes and failed lookups each have a case that exercises them.
- The person's decision is recorded with role, decision, override flag and reason.
- Everything synthetic is marked synthetic, once, where a reader meets it.
In one breath#
The quote workflow turns a broker's email into a recommendation an underwriter can decide on, in eight steps. Code decides what runs next at every step; three agents do bounded work inside theirs; a guard checks the draft before the write; and the run waits, holding nothing, until a person decides. Eighteen synthetic cases exercise every path, from the straight approval to a crash, a stale approval, a runaway loop and a broken provider.
Where to go from here#
You have seen the whole site in one place. To go deeper on any mechanism, follow the page links in the tables above. To see where this site's subject ends and a sister site's begins, read About, which also lists the sources and what this site proposes as its own design.