custom-node-template

0.2.4 • Public • Published

Custom Node Template

This repository contains custom nodes for n8n based on the n8n-nodes-starter template. It includes example nodes that you can modify or replace with your own custom nodes.

Prerequisites

You need the following installed on your development machine:

  • git
  • Node.js (minimum version 18)
  • npm or pnpm package manager
  • A local n8n server installation

Getting Started

  1. Clone this repository:

    git clone https://github.com/your-username/custom-node-template.git
    
  2. Install dependencies:

    cd custom-node-template
    npm install
    
  3. Browse the examples in /nodes and /credentials. Modify the examples, or replace them with your own nodes.

  4. Update the package.json to match your details.

  5. Build the custom nodes:

    npm run build
    
  6. Link the custom nodes to your local n8n server using the provided script:

    ./scripts/link-to-local-server.sh /path/to/your/local-n8n-server
    
  7. Start your n8n server and you should see the custom nodes available.

Scripts

This repository includes the following utility scripts in the scripts directory:

link-to-local-server.sh

Links the custom nodes to a local n8n server installation.

Usage:

./scripts/link-to-local-server.sh [path-to-local-n8n-server]

Parameters:

  • path-to-local-n8n-server: Optional. Path to the local n8n server directory. If not provided, the script will try to use a default path.

What it does:

  1. Builds the custom nodes package
  2. Updates the n8n server's .env file to include the full path to the custom nodes in the N8N_CUSTOM_EXTENSIONS variable
  3. Ensures community nodes are enabled

No symlinks are created - the approach relies solely on the environment variable configuration.

unlink-from-local-server.sh

Removes the custom nodes from a local n8n server installation.

Usage:

./scripts/unlink-from-local-server.sh [path-to-local-n8n-server]

Parameters:

  • path-to-local-n8n-server: Optional. Path to the local n8n server directory. If not provided, the script will try to use a default path.

What it does:

  1. Removes any symlinks that might have been created in previous versions
  2. Updates the n8n server's .env file to remove the custom nodes from the N8N_CUSTOM_EXTENSIONS variable
  3. Provides guidance on fully removing the nodes from the n8n server

Development Workflow

  1. Modify or create nodes in the nodes directory.
  2. Run npm run build to compile your changes.
  3. Use the link-to-local-server script to update your local n8n server.
  4. Restart your n8n server to see the changes.
  5. When you're done with development or want to remove the nodes, use the unlink-from-local-server script.

Troubleshooting

If your custom nodes aren't appearing in n8n:

  1. Ensure the N8N_CUSTOM_EXTENSIONS path in the server's .env file is correct
  2. Verify that N8N_COMMUNITY_NODES_ENABLED=true is set in the server's .env file
  3. Make sure you've built the nodes with npm run build
  4. Restart the n8n server after any changes

License

MIT

Package Sidebar

Install

npm i custom-node-template

Weekly Downloads

3

Version

0.2.4

License

MIT

Unpacked Size

66.7 kB

Total Files

23

Last publish

Collaborators

  • tarunjain15