Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/n8n v2/Node-library
Reference · n8n v2

Node-library

Part of n8n v2. Install the skill and your agent reads this page when it needs the depth.

n8n Node Library Reference

Complete reference for nodes used in n8n v2.0 workflows. Each node includes configuration examples, parameters, use cases, and patterns extracted from production workflows.

Table of Contents


Trigger Nodes

Manual Trigger

Type: n8n-nodes-base.manualTrigger (v1)

Starts workflow manually from the n8n UI.

Use cases:

Configuration:

{
  "parameters": {},
  "name": "Manual Trigger",
  "type": "n8n-nodes-base.manualTrigger",
  "typeVersion": 1,
  "position": [240, 400]
}

Parameters: None required

Output: Empty object {}

Common pattern: Use as starting point for workflows during development, then replace with appropriate trigger (Schedule, Webhook, etc.) for production.


Execute Workflow Trigger

Type: n8n-nodes-base.executeWorkflowTrigger (v1)

Receives input from parent workflow when this workflow is called as a sub-workflow.

Use cases:

Configuration:

{
  "parameters": {},
  "name": "Execute Workflow Trigger",
  "type": "n8n-nodes-base.executeWorkflowTrigger",
  "typeVersion": 1,
  "position": [240, 300]
}

Parameters: None required

Accessing parent data:

// In Code node after this trigger
$input.all()          // Get all items from parent
$input.first().json   // Get first item data

Output: Passes through data from parent workflow

Pattern: Sub-workflows that process data and return results to orchestrator.


Data Processing Nodes

Code Node

Type: n8n-nodes-base.code (v2)

Execute JavaScript to transform, filter, or process data.

Use cases:

Configuration:

{
  "parameters": {
    "jsCode": "// Your JavaScript code\nreturn $input.all();"
  },
  "name": "Process Data",
  "type": "n8n-nodes-base.code",
  "typeVersion": 2,
  "position": [460, 300]
}

Key parameters:

Available variables:

$input.all()                    // Array of all input items
$input.first()                  // First input item
$input.last()                   // Last input item
$input.item                     // Current item in iteration
$json                          // Current item's JSON data
$('Node Name').first().json    // Reference another node
$('Node Name').all()           // All items from another node

Return format: Must return array of objects with json property:

return [
  { json: { field: 'value1' } },
  { json: { field: 'value2' } }
];

// Single item
return [{ json: resultObject }];

// Transform all items
return $input.all().map(item => ({
  json: {
    ...item.json,
    newField: 'computed value'
  }
}));

Example - Deduplication:

const items = $input.all();
const seen = new Set();
const unique = [];

for (const item of items) {
  const key = item.json.url.toLowerCase();
  if (!seen.has(key)) {
    seen.add(key);
    unique.push(item);
  }
}

return unique;

Example - Data extraction:

// Extract specific fields
const items = $input.all();
return items.map(item => ({
  json: {
    title: item.json.title,
    url: item.json.url,
    score: item.json.score || 0
  }
}));

See also: code-snippets/ for reusable patterns


Set Node

Type: n8n-nodes-base.set (v3.3)

Create or modify fields in data items. Primary tool for data normalization.

Use cases:

Configuration:

{
  "parameters": {
    "assignments": {
      "assignments": [
        {
          "id": "title",
          "name": "title",
          "value": "={{ $json.headline }}",
          "type": "string"
        },
        {
          "id": "score",
          "name": "score",
          "value": "={{ $json.points }}",
          "type": "number"
        },
        {
          "id": "source",
          "name": "source",
          "value": "Hacker News",
          "type": "string"
        }
      ]
    },
    "options": {}
  },
  "name": "Normalize Data",
  "type": "n8n-nodes-base.set",
  "typeVersion": 3.3,
  "position": [680, 300]
}

Key parameters:

Expression patterns:

// Static value
"value": "Hacker News"

// Map from existing field
"value": "={{ $json.title }}"

// With fallback
"value": "={{ $json.url || 'https://example.com' }}"

// Computed
"value": "={{ $json.score * 2 }}"

// Type conversion
"value": "={{ new Date($json.time * 1000).toISOString() }}"

Common pattern - Data normalization:

When aggregating from multiple sources, normalize each source to common schema:

HN API → Set Node (normalize to common schema)
NewsAPI → Set Node (normalize to common schema)
RSS Feed → Set Node (normalize to common schema)
           ↓
      Merge Node

Common schema example:

{
  "title": "string",
  "url": "string",
  "source": "string",
  "score": "number",
  "comments": "number",
  "timestamp": "ISO date string",
  "summary": "string"
}

Merge Node

Type: n8n-nodes-base.merge (v2.1)

Combine data from multiple inputs into single output.

Use cases:

Modes:

Configuration (append mode):

{
  "parameters": {
    "mode": "append"
  },
  "name": "Merge All Sources",
  "type": "n8n-nodes-base.merge",
  "typeVersion": 2.1,
  "position": [1560, 400]
}

Connection pattern:

Multiple nodes connect to Merge as inputs:

Source 1 ──┐
Source 2 ──┼─→ Merge Node → Combined Output
Source 3 ──┘

