Skip to content

Commit

Permalink
Merge pull request #3300 from n8n-io/n8n-3623-onboarding-threshold-lo…
Browse files Browse the repository at this point in the history
…gic-fix

N8n 3623 onboarding threshold logic fix
  • Loading branch information
mutdmour authored May 16, 2022
2 parents cb504fe + bbfeb44 commit 9b58d01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/WorkflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ export async function getSharedWorkflowIds(user: User): Promise<number[]> {
*/
export async function isBelowOnboardingThreshold(user: User): Promise<boolean> {
let belowThreshold = true;
const skippedTypes = ['n8n-nodes-base.start', 'n8n-nodes-base.stickyNote']

const workflowOwnerRole = await Db.collections.Role.findOne({
name: 'owner',
Expand All @@ -626,7 +627,7 @@ export async function isBelowOnboardingThreshold(user: User): Promise<boolean> {
// 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;
}
Expand Down

0 comments on commit 9b58d01

Please sign in to comment.