From 63cf9afe6501d5b23443551911311536a9fb9538 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 4 Jun 2025 17:41:00 +0100 Subject: [PATCH] fix: Detect if n8n instance is staging or production for community nodes (#15918) --- packages/cli/src/services/community-node-types.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/services/community-node-types.service.ts b/packages/cli/src/services/community-node-types.service.ts index 576871c5c9..c0e1703583 100644 --- a/packages/cli/src/services/community-node-types.service.ts +++ b/packages/cli/src/services/community-node-types.service.ts @@ -1,5 +1,5 @@ import type { CommunityNodeType } from '@n8n/api-types'; -import { Logger } from '@n8n/backend-common'; +import { Logger, inProduction } from '@n8n/backend-common'; import { GlobalConfig } from '@n8n/config'; import { Service } from '@n8n/di'; import { ensureError, type INodeTypeDescription } from 'n8n-workflow'; @@ -46,7 +46,9 @@ export class CommunityNodeTypesService { this.globalConfig.nodes.communityPackages.enabled && this.globalConfig.nodes.communityPackages.verifiedEnabled ) { - const environment = this.globalConfig.license.tenantId === 1 ? 'production' : 'staging'; + // Cloud sets ENVIRONMENT to 'production' or 'staging' depending on the environment + const environment = + inProduction || process.env.ENVIRONMENT === 'production' ? 'production' : 'staging'; data = await getCommunityNodeTypes(environment); }