Input indices (0, 1, 2...) increment automatically for each connection.

Common pattern - Multi-source aggregation:

HTTP Request (HN) ──┐
HTTP Request (API) ──┼─→ Merge (append) → Deduplicate → Process
RSS Feed Read ───────┘

Filter Node

Type: n8n-nodes-base.filter (v2)

Keep only items that match specified conditions.

Use cases:

Configuration:

{
  "parameters": {
    "conditions": {
      "string": [
        {
          "value1": "={{ $json.title }}",
          "operation": "regex",
          "value2": "(?i)(AI|machine learning|automation)"
        }
      ],
      "number": [
        {
          "value1": "={{ $json.score }}",
          "operation": "larger",
          "value2": 20
        }
      ]
    }
  },
  "name": "Filter Stories",
  "type": "n8n-nodes-base.filter",
  "typeVersion": 2,
  "position": [1120, 240]
}

Condition types:

String operations:

Number operations:

Boolean operations:

DateTime operations:

Regex example:

// Case-insensitive keyword matching
"value2": "(?i)(AI|ML|automation|n8n)"

// URL pattern
"value2": "^https://.*\\.com$"

Multiple conditions: All conditions must match (AND logic). For OR logic, use multiple Filter nodes in parallel or use Code node.


Split in Batches Node

Type: n8n-nodes-base.splitInBatches (v3)

Process large arrays in smaller chunks, creating a loop.

Use cases:

Configuration:

{
  "parameters": {
    "batchSize": 30,
    "options": {}
  },
  "name": "Batch Process Items",
  "type": "n8n-nodes-base.splitInBatches",
  "typeVersion": 3,
  "position": [680, 240]
}

Key parameters:

How it works:

  1. Splits input array into batches
  2. Processes first batch
  3. Loop continues for next batch
  4. When all batches complete, workflow proceeds

Loop structure:

Split in Batches → Process Batch → HTTP Request ─┐
       ↑                                          │
       └──────────────────────────────────────────┘

Downstream nodes must connect back to Split in Batches for loop continuation.

Common pattern - Rate-limited API calls:

Get IDs (100 items) → Split in Batches (10) → HTTP Request → Process

Processes 10 items at a time instead of overwhelming API with 100 requests.


Flow Control Nodes

IF Node

Type: n8n-nodes-base.if (v2)

Branch workflow based on conditions.

Use cases:

Configuration:

{
  "parameters": {
    "conditions": {
      "string": [
        {
          "value1": "={{ $json['Action'] }}",
          "operation": "equals",
          "value2": "Approve"
        }
      ]
    }
  },
  "name": "Check Approval",
  "type": "n8n-nodes-base.if",
  "typeVersion": 2,
  "position": [1560, 400]
}

Outputs:

Connection structure:

"connections": {
  "IF Node": {
    "main": [
      [{ "node": "Approved Action", "type": "main", "index": 0 }],
      [{ "node": "Rejected Action", "type": "main", "index": 0 }]
    ]
  }
}

Accessing Wait node form data:

// Check dropdown selection
"value1": "={{ $json['Approval Status'] }}"

// Check text input
"value1": "={{ $json['Comments'] }}"

Multiple conditions: Supports string, number, boolean, dateTime conditions. All must match (AND logic).

Common pattern - Human approval:

Wait Node (form) → IF Node → True: Post to API
                           → False: Send notification

Wait Node

Type: n8n-nodes-base.wait (v1.1)

Pause workflow execution until resume condition is met.

Use cases:

Resume modes:

Configuration (form mode):

{
  "parameters": {
    "resume": "form",
    "form": {
      "formTitle": "Review Content",
      "formDescription": "Please review and approve:",
      "formFields": {
        "values": [
          {
            "fieldLabel": "Action",
            "fieldType": "dropdown",
            "fieldOptions": {
              "values": [
                {"option": "Approve"},
                {"option": "Reject"}
              ]
            },
            "requiredField": true
          }
        ]
      }
    }
  },
  "name": "Wait for Approval",
  "type": "n8n-nodes-base.wait",
  "typeVersion": 1.1,
  "position": [900, 400]
}

Field types:

Accessing form data:

After Wait node resumes, access submitted values in next node:

// In expression
{{ $json['Action'] }}
{{ $json['Comments'] }}

// In Code node
const action = $json['Action'];
const comments = $json['Comments'];

IMPORTANT: Wait node actually pauses execution. Do NOT use:

See: references/wait-nodes-guide.md for complete documentation


Integration Nodes

HTTP Request Node

Type: n8n-nodes-base.httpRequest (v4.2)

Make HTTP API calls to any REST endpoint.

Use cases:

Configuration (GET request):

{
  "parameters": {
    "url": "https://api.example.com/data",
    "authentication": "predefinedCredentialType",
    "nodeCredentialType": "httpHeaderAuth",
    "options": {}
  },
  "name": "Fetch Data",
  "type": "n8n-nodes-base.httpRequest",
  "typeVersion": 4.2,
  "position": [460, 400]
}

Configuration (POST with JSON body):

