# Lead-to-Policy (Aria) — Live Flow Findings App **385**, workflow `e29c3c33` (db `workflow_id=29851`), org 53. Sandbox DB verified (`postgres-sandbox`, read-only) + AI decisions via `https://sandbox.getzino.in/monitor/decisions`. Loop: `/loop 4m` (cron `d62147e6`). Each tick re-checks the latest instance, observes what the AI did, recommends the next human payload. --- ## State graph (state → activity → next state) | # | State | Human/forward activity | → next state | Disqualify? | |---|-------|------------------------|--------------|-------------| | 1 | New Lead | Capture Lead `cc1a73d5` (INIT) | Qualified (via Qualify Lead) | yes | | 2 | Qualified | **Assign Lead `da61aaa1`** | Assigned | yes | | 3 | Assigned | Log First Contact `fea6b3a8` | Contacted | yes | | 4 | Contacted | Schedule Meeting `c444d32f` | Meeting Scheduled | yes | | 5 | Meeting Scheduled | Recommend Product `c0e2004e` (→ stage-gate `…5a01`) | Product Recommended | yes | | 6 | Product Recommended | Collect Documents `a8eb0faa` | Documents Collected | yes | | 7 | Documents Collected | Assess Eligibility `ba3d3e7f` (→ gate `…0a01`) | Eligibility Assessed | yes | | 8 | Eligibility Assessed | Submit Underwriting `ed8ec0dc` (→ gate `…0b02`) | Underwriting | yes | | 9 | Underwriting | Issue Policy `7b8fb734` (→ gate `…0c03`) | Policy Issued | yes | | 10 | Policy Issued | Onboard Customer `ae415f4e` | Customer 360 (END) | — | `Disqualify ea99fc60` is allowed in every non-terminal state → **Disqualified** (END). `AI Product Recommendation 14d734da` is a self-loop on Meeting Scheduled (AI-only, no state change). --- ## AI employees & triggers (verified in `activity_triggers`) Trigger = bound to a **source** activity; fires *after* a human performs it, then the bound AI employee autonomously performs the **next** workflow activity. | Trigger on activity | AI employee | user_id | Effect | |---------------------|-------------|---------|--------| | Capture Lead `cc1a73d5` | Insurance AI (Aria) #6 | **29180** | auto-performs **Qualify Lead** → Qualified | | Assign Lead `da61aaa1` | Aria (Engagement) #7 | **29181** | auto-performs next (Log First Contact) | | Log First Contact `fea6b3a8` | Aria (Engagement) #7 | **29181** | auto-advances toward Schedule Meeting | | Schedule Meeting `c444d32f` | Aria Advisor #9 | **29188** | logs **AI Product Recommendation** decision (self-loop) before human Recommend Product | | Collect Documents `a8eb0faa` | Aria (Underwriting) #8 | **29182** | auto-advances underwriting steps | | Onboard Customer `ae415f4e` | *(no AI)* automation pipeline | — | customJS Compute Maturity → generateDoc Policy Schedule → sendEmail welcome | Note: Qualify Lead, Recommend Product, Assess Eligibility, Submit Underwriting, Issue Policy have **no** trigger bound → they are human/manual gates (no auto-advance). --- ## Observation log ### Tick 1 — 2026-06-26 ~07:25 (instance 5017, lead "Parikshith Takkar") Flow observed (verified DB + monitor): - `07:20:46` — **Capture Lead** by human **29183** (Sales Agent). Lead: Bengaluru / Karnataka, Lawyer, ₹23L income, DOB 1976-05-25 (age 50), web, term interest, English. - Capture trigger fired → **Insurance AI (Aria) 29180** auto-performed **Qualify Lead** at `07:21:31`: - confidence **0.95**, status **submitted**, model `claude-sonnet-4-5`, 5 LLM calls, cost ~$0.124. - set lead_score **95**, segment **hot**, annual_income 23,00,000, DOB confirmed. - knowledge sources: Lead Qualification Guide, ABSLI Product Catalog, ABSLI Underwriting Rules. - reasoning: age 50 within 18-65 entry; income supports ₹2.76–3.45 cr coverage; Lawyer = stable; no disqualifiers. - **Current state: Qualified** (`41c7a19f`). No trigger on Qualify Lead → flow waits for human. **→ Next human activity = Assign Lead.** Recommended payload below. --- ## ⭐ Recommended payload — next activity: **Assign Lead** (`da61aaa1`) Fields (from `activity_data_fields`; field_rules cascade city → region → agent): ```json { "assign_city": "Bengaluru", "assigned_region_input": "South", "owner_agent_input": { "id": 1, "name": "Asha Rao" } } ``` - `assign_city` — select, mapped `city`. Lead already in Bengaluru. Drives region filter. - `assigned_region_input` — **mandatory** lookup `tbl_branches.region`. Bengaluru branch (id 7, "Bengaluru MG Road") → region **South**. Filtered by city via rule `rule_region_by_city`. - `owner_agent_input` — optional lookup `tbl_sales_agents` (stores id+name), filtered to region=South via `rule_agent_by_region`. South agents available: **Asha Rao (1)**, Karthik Iyer (7), Divya Menon (8). Pick any; Asha Rao recommended. **After you submit Assign Lead:** trigger fires → **Aria (Engagement) 29181** auto-performs the next step (Log First Contact → Contacted). Watch `/monitor/decisions?instance_id=5017` for user `29181`. --- ### Tick 2 — 2026-06-26 ~07:29 — no change Instance 5017 still in **Qualified** (`updated_at` 07:21:31, unchanged). Assign Lead not yet submitted. Recommendation above unchanged.