NPM for N8N Nodes

v1.0.0

Build, structure, and publish npm packages for n8n custom community nodes. Use this skill whenever the user wants to create a custom n8n node, publish a node...

0· 115·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for encryptshawn/npm-n8n-nodes.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "NPM for N8N Nodes" (encryptshawn/npm-n8n-nodes) from ClawHub.
Skill page: https://clawhub.ai/encryptshawn/npm-n8n-nodes
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install npm-n8n-nodes

ClawHub CLI

Package manager switcher

npx clawhub@latest install npm-n8n-nodes
Security Scan
Capability signals
CryptoRequires walletRequires OAuth token
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description match the included files: a full set of templates, examples, and publishing guidance for n8n node packages. There are no unrelated binaries, credentials, or installs requested — everything is appropriate for scaffolding, testing, and publishing n8n nodes.
Instruction Scope
SKILL.md and reference docs only instruct on node structure, local testing (npm link, Docker mounting ~/.n8n), building, linting, and publishing to npm/GitHub Actions. These are in-scope for the stated purpose. Two minor notes: (1) debugging snippets suggest logging credential objects (console.log(JSON.stringify(credentials,...)) — useful for debugging but can leak secrets to logs if left in published code; (2) instructions show mounting or accessing ~/.n8n for local testing which is expected but grants access to local n8n data during development and should be used carefully.
Install Mechanism
No install spec — instruction-only skill. Nothing is downloaded or written to disk by the skill itself, which is the lowest-risk install mechanism.
Credentials
The skill does not request environment variables or credentials itself. It documents standard publishing workflows that use NPM_TOKEN or GitHub Actions secrets for npm publishing/provenance — those are appropriate and proportional to the described publish process.
Persistence & Privilege
always:false and user-invocable:true. The skill does not request persistent agent privileges nor instruct modifying other skills or global agent settings.
Assessment
This is a coherent, documentation-only skill for building and publishing n8n nodes. It's safe to read and use, but follow best practices: remove any console.log debugging that prints credentials before publishing, keep your NPM/GitHub tokens stored only in repository secrets (or use npm Trusted Publishers), avoid mounting or exposing your real ~/.n8n directory on untrusted machines, ensure dist/ is built in CI before publishing, and review the package contents (package.json, n8n.nodes/credentials entries, compiled dist/) before publishing to npm. If you want extra assurance, inspect the code you compile (dist/) and the GitHub Actions workflow that will publish the package.

Like a lobster shell, security has layers — review code before you run it.

latestvk979p0dgfk4ecz75849sq497cd848qc1
115downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

n8n Custom Node — NPM Package Skill

Core Mental Model

Every n8n node follows one pattern:

getInputData()  →  loop items  →  do stuff  →  push to returnData  →  return [returnData]

Two file types do all the work:

  • Node file (nodes/MyNode/MyNode.node.ts) — UI fields + execute logic
  • Credential file (credentials/MyApi.credentials.ts) — auth definition

Everything else is project plumbing.


Project Structure

n8n-nodes-yourservice/
├── package.json              ← CRITICAL: must have n8n section + correct keyword
├── tsconfig.json
├── .eslintrc.js
├── gulpfile.js               ← copies SVG icons to dist/
├── index.js                  ← optional explicit entry point
├── nodes/
│   └── YourService/
│       ├── YourService.node.ts
│       ├── YourService.node.json   ← optional: codex metadata
│       └── yourservice.svg
├── credentials/
│   └── YourServiceApi.credentials.ts
└── dist/                     ← compiled output (never edit manually)

What to Read and When

This skill has focused reference files. Load only what you need:

Node Types (pick one)

If you need...Read
Standard request/response node (most common)references/examples/nodes/programmatic-node.md
Simple REST API, no complex logicreferences/examples/nodes/declarative-node.md
Trigger that polls an API on a schedulereferences/examples/nodes/trigger-node.md
Webhook that receives HTTP callsreferences/examples/nodes/webhook-node.md

Credentials (pick what matches your auth)

Auth typeRead
API key, Bearer token, custom header, query keyreferences/examples/credentials/api-key-patterns.md
OAuth2 (user login or machine-to-machine)references/examples/credentials/oauth2-patterns.md
Basic auth, multi-field, manual injectreferences/examples/credentials/other-patterns.md

Concepts (load when the topic comes up)

TopicRead
UI field types, displayOptions, collections, fixedCollectionreferences/concepts/node-properties.md
HTTP requests, bodies, headers, responses, binaryreferences/concepts/http-and-binary.md
Error types, continueOnFail, NodeApiError vs NodeOperationErrorreferences/concepts/error-handling.md
pairedItem, data flow, why item tracking mattersreferences/concepts/data-and-pairing.md
Node versioning, updating without breaking workflowsreferences/concepts/node-versioning.md

Project Setup & Publishing

TopicRead
package.json, tsconfig, gulpfile, eslintrc, index.jsreferences/templates/project-files.md
Local testing, npm link, n8n startreferences/templates/local-testing.md
npm publish, GitHub Actions, provenancereferences/templates/publishing.md
Common gotchas and silent failuresreferences/gotchas/common-gotchas.md

Quick-Start Pattern (copy this first)

// nodes/YourService/YourService.node.ts
import {
  IExecuteFunctions,
  INodeExecutionData,
  INodeType,
  INodeTypeDescription,
  NodeOperationError,
} from 'n8n-workflow';

export class YourService implements INodeType {
  description: INodeTypeDescription = {
    displayName: 'Your Service',
    name: 'yourService',
    icon: 'file:yourservice.svg',
    group: ['transform'],
    version: 1,
    description: 'Interact with Your Service API',
    defaults: { name: 'Your Service' },
    inputs: ['main'],
    outputs: ['main'],
    credentials: [{ name: 'yourServiceApi', required: true }],
    properties: [
      {
        displayName: 'Endpoint',
        name: 'endpoint',
        type: 'string',
        default: '/users',
        required: true,
      },
    ],
  };

  async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
    const items = this.getInputData();
    const returnData: INodeExecutionData[] = [];
    const credentials = await this.getCredentials('yourServiceApi');

    for (let i = 0; i < items.length; i++) {
      try {
        const endpoint = this.getNodeParameter('endpoint', i) as string;

        const response = await this.helpers.httpRequest({
          method: 'GET',
          url: `https://api.yourservice.com${endpoint}`,
          headers: {
            Authorization: `Bearer ${credentials.apiToken}`,
          },
        });

        returnData.push({ json: response, pairedItem: { item: i } });

      } catch (error) {
        if (this.continueOnFail()) {
          returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
          continue;
        }
        throw new NodeOperationError(this.getNode(), error, { itemIndex: i });
      }
    }

    return [returnData];
  }
}