{
  "parameters": {
    "method": "POST",
    "url": "https://api.anthropic.com/v1/messages",
    "authentication": "predefinedCredentialType",
    "nodeCredentialType": "anthropicApi",
    "sendHeaders": true,
    "headerParameters": {
      "parameters": [
        {
          "name": "anthropic-version",
          "value": "2023-06-01"
        }
      ]
    },
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "={{ JSON.stringify($json.requestData) }}",
    "options": {}
  },
  "name": "Call Anthropic API",
  "type": "n8n-nodes-base.httpRequest",
  "typeVersion": 4.2,
  "position": [680, 300]
}

Key parameters:

Dynamic URL:

"url": "=https://api.example.com/item/{{ $json.id }}.json"

Authentication types:

Response access:

{{ $json.responseField }}      // API response data
{{ $statusCode }}              // HTTP status code (200, 201, etc.)

Common pattern - Check status:

HTTP Request → IF Node (check $statusCode === 201) → Success/Failure branches

See: references/api-credentials.md for credential setup


RSS Feed Read Node

Type: n8n-nodes-base.rssFeedRead (v1)

Fetch and parse RSS/Atom feeds.

Use cases:

Configuration:

{
  "parameters": {
    "url": "https://blog.n8n.io/rss/",
    "options": {}
  },
  "name": "Read Blog Feed",
  "type": "n8n-nodes-base.rssFeedRead",
  "typeVersion": 1,
  "position": [460, 560]
}

Key parameters:

Output fields:

Common pattern - Normalize after read:

RSS Feed Read → Set Node (normalize to common schema) → Merge with other sources

Example normalization:

{
  "name": "title",
  "value": "={{ $json.title }}",
  "type": "string"
},
{
  "name": "url",
  "value": "={{ $json.link }}",
  "type": "string"
},
{
  "name": "timestamp",
  "value": "={{ $json.pubDate }}",
  "type": "string"
},
{
  "name": "source",
  "value": "Blog RSS",
  "type": "string"
}

Action Nodes

Execute Workflow Node

Type: n8n-nodes-base.executeWorkflow (v1)

UI Label: "Execute Sub-Workflow" (in node palette)

Important: In n8n v2.0+, this node is labeled "Execute Sub-Workflow" in the UI, but the node type in JSON remains n8n-nodes-base.executeWorkflow. This is normal and correct.

Call another workflow as a sub-workflow.

Use cases:

Configuration:

{
  "parameters": {
    "workflowId": "={{ $parameter.workflowId }}",
    "options": {}
  },
  "name": "Execute Sub-Workflow",
  "type": "n8n-nodes-base.executeWorkflow",
  "typeVersion": 1,
  "position": [680, 400]
}

Source selection:

Import Issue: When importing workflow JSON, Execute Workflow nodes sometimes show "out of date" error after import.

When this happens:

Workaround if you see the error:

  1. Import workflow JSON
  2. Delete Execute Workflow nodes showing errors (not all of them, only ones with errors)
  3. Add fresh "Execute Sub-Workflow" nodes from palette (same type, just recreated)
  4. Select "Database" as source
  5. Choose target workflow from dropdown

Best practice:

Data flow:

Orchestrator: Execute Workflow Node (passes data)
                      ↓
Sub-workflow: Execute Workflow Trigger (receives data)
                      ↓
              Process data
                      ↓
              Return result (last node output)
                      ↓
Orchestrator: Receives result from Execute Workflow Node

See: references/execute-sub-workflow-issues.md for detailed troubleshooting


Respond to Webhook Node

Type: n8n-nodes-base.respondToWebhook (v1)

Send HTTP response back to webhook caller.

Use cases:

Configuration:

{
  "parameters": {
    "respondWith": "json",
    "responseBody": "={{ $json }}",
    "options": {}
  },
  "name": "Respond to Webhook",
  "type": "n8n-nodes-base.respondToWebhook",
  "typeVersion": 1,
  "position": [900, 400]
}

Key parameters:

IMPORTANT: This node does NOT pause workflow execution. It returns a response immediately while the workflow continues.

For human input, use Wait nodes instead.

Anti-pattern:

❌ Webhook Trigger → Respond to Webhook (asking for input)

This returns immediately - user never gets to provide input.

Correct pattern:

✅ Webhook Trigger → Wait Node (form) → Process → Respond to Webhook

Node Versioning

Nodes have typeVersion indicating schema version:

Common versions:

Version compatibility:

When importing workflows, n8n usually auto-upgrades node versions. Exception: Execute Workflow nodes often require manual recreation.

Check version: Look at typeVersion in node configuration.


Node Positioning

Nodes are positioned on 2D canvas using [x, y] coordinates (pixels).

Conventions:

Example positions:

Trigger:        [240, 400]
Process:        [460, 400]
Decision (IF):  [680, 400]
  ├─ True:      [900, 300]
  └─ False:     [900, 500]
Continue:       [1120, 400]

Visual layout:

Start → Process → Decision ┬→ Branch A → Merge
                           └→ Branch B ──┘

Positioning doesn't affect execution - it's purely for visual organization.


See Also

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.