From bbfeb44e9e1c11972280f52086f961a7edd1bf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20Filipovi=C4=87?= Date: Mon, 16 May 2022 14:03:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixing=20the=20onboarding=20thre?= =?UTF-8?q?shold=20logic=20so=20sticky=20notes=20are=20skipped=20when=20co?= =?UTF-8?q?unting=20nodes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/src/WorkflowHelpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/WorkflowHelpers.ts b/packages/cli/src/WorkflowHelpers.ts index 87457439a4190..496f80659e1b3 100644 --- a/packages/cli/src/WorkflowHelpers.ts +++ b/packages/cli/src/WorkflowHelpers.ts @@ -604,6 +604,7 @@ export async function getSharedWorkflowIds(user: User): Promise { */ export async function isBelowOnboardingThreshold(user: User): Promise { let belowThreshold = true; + const skippedTypes = ['n8n-nodes-base.start', 'n8n-nodes-base.stickyNote'] const workflowOwnerRole = await Db.collections.Role.findOne({ name: 'owner', @@ -626,7 +627,7 @@ export async function isBelowOnboardingThreshold(user: User): Promise { // valid workflow: 2+ nodes without start node const validWorkflowCount = workflows.reduce((counter, workflow) => { if (counter <= 2 && workflow.nodes.length > 2) { - const nodes = workflow.nodes.filter((node) => node.type !== 'n8n-nodes-base.start'); + const nodes = workflow.nodes.filter((node) => !skippedTypes.includes(node.type)); if (nodes.length >= 2) { return counter + 1; }