mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 13:33:11 +00:00
fix: resolve Phase 4 test failures
Root cause analysis:
1. n8n API requires settings field in ALL update requests (per OpenAPI spec)
2. Previous cleanWorkflowForUpdate always set settings={} which prevented updates
Fixes:
1. Add settings field to "Update Connections" test
2. Update cleanWorkflowForUpdate to filter settings instead of overwriting:
- If settings provided: filter to OpenAPI spec whitelisted properties
- If no settings: use empty object {} for backwards compatibility
- Maintains fix for Issue #248 by filtering out unsafe properties like callerPolicy
This allows settings updates while preventing version-specific API errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -166,16 +166,17 @@ describe('Integration: handleUpdateWorkflow', () => {
|
||||
if (!created.id) throw new Error('Workflow ID is missing');
|
||||
context.trackWorkflow(created.id);
|
||||
|
||||
// Fetch current workflow to get nodes (required by n8n API)
|
||||
// Fetch current workflow to get required fields (n8n API requirement)
|
||||
const current = await client.getWorkflow(created.id);
|
||||
|
||||
// Remove connections (disconnect nodes)
|
||||
const response = await handleUpdateWorkflow(
|
||||
{
|
||||
id: created.id,
|
||||
name: current.name, // Required by n8n API
|
||||
nodes: current.nodes, // Required by n8n API
|
||||
connections: {}
|
||||
name: current.name, // Required by n8n API
|
||||
nodes: current.nodes, // Required by n8n API
|
||||
connections: {},
|
||||
settings: current.settings // Required by n8n API
|
||||
},
|
||||
mcpContext
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user