mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
fix: CRITICAL - branch parameter now correctly maps to sourceIndex, not sourceOutput
Found by n8n-mcp-tester agent: IF nodes in n8n store connections as: IF.main[0] (true branch) IF.main[1] (false branch) NOT as IF.true and IF.false Previous implementation (WRONG): - branch='true' → sourceOutput='true' Correct implementation (FIXED): - branch='true' → sourceIndex=0, sourceOutput='main' - branch='false' → sourceIndex=1, sourceOutput='main' Changes: - resolveSmartParameters(): branch now sets sourceIndex, not sourceOutput - Type definition comments updated to reflect correct mapping - All unit tests fixed to expect connections under 'main' with correct indices - All 141 tests passing with correct behavior This was caught by integration testing against real n8n API, not by unit tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -65,8 +65,8 @@ export interface AddConnectionOperation extends DiffOperation {
|
||||
sourceIndex?: number; // Default: 0
|
||||
targetIndex?: number; // Default: 0
|
||||
// Smart parameters for multi-output nodes (Phase 1 UX improvement)
|
||||
branch?: 'true' | 'false'; // For IF nodes: maps to sourceOutput
|
||||
case?: number; // For Switch nodes: maps to sourceIndex
|
||||
branch?: 'true' | 'false'; // For IF nodes: maps to sourceIndex (0=true, 1=false)
|
||||
case?: number; // For Switch/multi-output nodes: maps to sourceIndex
|
||||
}
|
||||
|
||||
export interface RemoveConnectionOperation extends DiffOperation {
|
||||
@@ -99,8 +99,8 @@ export interface RewireConnectionOperation extends DiffOperation {
|
||||
targetInput?: string; // Optional: which input type (default: 'main')
|
||||
sourceIndex?: number; // Optional: which source index (default: 0)
|
||||
// Smart parameters for multi-output nodes (Phase 1 UX improvement)
|
||||
branch?: 'true' | 'false'; // For IF nodes: maps to sourceOutput
|
||||
case?: number; // For Switch nodes: maps to sourceIndex
|
||||
branch?: 'true' | 'false'; // For IF nodes: maps to sourceIndex (0=true, 1=false)
|
||||
case?: number; // For Switch/multi-output nodes: maps to sourceIndex
|
||||
}
|
||||
|
||||
// Workflow Metadata Operations
|
||||
|
||||
Reference in New Issue
Block a user