Build your first AI-powered workflow with the open-source automation platform
N8N gives you complete control over your automation workflows. This guide will walk you through installation, setup, and building your first LLM-powered workflow.
Easiest self-hosted option. Works on any OS with Docker installed.
Install directly via npm. Requires Node.js 18+.
Managed hosting. No setup required, but paid service.
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
1. Install N8N globally:
npm install -g n8n
2. Start N8N:
n8n start
When you first access N8N, you'll be prompted to create an owner account. This is your main admin user.
You'll need API keys from your preferred LLM providers:
Go to Settings → Credentials and add your API keys. N8N stores these securely.
We'll build a workflow that monitors Gmail, uses an LLM to summarize new emails, and sends the summary to Slack.
Prompt Template:
Summarize this email in 2-3 concise bullet points:
From: {{ $json.from }}
Subject: {{ $json.subject }}
Body: {{ $json.textPlain }}
Message Template:
📧 New Email Summary
*From:* {{ $node["Gmail Trigger"].json["from"] }}
*Subject:* {{ $node["Gmail Trigger"].json["subject"] }}
*Summary:*
{{ $json.message.content }}
Building blocks of workflows. Each node performs one action (trigger, API call, data transformation, etc.)
Lines between nodes that pass data. Data flows from left to right through your workflow.
Access data from previous nodes using {{ $json.field }} syntax in any text field.
Stored API keys and authentication tokens. Reusable across workflows and encrypted at rest.
Each time a workflow runs. View execution history, inspect data, and debug errors in the execution log.
Trigger workflows via HTTP requests. Perfect for integrating with custom apps or receiving data from external services.
GPT-3.5, GPT-4, embeddings, image generation, whisper transcription
Most PopularClaude models, longer context windows, strong reasoning
Long ContextGemini models, multimodal capabilities
MultimodalNow that you've built your first workflow, dive deeper into advanced patterns and best practices