Getting Started with N8N
Build your first AI-powered workflow with the open-source automation platform
Your Path to N8N Mastery
N8N gives you complete control over your automation workflows. This guide will walk you through installation, setup, and building your first LLM-powered workflow.
Step 1: Choose Your Installation Method
Docker (Recommended)
Easiest self-hosted option. Works on any OS with Docker installed.
NPM/Node.js
Install directly via npm. Requires Node.js 18+.
N8N Cloud
Managed hosting. No setup required, but paid service.
Installing with Docker
1. Create a docker-compose.yml file:
version: '3.8'
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=yourpassword
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
2. Start N8N:
docker-compose up -d
3. Access N8N at:
http://localhost:5678
Installing with NPM
1. Install N8N globally:
npm install -g n8n
2. Start N8N:
n8n start
Step 2: Initial Setup & Configuration
Create Your Account
When you first access N8N, you'll be prompted to create an owner account. This is your main admin user.
Get Your LLM API Keys
You'll need API keys from your preferred LLM providers:
- • OpenAI: platform.openai.com/api-keys
- • Anthropic: console.anthropic.com
- • Google: makersuite.google.com/app/apikey
Set Up Credentials
Go to Settings → Credentials and add your API keys. N8N stores these securely.
Step 3: Build Your First AI Workflow
Example: Email Summarizer
We'll build a workflow that monitors Gmail, uses an LLM to summarize new emails, and sends the summary to Slack.
Create a New Workflow
- • Click the + button in the top right
- • Select "Create new workflow"
- • Give it a name like "Email Summarizer"
Add Gmail Trigger
- • Click the + button on the canvas
- • Search for "Gmail Trigger"
- • Select "On New Email"
- • Connect your Gmail account
- • Set polling interval (e.g., every 5 minutes)
Add OpenAI Node
- • Click the + after Gmail node
- • Search for "OpenAI"
- • Select "Message a Model"
- • Choose your OpenAI credentials
- • Select model: gpt-4 or gpt-3.5-turbo
Prompt Template:
Summarize this email in 2-3 concise bullet points:
From: {{ $json.from }}
Subject: {{ $json.subject }}
Body: {{ $json.textPlain }}
Add Slack Node
- • Click the + after OpenAI node
- • Search for "Slack"
- • Select "Send Message"
- • Connect your Slack workspace
- • Choose target channel
Message Template:
📧 New Email Summary
*From:* {{ $node["Gmail Trigger"].json["from"] }}
*Subject:* {{ $node["Gmail Trigger"].json["subject"] }}
*Summary:*
{{ $json.message.content }}
Test & Activate
- • Click "Test workflow" to run manually
- • Check each node's output data
- • Fix any errors in the execution log
- • Toggle the "Active" switch to enable
- • Your workflow now runs automatically!
Key N8N Concepts
Nodes
Building blocks of workflows. Each node performs one action (trigger, API call, data transformation, etc.)
Connections
Lines between nodes that pass data. Data flows from left to right through your workflow.
Expressions
Access data from previous nodes using {{ $json.field }} syntax in any text field.
Credentials
Stored API keys and authentication tokens. Reusable across workflows and encrypted at rest.
Executions
Each time a workflow runs. View execution history, inspect data, and debug errors in the execution log.
Webhooks
Trigger workflows via HTTP requests. Perfect for integrating with custom apps or receiving data from external services.
N8N Best Practices
- Name your nodes: Rename nodes to describe what they do (e.g., "Extract Email Body" instead of "Set1")
- Use sticky notes: Add notes to your canvas to document complex logic
- Error handling: Add error outputs and fallback paths for critical workflows
- Test with real data: Use the "Execute node" button to test individual nodes during development
- Export workflows: Regularly export workflows as JSON backups
- Monitor execution times: Check the execution log for slow nodes and optimize
Popular LLM Nodes in N8N
OpenAI
GPT-3.5, GPT-4, embeddings, image generation, whisper transcription
Most PopularAnthropic Claude
Claude models, longer context windows, strong reasoning
Long ContextGoogle PaLM
Gemini models, multimodal capabilities
MultimodalReady to Explore More?
Now that you've built your first workflow, dive deeper into advanced patterns and best practices