Creating a community node for n8n allows you to extend its functionality by integrating with additional services or APIs. Here's a step-by-step guide to help you build and share your own n8n community node:
Set Up Your Development Environment:
Install Prerequisites: Ensure you have git, Node.js (version 18 or later), and pnpm installed on your machine.
Install n8n Globally: Use the following command to install n8n:
Install Dependencies: Navigate to the cloned directory and install the necessary packages:
bash
cd n8n-nodes-starter
pnpm install
Explore Example Nodes: The /nodes and /credentials directories contain sample nodes and credentials to guide your development.
Develop Your Custom Node:
Modify or Create Nodes: Edit the existing examples or create new files in the /nodes directory to define your node's functionality.
Update package.json: Ensure the package.json file reflects your node's details, including name, description, and author information.
Lint and Test: Run the linter to check for code quality and test your node locally to ensure it functions as expected.
Publish Your Node to the npm Registry:
Prepare for Publishing: Ensure your node meets n8n's community node standards, such as naming conventions and including the n8n-community-node-package keyword in your package.json.
Publish: Use the following command to publish your package:
bash
pnpm publish
Share with the Community: Once published, your node becomes available for others to install and use within their n8n instances.