fix: resolve empty settings validation error in workflow updates (#431) (#432)

This commit is contained in:
Romuald Członkowski
2025-11-20 19:19:08 +01:00
committed by GitHub
parent 47d9f55dc5
commit fc37907348
7 changed files with 130 additions and 15 deletions

View File

@@ -861,10 +861,14 @@ export class WorkflowDiffEngine {
// Metadata operation appliers
private applyUpdateSettings(workflow: Workflow, operation: UpdateSettingsOperation): void {
if (!workflow.settings) {
workflow.settings = {};
// Only create/update settings if operation provides actual properties
// This prevents creating empty settings objects that would be rejected by n8n API
if (operation.settings && Object.keys(operation.settings).length > 0) {
if (!workflow.settings) {
workflow.settings = {};
}
Object.assign(workflow.settings, operation.settings);
}
Object.assign(workflow.settings, operation.settings);
}
private applyUpdateName(workflow: Workflow, operation: UpdateNameOperation): void {