Essential APIs Cheat Sheet

// Input
const items = this.getInputData();

// Parameters
this.getNodeParameter('name', i) as string
this.getNodeParameter('count', i, 0) as number
this.getNodeParameter('options', i, {}) as IDataObject

// Credentials
const creds = await this.getCredentials('myCredentialName');

// HTTP
await this.helpers.httpRequest({ method, url, headers, qs, body })

// Error handling
this.continueOnFail()
throw new NodeOperationError(this.getNode(), message, { itemIndex: i })
throw new NodeApiError(this.getNode(), error)   // for API-level HTTP errors

// Output
returnData.push({ json: data, pairedItem: { item: i } })
return [returnData];

Pre-Publish Checklist

  • keywords in package.json includes "n8n-community-node-package"
  • n8n.nodes and n8n.credentials arrays point to dist/ .js paths
  • Node name is camelCase; displayName is human-readable
  • Credential name exactly matches string passed to getCredentials('...')
  • Every returnData.push() includes pairedItem: { item: i }
  • continueOnFail() is handled in all try/catch blocks
  • SVG icon exists in nodes/YourService/ and referenced as 'file:yourservice.svg'
  • npm run build succeeds (no TypeScript errors)
  • npm run lint passes (required for community submission)
  • Tested locally via npm link
  • Version bumped in package.json before publish

Comments

Loading comments...