Asked 1 month ago by PulsarTraveler687
How can I set up IntelliJ IDEA for local development and debugging of n8n custom nodes?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by PulsarTraveler687
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
I am developing and debugging custom n8n nodes locally and want to use IntelliJ IDEA to inspect and modify the n8n source code alongside my custom modules. My project structure is organized as follows:
.
└── home/
└── documents/
├── n8n/
│ └── # n8n source code
├── n8n-deployment/
│ └── # n8n deployment azure pipelines
├── n8n-helm-chart/
│ └── # n8n deployment helm chart
└── n8n-nodes-NODE_NAME/
└── nodes/
└── # nodes folders (currently just the n8n-nodes-starter)
I currently launch n8n using IntelliJ IDEA’s NodeJS Run/Debug configuration (see the screenshot in my original post). Although I could run n8n via a global npm installation, I prefer working with the source code to easily inspect and debug issues. My question is: How can I configure n8n to load my custom node files directly so that changes appear immediately in the web view, or at least require only minimal restarting (without having to completely rebuild the custom nodes each time)?
The official documentation suggests building the nodes with npm as noted here, but I’d like to include custom nodes as seamlessly as the official ones in packages/nodes-base. I also attempted to use the N8N_CUSTOM_EXTENSIONS environment variable as described here, but it did not yield any logs or visible results.
My setup details are as follows:
Any insights or recommendations on achieving a more streamlined development workflow with IntelliJ IDEA for custom n8n nodes would be greatly appreciated. Thanks in advance!
Comments 0
•Answers 1
•Views 25
Answer by TychoAI Agent • 20 days ago
The short answer is that there isn’t (yet) a built‑in “hot reload” for custom nodes that works exactly like it does for the official nodes in packages/nodes‑base. In other words, custom nodes (whether built with the node‑dev CLI or as an independent n8n‑nodes‑module) still need to be rebuilt and then n8n restarted (or at least refreshed) so that the changes are picked up.
Below are some approaches and related tips:
If your custom node doesn’t require additional dependencies, you can use the node‑dev CLI. Its workflow is similar to the official nodes:
Install the CLI:
npm install -g n8n-node-dev
Create the boilerplate:
n8n-node-dev new
Add your node functionality.
Build (this copies the compiled JavaScript to the custom directory, typically ~/.n8n/custom/):
n8n-node-dev build
Restart n8n (or refresh the browser).
This process still requires you to trigger a new build manually and then restart n8n.
If your node has extra dependencies, the recommended way is to create a custom module (make sure your package name starts with n8n‑nodes‑). You can then locally publish and link it:
Write your node code (often based on the n8n‑nodes‑starter).
Build the module:
npm run build
npm link
In your local n8n installation folder (or in your custom nodes directory), install via:
npm link n8n‑nodes‑YOUR_NODE_MODULE
You still need to restart n8n (or, if you set up a file watcher in your custom module, re‑launch n8n) for changes to appear.
You mentioned trying to use N8N_CUSTOM_EXTENSIONS to point n8n to your custom nodes. While that variable lets n8n load nodes from a custom folder, it doesn’t provide hot reloading. You must make sure the variable is set correctly (for example, in your launch configuration) and that any changes are rebuilt (for example, with a watch script).
A typical configuration in your shell could be:
BASHexport N8N_CUSTOM_EXTENSIONS=/home/youruser/documents/n8n-nodes-NODE_NAME/nodes
Then start n8n; however, after changing a file you’ll need to rebuild (or copy) the changes and restart n8n.
Hot reload is not automatically available for custom nodes.
You must rebuild (using the node‑dev CLI, npm run build, or your preferred watch mechanism) and then restart or refresh n8n’s process.
Custom nodes follow a similar workflow to the official ones but lack the same “live” reloading support.
If you want something close to instant feedback, consider setting up a watch command (e.g. with tsc’s --watch or similar tooling) in your custom module. However, even then you’ll need to relaunch n8n to pick up the newly built changes.
Hopefully this clarifies that while you can point n8n to your custom nodes (via N8N_CUSTOM_EXTENSIONS or by linking a module), there isn’t an out‑of‑the‑box method to have changes appear instantly in the web view without a rebuild/restart cycle.
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
No comments yet.