header code injected here ghost

Create your own n8n custom node

Build a simple, reusable n8n custom node that fetches a cryptocurrency price from the Binance public API. This guide walks through the full flow: setting up a self-hosted n8n environment, preparing a custom nodes repository, building and deploying the node, and testing it in a workflow. The result is a lightweight node called B24 Crypto Manager that returns the current price for any symbol (for example, BTCUSDT or ETHUSDT) without authentication.

What you will build

The custom node will:

  • Use the Binance public endpoint to get the latest price for a given symbol.
  • Be packaged as a standard n8n node and deployed to the n8n custom folder inside the Docker container.
  • Support a configurable symbol parameter so the node can be used statically or dynamically in workflows.

Prerequisites

  • Git installed
  • Docker Desktop installed and running
  • An IDE (VS Code, WebStorm, etc.)
  • Basic familiarity with the terminal and n8n concepts

Step 1 — Install the n8n self-hosted AI starter kit

Use the n8n self-hosted AI starter kit as the base environment. Clone the starter kit repository, then run the provided Docker setup for your platform. On a typical Windows PC you’ll pick the CPU profile script provided in the README and run it in a terminal. Docker will pull images and create volumes. Depending on network and hardware this can take some time.

After installation, update the environment variables for compatibility and debug visibility:

  • Set NN_LOG_LEVEL (or equivalent) to debug
  • Enable runners: runners.enabled = true
  • Set enforce_file_permissions = false if permission issues appear

Rerun the Docker command after editing environment variables so the containers start with the new settings. Then open n8n at http://localhost:5678 and create the owner account when prompted.

Step 2 — Create the n8n custom folder inside the container

n8n looks for custom nodes in a custom directory under /home/node/.n8n. That folder does not exist by default, so create it inside the n8n container.

# list containers
docker ps

# open a shell inside the n8n container (replace n8n with your container name if different)
docker exec -it n8n /bin/sh

# inside the container
cd /home/node/.n8n
mkdir custom
pwd
# confirm: /home/node/.n8n/custom
exit

Step 3 — Set up the custom nodes project

Start from the n8n-nodes-starter repository, then rename the clone to follow community naming conventions if you plan to publish. For a private or internal project you still benefit from the starter template structure (credentials, nodes, tests, package.json).

# clone the starter and rename the folder
git clone https://github.com/n8n-io/n8n-nodes-starter.git n8n-nodes-b24-custom-nodes
cd n8n-nodes-b24-custom-nodes

Edit package.json:

  • Replace the placeholder GitHub account with your account
  • Update the package name (for publishing use the prefix n8n-nodes-) — here we use n8n-nodes-b24-custom-nodes
  • Add optional fields like homepage if desired

Step 4 — Install tooling and dependencies

Install the recommended build tools globally (pnpm and rimraf are commonly used for n8n node projects).

# install pnpm and rimraf globally
npm install -g pnpm
npm install -g rimraf

# inside your node project
pnpm install

Copy any helper markdown files, build scripts, and configuration you want to reuse. The starter project typically includes example nodes you can use as templates.

Step 5 — Build and deploy the custom nodes

Create a deploy script that:

  1. Runs pnpm run build
  2. Uses a temporary container to copy the generated dist files into /home/node/.n8n/custom
  3. Restarts the n8n container so the new nodes are detected

Example local workflow (conceptual):

pnpm run build

# copy the dist folder into the n8n container custom folder (example approach)
docker cp ./dist n8n:/home/node/.n8n/custom

# restart n8n
docker restart n8n

After deployment, open a shell in the container and verify the build files are present in /home/node/.n8n/custom.

Step 6 — Create the B24 Crypto Manager node

Use one of the example nodes as the starting point. Duplicate the example node folder, rename files and classes, then update the node configuration (properties and metadata).

Key changes to implement for this node:

  • Change the node name to B24 Crypto Manager and the folder/package references accordingly
  • Set the node group to input (or other group as appropriate)
  • Define a single resource/operation for get price
  • Add a symbol parameter (string) with a sensible default like BTCUSDT
  • Implement the execute logic to call Binance’s public API

Test the Binance API in the browser or with curl first:

curl "https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT"

Sample minimal TypeScript execute snippet (illustrative):

import { IExecuteFunctions } from 'n8n-core';
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';

export class B24CryptoManager implements INodeType {
  description: INodeTypeDescription = {
    displayName: 'B24 Crypto Manager',
    name: 'b24CryptoManager',
    icon: 'file:icon.svg',
    group: ['input'],
    version: 1,
    description: 'Get current crypto price from Binance',
    defaults: { name: 'B24 Crypto Manager' },
    inputs: ['main'],
    outputs: ['main'],
    properties: [
      {
        displayName: 'Symbol',
        name: 'symbol',
        type: 'string',
        default: 'BTCUSDT',
        description: 'Trading symbol, e.g. BTCUSDT',
      },
    ],
  };

  async execute(this: IExecuteFunctions): Promise {
    const symbol = this.getNodeParameter('symbol', 0) as string;
    const response = await this.helpers.request({
      method: 'GET',
      uri: `https://api.binance.com/api/v3/ticker/price?symbol=${symbol}`,
      json: true,
    });
    return this.prepareOutputData([{ json: response }]);
  }
}

This snippet shows the core idea: read the symbol parameter, call Binance's public endpoint, and return the JSON response as the node's output.

Step 7 — Test the node in a workflow

  1. Create a new workflow in n8n and add a Manual Trigger.
  2. Add the B24 Crypto Manager node, configure the symbol or leave the default, and execute the node to fetch the price.
  3. Use a Set node before the custom node to test dynamic input. Add a field called symbol and set its value to ETHUSDT.
  4. In the custom node, remove any placeholder and bind the symbol parameter to the previous node's output using an expression like {{$node["Set"].json["symbol"]}} or the expression builder UI.
  5. Execute the workflow and inspect the execution data in the Execution tab to verify results.

Publishing and naming conventions

If you plan to publish the node as a community package, follow the naming convention n8n-nodes-* for the repository and package name. Keep the packages/nodes entry in package.json up to date so n8n will register your node.

Next steps and enhancements

  • Add authentication if you switch to APIs that require API keys or OAuth.
  • Expand node functionality: add operations for historical data, candlesticks, and error handling.
  • Write tests and documentation for the node, and include an SVG icon with a transparent background for polish.
  • Automate deployment with CI so builds are copied into the n8n container on push.

Creating a custom n8n node is a practical way to integrate any external API into workflows. Start small with a stateless public endpoint like Binance's price ticker, then iterate to add authentication, caching, or additional endpoints as your use cases grow.

Free Stuff!

Check out this really cool thing

Click me here

Read more

footer code injected here ghost