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?
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.