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:
czlonkowski
2025-10-04 18:45:58 +02:00
parent 1db9ecf33f
commit ecf0d50a63
2 changed files with 36 additions and 9 deletions

View File

@@ -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
);