Introduction to n8n
Relevant source files
The following files were used as context for generating this wiki page:
- packages/nodes-base/nodes/Start/Start.node.json
- packages/nodes-base/nodes/Webhook/Webhook.node.json
- packages/nodes-base/nodes/Cron/Cron.node.json
- packages/nodes-base/nodes/If/If.node.json
- packages/nodes-base/nodes/Merge/Merge.node.json
- packages/nodes-base/nodes/Set/Set.node.json
- packages/nodes-base/nodes/Function/Function.node.json
- packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json
- packages/nodes-base/nodes/Slack/Slack.node.json
- packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.json
- packages/nodes-base/nodes/Airtable/Airtable.node.json
- packages/nodes-base/nodes/Postgres/Postgres.node.json
- packages/nodes-base/nodes/MongoDb/MongoDb.node.json
- packages/nodes-base/nodes/Github/Github.node.json
- packages/nodes-base/nodes/Jira/Jira.node.json
- packages/nodes-base/nodes/NoOp/NoOp.node.json
- packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.json
- packages/nodes-base/nodes/GraphQL/GraphQL.node.json
- packages/nodes-base/nodes/ReadBinaryFile/ReadBinaryFile.node.json
- packages/nodes-base/nodes/CompareDatasets/CompareDatasets.node.json
n8n is a workflow automation tool built on a system of interconnected nodes. Each node represents a specific application, service, or action, which can be combined to create complex, automated workflows. The platform is designed to connect various services, manipulate data, and control process flow through a visual, node-based editor.
The core of n8n is its extensive library of nodes, which are categorized based on their function, such as communication, data storage, development, and productivity. Users can build workflows that start with a trigger node (e.g., a schedule or a webhook) and then pass data through a series of action and logic nodes to perform tasks across different platforms and APIs.
Core Concepts
Workflows in n8n are built from two primary components: Nodes and Connections. A workflow always begins with a trigger or a Start node.
This diagram illustrates a basic workflow structure, starting with a trigger, followed by sequential processing and conditional logic.
Sources: packages/nodes-base/nodes/Start/Start.node.json, packages/nodes-base/nodes/If/If.node.json
Nodes
Nodes are the fundamental building blocks of an n8n workflow. They can be triggers that start a workflow, integrations with third-party applications (like Slack or Google Sheets), or core nodes that provide logic and data manipulation capabilities.
Node Categories
Nodes are organized into categories to help users find the right tool for their task. The primary categories include:
- Core Nodes: For logic, data transformation, and flow control.
- Development: For interacting with APIs, databases, and custom code.
- Communication: For sending notifications and messages (e.g., Slack, Telegram).
- Data & Storage: For connecting to databases and spreadsheet applications.
- Productivity: For interacting with project management and office tools.
- Sales: For connecting to CRM platforms.
This diagram shows the categorization of various n8n nodes.
Sources: packages/nodes-base/nodes/If/If.node.json, packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json, packages/nodes-base/nodes/Slack/Slack.node.json, packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.json, packages/nodes-base/nodes/Jira/Jira.node.json
Trigger Nodes
Workflows are initiated by Trigger Nodes. These can be event-driven or scheduled.
- Webhook Node (
n8n-nodes-base.webhook): Starts a workflow when it receives an HTTP request. This is ideal for real-time integrations with services that support webhooks. - Cron Node (
n8n-nodes-base.cron): Triggers a workflow on a recurring schedule, defined using cron syntax. This is used for periodic tasks like daily reports or hourly data syncs.
The diagram shows the two main types of workflow triggers: event-driven (Webhook) and time-based (Cron).
Sources: packages/nodes-base/nodes/Webhook/Webhook.node.json, packages/nodes-base/nodes/Cron/Cron.node.json
The Cron node uses a time-based job scheduler to trigger workflows periodically for complex schedules like "every Tuesday at 9 am".
Sources: packages/nodes-base/nodes/Cron/Cron.node.json:5-6
Core Nodes for Flow Control and Data Manipulation
Core nodes are essential for building the logic and structure of a workflow.
Flow Control
These nodes direct the flow of data through different branches of a workflow.
| Node | Identifier | Description | Aliases |
|---|---|---|---|
| IF | n8n-nodes-base.if | Implements binary conditional logic, routing data to a TRUE or FALSE output based on conditions. | Router, Filter, Condition, Logic, Boolean, Branch |
| Merge | n8n-nodes-base.merge | Combines data from multiple incoming branches into a single stream. | Join, Concatenate, Wait |
| NoOp | n8n-nodes-base.noOp | "No Operation". Does nothing and simply passes data through. Useful for organizing workflows or as a placeholder. | nothing |
Sources: packages/nodes-base/nodes/If/If.node.json, packages/nodes-base/nodes/Merge/Merge.node.json, packages/nodes-base/nodes/NoOp/NoOp.node.json
Data Transformation
These nodes are used to modify, create, or extract data as it passes through the workflow.
| Node | Identifier | Description | Aliases |
|---|---|---|---|
| Set | n8n-nodes-base.set | Sets or modifies values in the incoming data. Can be used for simple data mapping and transformation. | JS, JSON, Filter, Transform, Map |
| Function | n8n-nodes-base.function | Executes custom JavaScript code, allowing for complex data manipulation and logic that goes beyond other nodes. | Code, Javascript, Custom Code, Script |
| HTML Extract | n8n-nodes-base.htmlExtract | Extracts data from HTML using CSS selectors. | |
| Read Binary File | n8n-nodes-base.readBinaryFile | Reads a binary file from the input data. | Text, Open, Import |
Sources: packages/nodes-base/nodes/Set/Set.node.json, packages/nodes-base/nodes/Function/Function.node.json, packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.json, packages/nodes-base/nodes/ReadBinaryFile/ReadBinaryFile.node.json
The Function node is particularly powerful as it allows you to iterate over multiple items and manipulate the number of items being outputted.
Sources: packages/nodes-base/nodes/Function/Function.node.json:5-9
Application & Service Integration Nodes
n8n provides a vast number of nodes to integrate with external services. These are often referred to as "App Nodes".
Development & API
These nodes are for developers to interact with various web services and databases.
This diagram shows key nodes for development and API integration.
Sources: packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json, packages/nodes-base/nodes/GraphQL/GraphQL.node.json, packages/nodes-base/nodes/Github/Github.node.json, packages/nodes-base/nodes/Postgres/Postgres.node.json, packages/nodes-base/nodes/MongoDb/MongoDb.node.json
Communication & Productivity
These nodes connect to popular communication and productivity platforms.
- Communication:
Slack,Telegram,Mattermost,Twilio - Productivity & Data:
GoogleSheets,Airtable,Trello,Jira - Sales:
Hubspot
Sources: packages/nodes-base/nodes/Slack/Slack.node.json, packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.json, packages/nodes-base/nodes/Airtable/Airtable.node.json, packages/nodes-base/nodes/Jira/Jira.node.json, packages/nodes-base/nodes/Hubspot/Hubspot.node.json
Summary
n8n provides a flexible and powerful platform for workflow automation through its node-based architecture. By combining trigger nodes, core logic nodes, and a wide array of application integration nodes, users can visually construct complex automated processes. The system is designed to be extensible, with nodes for everything from simple data setting to custom JavaScript functions and direct API interactions, making it a versatile tool for both simple and advanced automation tasks.