Skip to content

Commit 63cf9af

Browse files
authored
fix: Detect if n8n instance is staging or production for community nodes (#15918)
1 parent 4b11268 commit 63cf9af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/cli/src/services/community-node-types.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CommunityNodeType } from '@n8n/api-types';
2-
import { Logger } from '@n8n/backend-common';
2+
import { Logger, inProduction } from '@n8n/backend-common';
33
import { GlobalConfig } from '@n8n/config';
44
import { Service } from '@n8n/di';
55
import { ensureError, type INodeTypeDescription } from 'n8n-workflow';
@@ -46,7 +46,9 @@ export class CommunityNodeTypesService {
4646
this.globalConfig.nodes.communityPackages.enabled &&
4747
this.globalConfig.nodes.communityPackages.verifiedEnabled
4848
) {
49-
const environment = this.globalConfig.license.tenantId === 1 ? 'production' : 'staging';
49+
// Cloud sets ENVIRONMENT to 'production' or 'staging' depending on the environment
50+
const environment =
51+
inProduction || process.env.ENVIRONMENT === 'production' ? 'production' : 'staging';
5052
data = await getCommunityNodeTypes(environment);
5153
}
5254

0 commit comments

Comments
 (0)