Files
unraid-docker-manager/.planning/phases/10-workflow-modularization/10-04-PLAN.md
T
Lucas Berger c122803fad docs(10): create phase plan for workflow modularization
Phase 10: Workflow Modularization
- 4 plan(s) in 3 wave(s)
- Wave 1: Orphan cleanup (1 plan)
- Wave 2: Sub-workflow extraction (2 plans parallel)
- Wave 3: Integration verification (1 plan)
- Ready for execution

Plans:
- 10-01: Remove 8 orphan nodes
- 10-02: Extract container-update sub-workflow (DEBT-03)
- 10-03: Extract container-actions sub-workflow
- 10-04: Integration verification with user checkpoint

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

7.1 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
phase plan type wave depends_on files_modified autonomous must_haves
10-workflow-modularization 04 execute 3
10-02
10-03
n8n-workflow.json
false
truths artifacts key_links
All text commands work after modularization
All inline keyboard flows work after modularization
All batch operations work after modularization
Main workflow is significantly smaller than before
path provides min_lines
n8n-workflow.json Modularized main workflow 4000
path provides contains
n8n-container-update.json Update sub-workflow executeWorkflowTrigger
path provides contains
n8n-container-actions.json Actions sub-workflow executeWorkflowTrigger
from to via pattern
n8n-workflow.json n8n-container-update.json Execute Sub-workflow executeWorkflow
from to via pattern
n8n-workflow.json n8n-container-actions.json Execute Sub-workflow executeWorkflow
Perform full integration verification of modularized workflow and checkpoint with user.

Purpose: After extracting update and actions to sub-workflows, verify the entire bot still works correctly. This includes edge cases and flows that may not have been explicitly tested in prior plans.

Output: Verified working modularized workflow, user confirmation, and updated ROADMAP showing phase complete.

<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/phases/10-workflow-modularization/10-RESEARCH.md @.planning/phases/10-workflow-modularization/10-01-SUMMARY.md @.planning/phases/10-workflow-modularization/10-02-SUMMARY.md @.planning/phases/10-workflow-modularization/10-03-SUMMARY.md @n8n-workflow.json @n8n-container-update.json @n8n-container-actions.json Task 1: Comprehensive functionality audit n8n-workflow.json, n8n-container-update.json, n8n-container-actions.json Run through all bot functionality systematically to verify nothing was broken by modularization.

Text command tests:

  1. /start or /status - Should show help or status
  2. status - Should list all containers with inline keyboard
  3. status <container> - Should show specific container status
  4. start <container> - Should start and confirm
  5. stop <container> - Should prompt confirmation, then stop
  6. restart <container> - Should restart and confirm
  7. update <container> - Should prompt confirmation, show progress, complete
  8. logs <container> - Should show logs
  9. logs <container> 100 - Should show 100 lines of logs
  10. batch start <names> - Should batch start
  11. batch stop <names> - Should batch stop with confirmation
  12. batch update <names> - Should batch update with confirmation

Inline keyboard tests:

  1. Container list navigation (pagination if >10 containers)
  2. Container submenu display
  3. Start button (on stopped container)
  4. Stop button with confirmation dialog
  5. Restart button
  6. Update button with confirmation dialog
  7. Update progress messages
  8. Logs button with refresh
  9. Back navigation
  10. Batch selection mode
  11. Batch execution with progress

Edge cases:

  1. Container not found (fuzzy match suggestions)
  2. Ambiguous container name (disambiguation)
  3. Update when already up to date
  4. Action on already running/stopped container
  5. Confirmation timeout (30 seconds)

Document any issues found.

  • All text commands execute without errors
  • All inline keyboard flows work
  • Batch operations complete successfully
  • Edge cases handled gracefully Full functionality audit completed, issues documented
Task 2: Measure modularization impact n8n-workflow.json, n8n-container-update.json, n8n-container-actions.json Quantify the improvements from modularization:
  1. Line count comparison:

    • Original main workflow: ~8,485 lines
    • New main workflow: Count lines
    • Update sub-workflow: Count lines
    • Actions sub-workflow: Count lines
    • Calculate total and reduction percentage
  2. Node count comparison:

    • Original: ~248 nodes (after orphan cleanup: ~240)
    • New main workflow: Count nodes
    • Update sub-workflow: Count nodes
    • Actions sub-workflow: Count nodes
  3. Code duplication analysis:

    • Before: Update flow duplicated (text + callback paths)
    • After: Single update flow in sub-workflow
    • Document specific duplication eliminated
  4. Document the modular structure:

    Main Workflow (n8n-workflow.json)
    ├── Telegram Trigger
    ├── Authentication
    ├── Command Routing
    ├── Confirmation Dialogs
    └── Sub-workflow Calls
        ├── container-update (for all update operations)
        └── container-actions (for start/stop/restart)
    

Create a summary table of before/after metrics.

  • Line counts documented for all workflow files
  • Node counts documented
  • Reduction percentage calculated
  • Modular structure documented Modularization impact measured and documented
Modularized n8n workflow with: - Main workflow calling sub-workflows for container operations - Container Update sub-workflow (handles all update paths) - Container Actions sub-workflow (handles start/stop/restart) - Orphan nodes cleaned up - Duplicated update code consolidated (DEBT-03) Please test the following in Telegram:
  1. Basic commands:

    • Send status - Should show container list keyboard
    • Send update <container> - Should prompt confirmation, then update
  2. Inline keyboard flow:

    • Tap a container from the list
    • Try Start/Stop/Restart buttons
    • Try Update button (with confirmation)
    • Try Logs button
  3. Batch operation:

    • Start batch mode and select 2 containers
    • Execute a batch action

Report any issues or confirm all functionality works as expected. Type "approved" to complete Phase 10, or describe any issues found

1. All text commands work correctly 2. All inline keyboard flows work correctly 3. All batch operations work correctly 4. Edge cases handled (not found, disambiguation, timeouts) 5. Main workflow line count reduced significantly 6. Update flow exists in single location (sub-workflow) 7. Actions flow exists in single location (sub-workflow) 8. User has verified bot works from their phone

<success_criteria>

  • MOD-01: Main workflow broken into logical sub-workflows (update, actions)
  • MOD-02: Sub-workflows callable from main without duplication
  • DEBT-03: Update flow consolidated (no longer duplicated)
  • All v1.1 functionality preserved
  • User verification passed </success_criteria>
After completion, create `.planning/phases/10-workflow-modularization/10-04-SUMMARY.md`