From 922880f93d109391cb50db2f6f94b0be153fe8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Sat, 10 Jul 2021 23:23:19 +0200 Subject: [PATCH] :zap: Fix workflow ID type on download (#1956) --- packages/editor-ui/src/Interface.ts | 4 ++-- packages/editor-ui/src/components/MainSidebar.vue | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 2fa997a545..cc3f89b8c6 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -202,7 +202,7 @@ export interface IVariableSelectorOption { // Simple version of n8n-workflow.Workflow export interface IWorkflowData { - id?: string; + id?: string | number; name?: string; active?: boolean; nodes: INode[]; @@ -212,7 +212,7 @@ export interface IWorkflowData { } export interface IWorkflowDataUpdate { - id?: string; + id?: string | number; name?: string; nodes?: INode[]; connections?: IConnections; diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 09faab9bc7..9a615abccc 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -408,6 +408,9 @@ export default mixins( const workflowData = await this.getWorkflowDataToSave(); const {tags, ...data} = workflowData; + if (data.id && typeof data.id === 'string') { + data.id = parseInt(data.id, 10); + } const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json;charset=utf-8', });