Skip to main content

Nodes Overview

Nodes are the building blocks of n8n workflows. Each node represents a discrete action or operation, such as making an HTTP request, processing data, or triggering workflows. This guide covers node structure, types, and how to work with them.

Node Structure

Every node in n8n follows the INode interface:

Node Types

n8n has several categories of nodes:
Trigger nodes start workflow executions automatically based on events:
Examples:
  • n8n-nodes-base.webhook - HTTP webhooks
  • n8n-nodes-base.scheduleTrigger - Cron-based scheduling
  • n8n-nodes-base.formTrigger - Form submissions
  • n8n-nodes-base.manualTrigger - Manual execution
Key Characteristics:
  • Return a cleanup function to stop the trigger
  • Can emit data multiple times
  • Have trigger property defined on node type

Node Parameters

Node parameters define how a node behaves. The INodeProperties interface describes available parameters:

Parameter Types

Getting Node Parameters

The NodeHelpers.getNodeParameters() function merges defaults with user values:

Node Connections

Connections define data flow between nodes. Each connection specifies:

Multiple Outputs

Nodes can have multiple outputs for different routing scenarios:

Multiple Inputs

Nodes can accept data from multiple sources:

Node Execution Data

Data flows between nodes as INodeExecutionData:
The pairedItem property tracks data lineage, allowing you to trace which output items came from which input items.

Node Outputs

Nodes return data in a specific format:

Node Output Configuration

Node types can define dynamic outputs:

Common Node Patterns

Cron/Schedule Node

The Schedule Trigger uses cron expressions:

Error Handling in Nodes

Nodes can handle errors at the node level:

Node Type Methods

Node types can implement various lifecycle methods:
1

execute

Main execution method for processing data:
2

webhook

Handle incoming webhook requests:
3

trigger

Set up event-based triggers:
4

poll

Poll external sources:

Best Practices

  1. Use descriptive node names: Names should clearly indicate the node’s purpose
  2. Validate parameters: Always validate user input in node implementations
  3. Handle errors gracefully: Use try-catch and return meaningful error messages
  4. Respect disabled nodes: Check node.disabled before processing
  5. Use paired items: Maintain data lineage with pairedItem for debugging
  6. Document parameters: Provide clear descriptions for all parameters
  7. Test with different data types: Ensure nodes handle various input scenarios
When developing nodes, use the node-dev CLI tool:

Next Steps

Expressions

Use expressions to work with dynamic data

Error Handling

Implement error handling and retry logic