--- phase: 10.1-aggressive-workflow-modularization plan: 05 type: execute wave: 3 depends_on: ["10.1-02", "10.1-03", "10.1-04"] files_modified: - n8n-workflow.json autonomous: false must_haves: truths: - "Main workflow contains only trigger, auth, routing, and sub-workflow dispatch" - "All container operations work via sub-workflows" - "Main workflow is under 100 nodes (target: 50-80)" - "All sub-workflows have consistent input/output contracts" - "User has verified all functionality works correctly" artifacts: - path: "n8n-workflow.json" provides: "Minimal orchestrator workflow" - path: "n8n-batch-ui.json" provides: "Batch UI sub-workflow" - path: "n8n-status.json" provides: "Container status sub-workflow" - path: "n8n-confirmation.json" provides: "Confirmation dialog sub-workflow" key_links: - from: "n8n-workflow.json" to: "all sub-workflows" via: "Execute Workflow nodes with TODO placeholders" pattern: "TODO_DEPLOY.*WORKFLOW" --- Verify all extractions work together, clean up main workflow, and perform user acceptance testing. Purpose: Ensure the modularized architecture is complete and all functionality works correctly. Output: Verified working system, documentation of final state, UAT sign-off. @/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-CONTEXT.md @.planning/phases/10.1-aggressive-workflow-modularization/10.1-02-SUMMARY.md @.planning/phases/10.1-aggressive-workflow-modularization/10.1-03-SUMMARY.md @.planning/phases/10.1-aggressive-workflow-modularization/10.1-04-SUMMARY.md @n8n-workflow.json @n8n-batch-ui.json @n8n-status.json @n8n-confirmation.json Task 1: Verify main workflow structure and node count n8n-workflow.json (read only) Analyze final main workflow state: 1. Count total nodes (target: 50-80) 2. Verify main workflow contains only: - Telegram Trigger (1 node) - Authentication checks (2 nodes) - Keyword routing (5-10 nodes) - Execute Workflow calls to sub-workflows (6-8 nodes) - Result handlers after sub-workflow calls (10-15 nodes) - Error handling (2-3 nodes) 3. List all Execute Workflow nodes and their targets: - Execute Text Update -> n8n-update.json - Execute Callback Update -> n8n-update.json - Execute Action -> n8n-actions.json - Execute Text Logs -> n8n-logs.json - Execute Batch UI -> n8n-batch-ui.json - Execute Container Status -> n8n-status.json - Execute Confirmation -> n8n-confirmation.json 4. Check for orphan nodes (nodes with no connections) 5. Verify all TODO_DEPLOY_*_WORKFLOW placeholders are documented Output a summary: - Final node count - Node breakdown by category - List of Execute Workflow nodes - Any issues found - Node count verified and documented - No orphan nodes - All sub-workflow calls identified Main workflow structure verified and documented. Task 2: Create deployment documentation DEPLOY-SUBWORKFLOWS.md (new) Create deployment documentation for the new sub-workflow architecture. Content: ```markdown # Sub-workflow Deployment Guide ## Overview Phase 10.1 extracted main workflow from 192 nodes to ~XX nodes by creating domain sub-workflows. ## Sub-workflows | File | Purpose | Deploy Order | |------|---------|--------------| | n8n-update.json | Container update operations | 1 (already deployed) | | n8n-actions.json | Container start/stop/restart | 2 (already deployed) | | n8n-logs.json | Container log retrieval | 3 (already deployed) | | n8n-batch-ui.json | Batch selection UI | 4 | | n8n-status.json | Container list/status | 5 | | n8n-confirmation.json | Confirmation dialogs | 6 | ## Deployment Steps ### For each new sub-workflow (batch-ui, status, confirmation): 1. Import the JSON file into n8n 2. Note the workflow ID assigned by n8n 3. Search main workflow for the TODO placeholder: - `TODO_DEPLOY_BATCH_UI_WORKFLOW` - `TODO_DEPLOY_STATUS_WORKFLOW` - `TODO_DEPLOY_CONFIRMATION_WORKFLOW` 4. Replace placeholder with actual workflow ID 5. Re-import main workflow ### Existing Sub-workflows (already deployed) - Container Update: ID `7AvTzLtKXM2hZTio92_mC` - Container Actions: ID `fYSZS5PkH0VSEaT5` - Container Logs: ID `oE7aO2GhbksXDEIw` ## Rollback Backup files created during extraction: - `n8n-workflow.json.backup-batch` - Before batch extraction - `n8n-workflow.json.backup-status` - Before status extraction - `n8n-workflow.json.backup-confirm` - Before confirmation extraction To rollback, copy the appropriate backup file to n8n-workflow.json and re-import. ## Architecture \`\`\` n8n-workflow.json (orchestrator) ├── Trigger + Auth + Routing ├── Execute Update -> n8n-update.json ├── Execute Actions -> n8n-actions.json ├── Execute Logs -> n8n-logs.json ├── Execute Batch UI -> n8n-batch-ui.json │ ├── (calls n8n-update.json for batch updates) │ └── (calls n8n-actions.json for batch actions) ├── Execute Status -> n8n-status.json └── Execute Confirmation -> n8n-confirmation.json └── (calls n8n-actions.json for confirmed actions) \`\`\` ``` - DEPLOY-SUBWORKFLOWS.md exists - Contains all sub-workflow files and placeholders - Contains deployment steps and rollback instructions Deployment documentation created. Complete workflow modularization: - Main workflow reduced from 192 to ~XX nodes - 3 new sub-workflows extracted (batch-ui, status, confirmation) - Total of 6 sub-workflows in the system - Deployment documentation created **NOTE:** Full UAT requires deploying sub-workflows to n8n. For now, verify: 1. **File structure check:** - `ls n8n-*.json` should show 7 files (workflow + 6 sub-workflows) - Main workflow has expected reduced node count 2. **JSON validity:** - All JSON files parse correctly - All sub-workflows have Execute Workflow Trigger 3. **Deployment placeholders:** - Search n8n-workflow.json for "TODO_DEPLOY" - should find 3 new placeholders - Existing workflow IDs still referenced correctly 4. **After n8n deployment (when ready):** - Test `/list` command - should show container list - Test `/stop ` - should show confirmation - Test batch mode: `/stop` then select multiple containers - Test update flow - Test logs command Respond with: - "approved" if structure looks correct - "issues: [description]" if problems found Type "approved" or describe issues found - [ ] Main workflow node count documented - [ ] All sub-workflow files exist - [ ] Deployment documentation created - [ ] No orphan nodes in main workflow - [ ] User has verified structure (deployment verification deferred to n8n import) 1. Main workflow reduced to target size (50-80 nodes) 2. 6 sub-workflows total (3 existing + 3 new) 3. All TODO placeholders documented 4. Deployment guide created 5. User sign-off on structure After completion, create `.planning/phases/10.1-aggressive-workflow-modularization/10.1-05-SUMMARY.md`