3.3 KiB
n8n-nodes-starter
This repo contains example nodes to help you get started building your own custom integrations for n8n. It includes the node linter and other dependencies.
To make your custom node available to the community, you must create it as an npm package, and submit it to the npm registry.
If you would like your node to be available on n8n cloud you can also submit your node for verification.
Prerequisites
You need the following installed on your development machine:
- Docker and Docker Compose
- NodeJS and npm
Once you have cloned the repository:
- Execute:
npm i
To run the local n8n instance:
- Execute:
Now, n8n will run on http://localhost:5678.docker compose up -d
When changes are made to the custom node code and you want to test it on the local instance:
-
There is a script file called deploy-node.sh. Once executed, it will build the custom node code and deploy the Docker container. This file requires a few changes depending on the name that Docker gives to the container and the volumes:
-
On line 24 of the script, you will see this line:
TARGET_DIR="/var/lib/docker/volumes/n8n-self-hosted_n8n_data/_data/custom/$PACKAGE_NAME" -
Depending on the container volume name, "n8n-self-hosted_n8n_data" needs to be changed. To check the volume's name, execute:
docker volume ls -
On lines 56 and 59, "n8n-self-hosted-n8n-1" must be changed to match the name of the container for the n8n instance.
-
Once these changes are made, execute the script:
./deploy-node.sh
-
Using this starter
These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the documentation.
- Generate a new repository from this template repository.
- Clone your new repo:
git clone https://github.com/<your organization>/<your-repo-name>.git - Run
npm ito install dependencies. - Open the project in your editor.
- Browse the examples in
/nodesand/credentials. Modify the examples, or replace them with your own nodes. - Update the
package.jsonto match your details. - Run
npm run lintto check for errors ornpm run lintfixto automatically fix errors when possible. - Test your node locally. Refer to Run your node locally for guidance.
- Replace this README with documentation for your node. Use the README_TEMPLATE to get started.
- Update the LICENSE file to use your details.
- Publish your package to npm.
More information
Refer to our documentation on creating nodes for detailed information on building your own nodes.
