Files
unraid-docker-manager/.planning/phases/10.1-aggressive-workflow-modularization/10.1-05-PLAN.md
T
Lucas Berger 25dd3ab2d2 docs(10.1): create phase plan
Phase 10.1: Aggressive Workflow Modularization
- 5 plan(s) in 3 wave(s)
- Wave 1: Foundation (rename files, analyze boundaries, user approval)
- Wave 2: 3 parallel extractions (batch-ui, status, confirmation)
- Wave 3: Integration verification and UAT
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 20:20:29 -05:00

7.6 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
phase plan type wave depends_on files_modified autonomous must_haves
10.1-aggressive-workflow-modularization 05 execute 3
10.1-02
10.1-03
10.1-04
n8n-workflow.json
false
truths artifacts key_links
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
path provides
n8n-workflow.json Minimal orchestrator workflow
path provides
n8n-batch-ui.json Batch UI sub-workflow
path provides
n8n-status.json Container status sub-workflow
path provides
n8n-confirmation.json Confirmation dialog sub-workflow
from to via pattern
n8n-workflow.json all sub-workflows Execute Workflow nodes with TODO placeholders 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.

<execution_context> @/home/luc/.claude/get-shit-done/workflows/execute-plan.md @/home/luc/.claude/get-shit-done/templates/summary.md </execution_context>

@.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:

# 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 <container> - 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)

<success_criteria>

  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 </success_criteria>
After completion, create `.planning/phases/10.1-aggressive-workflow-modularization/10.1-05-SUMMARY.md`