diff --git a/docs/create-node.md b/docs/create-node.md index c66de5094d..f4dad6883a 100644 --- a/docs/create-node.md +++ b/docs/create-node.md @@ -23,6 +23,79 @@ To simplify the development process we created a very basic CLI which creates bo 1. Restart n8n and refresh the window that the new node gets displayed +## Create own custom n8n-nodes-module + +If you want to create multiple custom nodes which are either: + + - Only for yourself/your company + - Are only useful for a small number of people + - Require many or large dependencies + +It is best to create your own `n8n-nodes-module` which can be installed separately. +That is a simple npm package that contains the nodes and is set up in a way +that n8n can automatically find and load them on startup. + +When creating such a module the following rules have to be followed that n8n +can automatically find the nodes in the module: + + - The name of the module has to start with `n8n-nodes-` + - The `package.json` file has to contain a key `n8n` with the paths to nodes and credentials + - The module has to be installed alongside n8n + +An example starter module which contains one node and credentials and implements +the above can be found here: + +[https://github.com/n8n-io/n8n-nodes-starter](https://github.com/n8n-io/n8n-nodes-starter) + + +### Setup to use n8n-nodes-module + +To use a custom `n8n-nodes-module` it simply has to be installed alongside n8n. +For example like this: + +```bash +# Create folder for n8n installation +mkdir my-n8n +cd my-n8n + +# Install n8n +npm install n8n + +# Install custom nodes module +npm install n8n-nodes-my-custom-nodes + +# Start n8n +n8n +``` + + +### Development/Testing of custom n8n-nodes-module + +Works actually the same as for any other npm module. + +Execute in the folder which contains the code of the custom `n8n-nodes-module` +which should be loaded with n8n: + +```bash +# Build the code +npm run build + +# "Publish" the package locally +npm link +``` + +Then in the folder in which n8n is installed: + +```bash +# "Install" the above locally published module +npm link n8n-nodes-my-custom-nodes + +# Start n8n +n8n +``` + + + ## Node Development Guidelines