Workflows are the heart of n8n. Each workflow is a series of connected nodes that automate a process from start to finish. This guide walks you through creating your first real workflow, explaining key concepts along the way.
Workflow Anatomy
Every n8n workflow consists of:
Step-by-Step: Build a Contact Form Notification Workflow
This example creates a workflow that receives a contact form submission via webhook, saves it to a spreadsheet, and sends a notification.
Step 1 — Create a New Workflow
Step 2 — Add a Webhook Trigger
contact-form (this creates a URL like https://n8n.example.com/webhook/contact-form)
The webhook node generates a URL that your contact form will send data to.
Step 3 — Add a Google Sheets Node
Step 4 — Add a Slack Notification Node
#leads).
- Message: Write the notification text using data from the webhook. For example:New contact form submission!
Name: {{ $json.name }}
Email: {{ $json.email }}
Message: {{ $json.message }}Step 5 — Test the Workflow
curl -X POST https://n8n.example.com/webhook/contact-form \
-H "Content-Type: application/json" \
-d '{"name": "Jane Doe", "email": "[email protected]", "message": "Hello, I am interested in your services."}'Step 6 — Activate the Workflow
Once tested successfully:
Working with Data Between Nodes
Data flows through your workflow as JSON objects. Each node receives data from the previous node and passes its output to the next.
Accessing Data
Use expressions to reference data from previous nodes:
{{ $json.fieldName }}— Access a field from the current node's input.{{ $node["Node Name"].json.fieldName }}— Access a specific node's output.{{ $input.item.json.fieldName }}— Access current item data.
Transforming Data
Use the Set node to reshape data:
Use the Code node for complex transformations:
// Example: Format a date and combine names
const items = $input.all();
return items.map(item => ({
json: {
fullName: ${item.json.firstName} ${item.json.lastName},
date: new Date().toISOString().split('T')[0],
...item.json
}
}));Common Trigger Types
| Trigger | Use Case |
|---|---|
| Webhook | Receive data from external services or forms |
| Schedule | Run workflows at specific times (cron-like) |
| Email (IMAP) | Trigger when a new email arrives |
| Database | Trigger on new or changed database records |
| App-specific | Many apps have dedicated triggers (e.g., new Slack message, new GitHub issue) |
Error Handling
n8n provides built-in error handling:
Workflow Organization Tips
What to Do Next
- Popular n8n Integrations — Connect n8n to more services.
- Getting Started with Your n8n Instance — Review instance setup.
- What Is n8n? — Learn more about n8n concepts.
- Monitoring Server Performance — Monitor resource usage.