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
This commit is contained in:
Omar Ajoue 2023-02-20 12:22:27 +01:00 committed by GitHub
parent db702932f3
commit 75a094a8c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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