Getting Started
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/Set/Set.node.json
- packages/nodes-base/nodes/Merge/Merge.node.json
- packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json
- packages/nodes-base/nodes/Function/Function.node.json
- packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.json
- packages/nodes-base/nodes/Slack/Slack.node.json
- packages/nodes-base/nodes/HtmlExtract/test/workflow.dotNotation.json
- packages/frontend/editor-ui/src/constants.ts
- packages/nodes-base/nodes/NoOp/NoOp.node.json
- packages/nodes-base/nodes/Github/Github.node.json
- packages/nodes-base/nodes/GraphQL/GraphQL.node.json
n8n is a workflow automation tool that allows you to connect different applications and services. It uses a visual, node-based interface where each node in a workflow represents a specific application or a logical function. These nodes are connected to create sequences of operations that automate complex tasks.
Workflows are the core of n8n. They are composed of a series of connected nodes that define a process. A workflow is triggered, data is processed and transformed through various nodes, and actions are performed in external services. This document provides an overview of the fundamental concepts for getting started with building n8n workflows.
Core Concepts
Workflows
A workflow is a JSON object that defines a set of nodes and the connections between them. It starts with one or more trigger nodes and executes a series of actions.
The following diagram illustrates the basic structure of a workflow, where a manual trigger initiates a process that involves mocking data, transforming it, and extracting information.
This diagram shows the flow of an example workflow defined in workflow.dotNotation.json.
Sources: packages/nodes-base/nodes/HtmlExtract/test/workflow.dotNotation.json:4-121
A workflow definition includes:
nodes: An array of node objects, each with parameters, a unique ID, name, type, and position on the canvas.connections: An object defining how the output of one node connects to the input of another.- Other metadata such as
name,activestatus, andsettings.
Sources: packages/nodes-base/nodes/HtmlExtract/test/workflow.dotNotation.json
Nodes
Nodes are the fundamental building blocks of n8n workflows. They can be triggers that start a workflow, integrations with third-party applications, or core nodes that provide logic and data manipulation capabilities. Each node is defined by a .node.json file which specifies its properties, categories, and documentation links.
Sources: packages/nodes-base/nodes/Start/Start.node.json, packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json
Node Categories
Nodes are organized into categories to help users find them. Common categories include:
- Core Nodes: Essential nodes for workflow logic, data transformation, and flow control.
- Development: Nodes for developers, such as those for making HTTP requests or running custom code.
- Communication: Nodes for services like Slack and Mattermost.
- Data & Storage: Nodes for databases and data storage solutions like Google Sheets and Airtable.
Sources: packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json:4, packages/nodes-base/nodes/Slack/Slack.node.json:4, packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.json:4, packages/nodes-base/nodes/Set/Set.node.json:4
Trigger Nodes
Trigger nodes start a workflow's execution. A workflow can have multiple triggers. They can be initiated manually, on a schedule, or by an external event via a webhook.
| Node Type | Description | Source File |
|---|---|---|
n8n-nodes-base.start | The default node that allows for manual execution of a workflow. | Start.node.json |
n8n-nodes-base.webhook | Listens for incoming HTTP requests to trigger the workflow. | Webhook.node.json |
n8n-nodes-base.cron | Triggers the workflow on a recurring schedule defined by a cron expression. | Cron.node.json |
Sources: packages/nodes-base/nodes/Start/Start.node.json, packages/nodes-base/nodes/Webhook/Webhook.node.json, packages/nodes-base/nodes/Cron/Cron.node.json
The diagram below shows the sequence for a Webhook-triggered workflow.
This sequence illustrates how an external service can trigger an n8n workflow via the Webhook node.
Sources: packages/nodes-base/nodes/Webhook/Webhook.node.json
Core & Helper Nodes
These nodes perform fundamental operations like data manipulation, conditional logic, and flow control.
| Node Type | Description | Subcategory | Source File |
|---|---|---|---|
n8n-nodes-base.if | Implements binary conditional logic, routing data to a TRUE or FALSE branch. | Flow | If.node.json |
n8n-nodes-base.set | Sets or modifies data values within an item. Can be used for mapping and transformation. | Data Transformation | Set.node.json |
n8n-nodes-base.merge | Joins data from two different input streams based on specified keys. | Flow, Data Transformation | Merge.node.json |
n8n-nodes-base.function | Executes custom JavaScript code to perform complex data manipulation. | Data Transformation | Function.node.json |
n8n-nodes-base.htmlExtract | Extracts data from HTML using CSS selectors. | Helpers, Data Transformation | HtmlExtract.node.json |
n8n-nodes-base.noOp | "No Operation". Does nothing but pass data through. Useful for organizing workflows. | Helpers | NoOp.node.json |
Sources: packages/nodes-base/nodes/If/If.node.json, packages/nodes-base/nodes/Set/Set.node.json, packages/nodes-base/nodes/Merge/Merge.node.json, packages/nodes-base/nodes/Function/Function.node.json, packages/nodes-base/nodes/HtmlExtract/HtmlExtract.node.json, packages/nodes-base/nodes/NoOp/NoOp.node.json
Application Nodes
These nodes integrate with external APIs and services.
| Node | Description | Category | Source File |
|---|---|---|---|
| HTTP Request | A versatile node to make custom HTTP requests to any API. | Development | HttpRequest.node.json |
| Google Sheets | Read from and write to Google Sheets. | Data & Storage | GoogleSheets.node.json |
| Slack | Send messages, upload files, and interact with the Slack API. | Communication | Slack.node.json |
| GitHub | Interact with the GitHub API for repositories, issues, etc. | Development | Github.node.json |
| GraphQL | Make requests to any GraphQL API. | Data & Storage | GraphQL.node.json |
Sources: packages/nodes-base/nodes/HttpRequest/HttpRequest.node.json, packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.json, packages/nodes-base/nodes/Slack/Slack.node.json, packages/nodes-base/nodes/Github/Github.node.json, packages/nodes-base/nodes/GraphQL/GraphQL.node.json
Node Type Identifiers
Each node has a unique type identifier used throughout the system. The following table lists some of the key node type constants.
| Constant Name | Node Type String |
|---|---|
START_NODE_TYPE | n8n-nodes-base.start |
WEBHOOK_NODE_TYPE | n8n-nodes-base.webhook |
CRON_NODE_TYPE | n8n-nodes-base.cron |
IF_NODE_TYPE | n8n-nodes-base.if |
SET_NODE_TYPE | n8n-nodes-base.set |
MERGE_NODE_TYPE | n8n-nodes-base.merge |
HTTP_REQUEST_NODE_TYPE | n8n-nodes-base.httpRequest |
FUNCTION_NODE_TYPE | n8n-nodes-base.function |
CODE_NODE_TYPE | n8n-nodes-base.code |
GOOGLE_SHEETS_NODE_TYPE | n8n-nodes-base.googleSheets |
SLACK_NODE_TYPE | n8n-nodes-base.slack |
GITHUB_NODE_TYPE | n8n-nodes-base.github |
EXECUTE_WORKFLOW_NODE_TYPE | n8n-nodes-base.executeWorkflow |
Sources: packages/frontend/editor-ui/src/constants.ts:143-241
Data Flow and Transformation
Data in n8n flows between nodes as a series of JSON objects called "items". Each node receives items from the previous node, performs an operation, and passes the resulting items to the next node.
The Set node is a powerful tool for data transformation. It allows you to add new fields, modify existing ones, or change the structure of the data. It uses expressions to reference data from previous nodes. For example, to set a field data with the value from an incoming item's body.html property, you would use an expression like ={{ $json["body"]["html"] }}.
Sources: packages/nodes-base/nodes/HtmlExtract/test/workflow.dotNotation.json:65-68, packages/nodes-base/nodes/Set/Set.node.json