Hide custom node per environment

Describe the problem/error/question

Hi everyone,

I’m working on some new custom nodes for our self-hosted n8n cluster, but I wish to have it visible only for environments that are not production. I could use environment variables to control their visibility, but I’m not finding how to implement this in the context of custom nodes - it seems like NODES_EXCLUDED doesn’t work with custom nodes, is this correct?

In other words, consider I have a “staging” and a “production” environment: How can I have the same container image build with custom nodes such that “staging” shows the custom node I’m working on, but “production” doesn’t?

Thanks!

What is the error message (if any)?

No particular error.

Please share your workflow

No particular workflow, this is for custom nodes.

Share the output returned by the last node

No output, no particular workflow.

Information on your n8n setup

  • n8n version: 1.9.5
  • Database (default: SQLite): PostgreSQL 15
  • n8n EXECUTIONS_PROCESS setting (default: own, main): (None set, probably default)
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker.
  • Operating system: Alpine Linux.

Separate Instances by Environment
The most recommended and effective solution is to deploy two different containers:
Staging: with custom nodes installed (copied to /custom-nodes) and NODES_EXCLUDE as needed.
Production: clean image without custom nodes and with NODES_EXCLUDE=[“unwanted.node”].
This separation creates clearly differentiated environments without mixing unnecessary nodes.

Or you can also use NODES_INCLUDE strategically.
Although you control the base nodes, custom nodes will still be visible if they are in the extensions path.
Only useful if your goal is limited to filtering base nodes, but not removing custom nodes.

Thanks @Erick_Torres ! I’d like to avoid using per-environment builds though, as this doesn’t scale well for our team and brings maintenance problems, we currently have 2 production environments and will start having more, and in the end each build ends up being a different package which decreases the reliability we can have on the system, so we can’t just keep creating one build per environment.

Does NODES_EXCLUDE work for custom nodes though? I heard it only works for base nodes, but I might be wrong.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.