Sequential Agent Pipeline
flowchart TB
subgraph INPUT["User Input"]
Q["T-Code, Transaction Name,\nTransaction Type, Documents"]
end
subgraph GATHER["Phase 1 — Data Gathering"]
A1["integration_agent\ngemini-2.5-flash"]
A2["uploaded_document_agent\ngemini-2.5-pro"]
A3["document_retrieval_agent\ngemini-2.5-flash"]
end
subgraph ANALYSIS["Phase 2 — Analysis"]
A4["extraction_agent\ngemini-2.5-pro"]
end
subgraph DRAFTING["Phase 3 — Drafting"]
A5["section_summary_agent\ngemini-2.5-pro"]
A6["section_context_agent\ngemini-2.5-flash"]
A7["section_financial_agent\ngemini-2.5-pro"]
end
subgraph QUALITY["Phase 4 — Quality & Publishing"]
A8["verification_agent\ngemini-2.5-pro"]
A9["publishing_agent\ngemini-2.5-flash"]
end
subgraph TOOLS["Tools"]
T1["read_sheet_data\nGoogle Sheets API"]
T2["read_drive_document\nDrive API → Markdown"]
T3["search_vertex_ai\nVertex AI Search"]
T4["score_cp_document\nDeterministic scoring"]
T5["create_deal_sheet_doc\nDrive API → Google Doc"]
end
subgraph CALLBACKS["Callbacks"]
C1["_skip_vertex_search\nBypass if flag set"]
C2["_publish_document\nDeterministic HTML assembly"]
end
Q --> A1
Q --> A2
Q --> A3
A1 -- "sheet_data" --> A4
A2 -- "uploaded_doc_text" --> A4
A3 -- "vertex_search_results" --> A4
A4 -- "extracted_data" --> A5
A4 -- "extracted_data" --> A6
A4 -- "extracted_data" --> A7
A5 -- "sections_1_2" --> A8
A6 -- "sections_3_5" --> A8
A7 -- "sections_6_8" --> A8
A8 -- "verification_report" --> A9
A1 -.-> T1
A2 -.-> T2
A3 -.-> T3
A8 -.-> T4
A9 -.-> T5
C1 -.-> A3
C2 -.-> A9
A9 --> OUT["Controls Package\nGoogle Doc\n+\nVerification Report\nGoogle Doc"]
classDef agent fill:#1e293b,stroke:#334155,color:#f8fafc,rx:12
classDef tool fill:#3b82f6,stroke:#2563eb,color:#fff,rx:8
classDef callback fill:#f59e0b,stroke:#d97706,color:#fff,rx:8
classDef input fill:#e2e8f0,stroke:#94a3b8,color:#1e293b,rx:12
classDef output fill:#10b981,stroke:#059669,color:#fff,rx:12
classDef phase fill:#f8fafc,stroke:#e2e8f0,color:#64748b
class A1,A2,A3,A4,A5,A6,A7,A8,A9 agent
class T1,T2,T3,T4,T5 tool
class C1,C2 callback
class Q input
class OUT output