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>
7.4 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 | 04 | execute | 2 |
|
|
true |
|
Purpose: Remove ~15-20 nodes from main workflow by extracting the confirmation dialog domain. Output: New n8n-confirmation.json sub-workflow, updated main workflow with confirmation nodes extracted.
<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-01-SUMMARY.md @n8n-workflow.json @n8n-actions.json Task 1: Create n8n-confirmation.json sub-workflow with extracted confirmation nodes n8n-confirmation.json (new) Create new sub-workflow containing confirmation dialog nodes.Input contract (Execute Workflow Trigger):
- chatId: number (required)
- messageId: number (required, for editing message)
- action: string ('show_stop' | 'show_update' | 'confirm' | 'cancel' | 'check_expired')
- containerId: string (optional)
- containerName: string (optional)
- containerIds: array (optional, for multi-container)
- confirmationToken: string (optional, for verifying non-expired)
- responseMode: string
Nodes to extract (confirmation related - excluding batch confirmations which stay in batch-ui):
- Build Stop Confirmation, Build Update Confirmation, Build Update All Confirmation
- Check Confirm Expired, Handle Confirm Expired, Send Expired Confirm
- Edit To Stop Confirmation, Send Stop Confirmation, Send Update Confirmation, Send Update All Confirmation
- Answer Confirm Callback, Answer Cancel Confirm Callback
- Build Confirmed Stop Command, Prepare Confirmed Stop, Prepare Confirmed Stop Input
- Execute Confirmed Stop, Execute Confirmed Stop Action
- Format Confirmed Stop Result, Handle Confirmed Stop Result, Send Confirmed Stop Result
- Route Confirm Action
NOTE: Batch confirmations (Build Batch Stop Confirmation, etc.) should stay in n8n-batch-ui.json since they're part of batch flow. This sub-workflow handles single-container confirmations and "update all" confirmations.
Structure:
- Execute Workflow Trigger (entry point)
- Parse Input (validate action type)
- Switch on action type
- For show_stop: Build confirmation keyboard, return for main to send
- For confirm: Validate not expired, execute action via sub-workflow call
- For cancel: Return cancellation result
- For check_expired: Validate confirmation token age
Output contract:
{
success: true/false,
action: 'show_stop|show_update|confirm|cancel|expired',
// For show:
keyboard: {...},
text: "confirmation text",
confirmationToken: "uuid for expiry tracking",
// For confirm:
executed: true/false,
result: { containerId, containerName, newState },
// For expired:
expired: true/false,
// Error:
error: "error message" || null
}
Important: For confirmed stop/restart actions, this sub-workflow should call n8n-actions.json to perform the actual container action.
cat n8n-confirmation.json | python3 -c "import json,sys; d=json.load(sys.stdin); print(f'Nodes: {len(d.get(\"nodes\",[]))}')"shows node count (~15-20)- Sub-workflow has Execute Workflow Trigger node
- Sub-workflow has Execute Workflow node calling n8n-actions.json n8n-confirmation.json created with confirmation dialog nodes extracted.
-
Remove extracted confirmation nodes from main workflow (Keep batch confirmation nodes if they're still in main workflow - they belong in batch-ui)
-
Add Execute Workflow node ("Execute Confirmation"):
- Source: database
- WorkflowId: use TODO_DEPLOY_CONFIRMATION_WORKFLOW placeholder
- Mode: once
- waitForSubWorkflow: true
- Input: { chatId, messageId, action, containerId, containerName, confirmationToken, responseMode }
-
Update routing in main workflow:
- Route Callback should route confirmation callbacks (confirm:, cancel:) to Execute Confirmation
- Stop command should route to Execute Confirmation with action='show_stop'
-
Add result handler after Execute Confirmation:
- If result.expired: show expired message
- If result.executed: show result message
- If result has keyboard: send/edit confirmation dialog
- Main workflow has "Execute Confirmation" node
- No single-container confirmation nodes remain in main workflow
- TODO_DEPLOY_CONFIRMATION_WORKFLOW placeholder exists Main workflow updated with confirmation nodes extracted.
-
Verify the extraction:
- Main workflow node count reduced by ~15-20 from previous state
- n8n-confirmation.json exists with extracted nodes
- No orphan references
-
Commit the extraction:
git add n8n-workflow.json n8n-confirmation.json n8n-workflow.json.backup-confirm git commit -m "feat(10.1-04): extract confirmation dialogs to sub-workflow - Created n8n-confirmation.json with stop/update confirmation nodes - Handles confirmation display, expiry checking, and action execution - Calls n8n-actions.json for confirmed stop/restart - Added TODO_DEPLOY_CONFIRMATION_WORKFLOW placeholder"
<success_criteria>
- New n8n-confirmation.json sub-workflow created
- Main workflow reduced by ~15-20 additional nodes
- Confirmation dialog functionality extracted cleanly
- Backup created for rollback
- Changes committed to git </success_criteria>