mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
refactor: use modern executionOrder v1 as default instead of legacy v0
Changed minimal default settings from executionOrder: 'v0' (legacy) to executionOrder: 'v1' (modern default) when providing fallback settings. This ensures workflows use the modern execution order by default, which provides better performance and more predictable execution behavior. Updated all affected tests to expect 'v1' instead of 'v0'. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -198,13 +198,13 @@ export function cleanWorkflowForUpdate(workflow: Workflow): Partial<Workflow> {
|
|||||||
if (Object.keys(filteredSettings).length > 0) {
|
if (Object.keys(filteredSettings).length > 0) {
|
||||||
cleanedWorkflow.settings = filteredSettings;
|
cleanedWorkflow.settings = filteredSettings;
|
||||||
} else {
|
} else {
|
||||||
// Provide minimal valid settings (executionOrder is always accepted)
|
// Provide minimal valid settings (executionOrder v1 is the modern default)
|
||||||
cleanedWorkflow.settings = { executionOrder: 'v0' as const };
|
cleanedWorkflow.settings = { executionOrder: 'v1' as const };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No settings provided - include minimal default settings
|
// No settings provided - include minimal default settings
|
||||||
// n8n API requires settings in workflow updates
|
// n8n API requires settings in workflow updates (v1 is the modern default)
|
||||||
cleanedWorkflow.settings = { executionOrder: 'v0' as const };
|
cleanedWorkflow.settings = { executionOrder: 'v1' as const };
|
||||||
}
|
}
|
||||||
|
|
||||||
return cleanedWorkflow;
|
return cleanedWorkflow;
|
||||||
|
|||||||
@@ -391,8 +391,8 @@ describe('n8n-validation', () => {
|
|||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
const cleaned = cleanWorkflowForUpdate(workflow);
|
const cleaned = cleanWorkflowForUpdate(workflow);
|
||||||
// n8n API requires settings to be present, so we provide minimal defaults
|
// n8n API requires settings to be present, so we provide minimal defaults (v1 is modern default)
|
||||||
expect(cleaned.settings).toEqual({ executionOrder: 'v0' });
|
expect(cleaned.settings).toEqual({ executionOrder: 'v1' });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter settings to safe properties to prevent API errors (Issue #248 - final fix)', () => {
|
it('should filter settings to safe properties to prevent API errors (Issue #248 - final fix)', () => {
|
||||||
@@ -484,8 +484,8 @@ describe('n8n-validation', () => {
|
|||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
const cleaned = cleanWorkflowForUpdate(workflow);
|
const cleaned = cleanWorkflowForUpdate(workflow);
|
||||||
// n8n API requires settings, so we provide minimal defaults
|
// n8n API requires settings, so we provide minimal defaults (v1 is modern default)
|
||||||
expect(cleaned.settings).toEqual({ executionOrder: 'v0' });
|
expect(cleaned.settings).toEqual({ executionOrder: 'v1' });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should provide minimal settings when only non-whitelisted properties exist (Issue #431)', () => {
|
it('should provide minimal settings when only non-whitelisted properties exist (Issue #431)', () => {
|
||||||
@@ -502,9 +502,9 @@ describe('n8n-validation', () => {
|
|||||||
|
|
||||||
const cleaned = cleanWorkflowForUpdate(workflow);
|
const cleaned = cleanWorkflowForUpdate(workflow);
|
||||||
// All properties were filtered out, but n8n API requires settings
|
// All properties were filtered out, but n8n API requires settings
|
||||||
// so we provide minimal defaults to avoid both "additional properties"
|
// so we provide minimal defaults (v1 is modern default) to avoid both
|
||||||
// and "required property" API errors
|
// "additional properties" and "required property" API errors
|
||||||
expect(cleaned.settings).toEqual({ executionOrder: 'v0' });
|
expect(cleaned.settings).toEqual({ executionOrder: 'v1' });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should preserve whitelisted settings when mixed with non-whitelisted (Issue #431)', () => {
|
it('should preserve whitelisted settings when mixed with non-whitelisted (Issue #431)', () => {
|
||||||
@@ -1406,8 +1406,8 @@ describe('n8n-validation', () => {
|
|||||||
expect(forUpdate).not.toHaveProperty('active');
|
expect(forUpdate).not.toHaveProperty('active');
|
||||||
expect(forUpdate).not.toHaveProperty('tags');
|
expect(forUpdate).not.toHaveProperty('tags');
|
||||||
expect(forUpdate).not.toHaveProperty('meta');
|
expect(forUpdate).not.toHaveProperty('meta');
|
||||||
// n8n API requires settings in updates, so minimal defaults are provided (Issue #431)
|
// n8n API requires settings in updates, so minimal defaults (v1) are provided (Issue #431)
|
||||||
expect(forUpdate.settings).toEqual({ executionOrder: 'v0' });
|
expect(forUpdate.settings).toEqual({ executionOrder: 'v1' });
|
||||||
expect(validateWorkflowStructure(forUpdate)).toEqual([]);
|
expect(validateWorkflowStructure(forUpdate)).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user