From 75a094a8c03afc40b7872cd2115d82e69455286e Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Mon, 20 Feb 2023 12:22:27 +0100 Subject: [PATCH] fix: Fixes an issue when saving an active workflow without triggers would cause n8n to be stuck (#5513) fix: Allow saving and editing when an active workflow is saved without triggers --- packages/cli/src/workflows/workflows.services.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/workflows/workflows.services.ts b/packages/cli/src/workflows/workflows.services.ts index 601f34807..1dd4c1b1c 100644 --- a/packages/cli/src/workflows/workflows.services.ts +++ b/packages/cli/src/workflows/workflows.services.ts @@ -332,7 +332,11 @@ export class WorkflowsService { ); } catch (error) { // If workflow could not be activated set it again to inactive - await Db.collections.Workflow.update(workflowId, { active: false }); + // and revert the versionId change so UI remains consistent + await Db.collections.Workflow.update(workflowId, { + active: false, + versionId: shared.workflow.versionId, + }); // Also set it in the returned data updatedWorkflow.active = false;