--- phase: 10.1-aggressive-workflow-modularization plan: 06 type: execute wave: 1 depends_on: [] files_modified: - .planning/phases/10.1-aggressive-workflow-modularization/10.1-SUB-WORKFLOW-CONTRACTS.md - .planning/phases/10.1-aggressive-workflow-modularization/10.1-CODE-NODE-ANALYSIS.md autonomous: false gap_closure: true must_haves: truths: - "All sub-workflow input/output contracts are documented" - "Code nodes are categorized as orchestration vs domain logic" - "User has made decision on node count gap closure approach" artifacts: - path: ".planning/phases/10.1-aggressive-workflow-modularization/10.1-SUB-WORKFLOW-CONTRACTS.md" provides: "Input/output contract documentation for all 6 sub-workflows" - path: ".planning/phases/10.1-aggressive-workflow-modularization/10.1-CODE-NODE-ANALYSIS.md" provides: "Classification of 62 Code nodes by purpose" key_links: [] --- Close verification gaps from Phase 10.1 by documenting sub-workflow contracts, analyzing Code nodes, and obtaining user decision on node count gap. Purpose: VERIFICATION.md identified 3 gaps - this plan addresses Gap 2 (Code node analysis incomplete), Gap 3 (contract consistency uncertain), and presents options for Gap 1 (node count target not met). Output: Documentation artifacts and user decision on whether to proceed with additional extraction or accept current state. @/home/luc/.claude/get-shit-done/workflows/execute-plan.md @/home/luc/.claude/get-shit-done/templates/summary.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/10.1-aggressive-workflow-modularization/10.1-VERIFICATION.md @.planning/phases/10.1-aggressive-workflow-modularization/10.1-01-domain-analysis.md @n8n-workflow.json @n8n-batch-ui.json @n8n-status.json @n8n-confirmation.json @n8n-update.json @n8n-actions.json @n8n-logs.json Task 1: Document Sub-workflow Input/Output Contracts .planning/phases/10.1-aggressive-workflow-modularization/10.1-SUB-WORKFLOW-CONTRACTS.md Create comprehensive documentation of input/output contracts for all 6 sub-workflows by inspecting: 1. Each sub-workflow's Execute Workflow Trigger node (input fields) 2. Each sub-workflow's terminal nodes (output structure) 3. Main workflow's Prepare* nodes that build inputs for Execute Workflow calls 4. Main workflow's Route* nodes that handle sub-workflow outputs Document for each sub-workflow: - **Input contract:** All expected fields, types, and which are required vs optional - **Output contract:** The `action` field values and associated data fields - **Caller nodes:** Which Execute Workflow nodes in main workflow call this sub-workflow - **Prepare nodes:** Which Code nodes prepare the input data Sub-workflows to document: 1. n8n-update.json (Container Update) - ID: 7AvTzLtKXM2hZTio92_mC 2. n8n-actions.json (Container Actions) - ID: fYSZS5PkH0VSEaT5 3. n8n-logs.json (Container Logs) - ID: oE7aO2GhbksXDEIw 4. n8n-batch-ui.json (Batch UI) - ID: ZJhnGzJT26UUmW45 5. n8n-status.json (Container Status) - ID: lqpg2CqesnKE2RJQ 6. n8n-confirmation.json (Confirmation Dialogs) - ID: fZ1hu8eiovkCk08G Format as markdown with tables showing field name, type, required, and description. File exists at .planning/phases/10.1-aggressive-workflow-modularization/10.1-SUB-WORKFLOW-CONTRACTS.md with documented contracts for all 6 sub-workflows All 6 sub-workflows have documented input/output contracts with field-level detail Task 2: Analyze and Classify Code Nodes .planning/phases/10.1-aggressive-workflow-modularization/10.1-CODE-NODE-ANALYSIS.md Analyze all 62 Code nodes in the main workflow and classify each as one of: 1. **ORCHESTRATION** - Must stay in main workflow - Prepare* nodes that build sub-workflow inputs - Route/Handle nodes that process sub-workflow outputs - Parse* nodes that interpret user input for routing 2. **PRESENTATION** - Locked to main per Telegram decision - Build* nodes that construct Telegram messages/keyboards - Format* nodes that prepare display data 3. **DOMAIN_LOGIC** - Potentially extractable - Match* nodes (container matching logic) - Find* nodes (search/filter logic) - Check* nodes with business logic (not routing switches) 4. **HYBRID** - Partially extractable - Nodes that mix orchestration with domain logic Create table with columns: - Node name - Category (ORCHESTRATION/PRESENTATION/DOMAIN_LOGIC/HYBRID) - Rationale (why this classification) - Extraction potential (YES/NO/PARTIAL with explanation) Summarize: - Count by category - Total extractable nodes (DOMAIN_LOGIC + partial HYBRID) - Estimated node reduction if extracted File exists at .planning/phases/10.1-aggressive-workflow-modularization/10.1-CODE-NODE-ANALYSIS.md with all 62 Code nodes classified All 62 Code nodes classified with extraction potential assessment How to address Gap 1 (node count: 168 current vs 115-125 target)? Phase 10.1 reduced main workflow from 192 to 168 nodes (12.5% reduction) through extraction of: - Batch UI (16 nodes in sub-workflow) - Container Status (11 nodes in sub-workflow) - Confirmation Dialogs (16 nodes in sub-workflow) The 115-125 target assumed extracting 4 domains, but Matching/Disambiguation was deferred. Analysis shows: - 18 Matching/Disambiguation nodes exist in main workflow - Extracting could reduce by ~10-15 nodes (net after integration overhead) - Would bring main to ~153-158 nodes (still 30+ nodes above 115-125 target) - Reaching 115-125 would require reconsidering the locked decision about Telegram responses staying in main workflow The verification also notes: - UAT passed with all functionality working - 13/16 must-haves verified - MOD-01 and MOD-02 requirements satisfied Select: option-a (accept), option-b (extract matching), or option-c (revisit telegram) - [ ] SUB-WORKFLOW-CONTRACTS.md documents all 6 sub-workflows - [ ] CODE-NODE-ANALYSIS.md classifies all 62 Code nodes - [ ] User has selected gap closure approach - [ ] If option-b selected, plan 10.1-07 will be created for Matching extraction 1. Gap 3 closed: Sub-workflow contracts documented with field-level detail 2. Gap 2 closed: Code nodes analyzed and classified 3. Gap 1 addressed: User decision recorded on approach After completion, create `.planning/phases/10.1-aggressive-workflow-modularization/10.1-06-SUMMARY.md` If user selects option-b, additional gap closure plan 10.1-07 will be needed for Matching domain extraction.