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 theINode interface:
Node Types
n8n has several categories of nodes:- Trigger Nodes
- Poll Nodes
- Regular Nodes
- Webhook Nodes
Trigger nodes start workflow executions automatically based on events:Examples:
n8n-nodes-base.webhook- HTTP webhooksn8n-nodes-base.scheduleTrigger- Cron-based schedulingn8n-nodes-base.formTrigger- Form submissionsn8n-nodes-base.manualTrigger- Manual execution
- Return a cleanup function to stop the trigger
- Can emit data multiple times
- Have
triggerproperty defined on node type
Node Parameters
Node parameters define how a node behaves. TheINodeProperties interface describes available parameters:
Parameter Types
Getting Node Parameters
TheNodeHelpers.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 asINodeExecutionData:
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
- Use descriptive node names: Names should clearly indicate the node’s purpose
- Validate parameters: Always validate user input in node implementations
- Handle errors gracefully: Use try-catch and return meaningful error messages
- Respect disabled nodes: Check
node.disabledbefore processing - Use paired items: Maintain data lineage with
pairedItemfor debugging - Document parameters: Provide clear descriptions for all parameters
- Test with different data types: Ensure nodes handle various input scenarios
Next Steps
Expressions
Use expressions to work with dynamic data
Error Handling
Implement error handling and retry logic