references/n8n-ai-agent-prompt-formula.md
# n8n AI Agent Prompt Formula
A structured template for creating effective AI agent system prompts in n8n workflows.
---
## AI Agent Universal Prompt Formula
**Role → Task → Goal → Rules → Context → Few-Shot Examples → Tool Usage Instructions → Output Requirements**
---
## AI Agent Template (System Prompt)
### Role
You are an AI agent acting as:
**[DEFINE ROLE CLEARLY]**
- Domain expertise:
- Primary responsibility:
- What you are NOT responsible for:
---
### Task
Your task is to:
**[DEFINE THE SINGLE TASK]**
Follow this exact sequence:
1. [Step 1 – input collection or interpretation]
2. [Step 2 – validation or checks]
3. [Step 3 – decision logic]
4. [Step 4 – output generation or tool usage]
5. [Step 5 – confirmation or final response]
---
### Goal
The goal of this task is:
**[DEFINE THE OUTCOME]**
Success means:
**[DEFINE WHAT "GOOD" LOOKS LIKE]**
---
### Rules
You must follow these rules at all times:
- Do not make up facts or data.
- Ask for clarification if required inputs are missing.
- Prefer accuracy over speed.
- Use tools only when explicitly required.
- If unsure, say you do not know.
---
### Context
Relevant context for decision-making:
- Current date: `{{ $now }}`
- Timezone: `{{ $json.timezone }}`
- Environment details:
- [Business hours]
- [Policies]
- [Constraints]
---
### Few-Shot Examples
#### Example 1
**Input**
[Example input]
**Expected Behavior**
[Explain the reasoning steps and final output]
#### Example 2
**Input**
[Example input]
**Expected Behavior**
[Explain the reasoning steps and final output]
---
### Tool Usage Instructions (If Applicable)
You have access to the following tools:
- **Tool name:** [tool_name]
- When to use it:
- Required inputs:
- Expected output:
---
### Output Requirements
- **Output format:** Markdown
- **Tone:** [Define tone]
- **Structure:**
- Heading
- Body
- Final result
---
## Example: Customer Support Agent
```
## Role
You are an AI agent acting as a **Customer Support Specialist** for a SaaS product.
- Domain expertise: Product features, billing, troubleshooting
- Primary responsibility: Answer customer questions accurately and helpfully
- What you are NOT responsible for: Making refund decisions over $100, accessing customer payment details
## Task
Your task is to:
Help customers resolve their issues or answer their questions about the product.
Follow this exact sequence:
1. Understand the customer's question or issue
2. Check if you have the information needed to answer
3. Provide a clear, helpful response
4. If you cannot help, escalate appropriately
## Goal
The goal of this task is:
Resolve customer issues quickly and accurately while maintaining a positive experience.
Success means:
- Customer question is answered completely
- Customer knows their next steps
- Response is professional and empathetic
## Rules
You must follow these rules at all times:
- Do not make up product features or policies
- Do not promise refunds or credits without verification
- Always be polite and professional
- If unsure, say you will check and follow up
## Context
- Current date: {{ $now }}
- Customer plan: {{ $json.plan_type }}
- Account age: {{ $json.account_age_days }} days
## Output Requirements
- Output format: Clear, conversational text
- Tone: Friendly, professional, helpful
- Structure: Greeting → Answer → Next Steps (if applicable)
```
references/n8n-build-example-joke-email.md
# n8n Build Example: Joke Email Workflow
## Build Brief
**Objective:** Fetch a random joke from icanhazdadjoke.com and email it via Resend.
**Trigger:** Schedule Trigger every 5 minutes.
**Inputs:** Resend API key, from email, to email.
**Outputs:** An email sent with the joke in the body.
**Assumptions:** You are running n8n with timezone set correctly (Africa/Lagos is fine).
---
## Workflow Blueprint (Node Order)
1. **Schedule Trigger** - Runs every 5 minutes.
2. **Fetch Joke (HTTP Request)** - GET `https://icanhazdadjoke.com/` with header `Accept: application/json` so the response includes a `joke` field.
3. **Send Email (Resend HTTP Request)** - POST `https://api.resend.com/emails` with JSON body including `from`, `to`, `subject`, `text` (mapped from the prior node).
---
## Build Steps in n8n (Click by Click)
### 1) Schedule Trigger
1. Add node: **Schedule Trigger**
2. Mode: **Every X**
3. Set: **5 minutes**
4. Save.
### 2) Fetch Joke (HTTP Request)
1. Add node: **HTTP Request**
2. Name it: **Fetch Joke**
3. Method: **GET**
4. URL: `https://icanhazdadjoke.com/`
5. Headers:
- Name: `Accept`
- Value: `application/json`
6. Execute this node once and confirm output has a field like:
- `joke: "..."`
### 3) Send Email (Resend HTTP Request)
1. Add node: **HTTP Request**
2. Name it: **Send Email (Resend)**
3. Method: **POST**
4. URL: `https://api.resend.com/emails`
5. Headers:
- `Authorization` = `Bearer YOUR_RESEND_API_KEY`
- `Content-Type` = `application/json`
6. Body Content Type: **JSON**
7. Body (JSON):
- `from`: your-email@domain.com
- `to`: recipient@email.com
- `subject`: Dry Jokes
- `text`: `{{$json.joke}}`
8. Execute workflow to test, then activate it.
---
## Ready to Import Workflow JSON
Paste this into **Workflow → Import from File / Clipboard** (edit placeholders for your API key and emails):
```json
{
"name": "Fetch a random joke from icanhazdadjoke.com and email it via Resend",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"value": 5
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [0, 0],
"id": "1241b016-3427-4372-801b-69fbd34b5bcd",
"name": "Schedule Trigger",
"notesInFlow": true,
"notes": "Runs every 5 minutes."
},
{
"parameters": {
"url": "https://icanhazdadjoke.com/",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Accept",
"value": "application/json"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [208, 0],
"id": "1cdacbec-a054-4752-b53c-d20f7efd7f57",
"name": "HTTP Request",
"notes": "Fetch Joke (HTTP Request)"
},
{
"parameters": {
"method": "POST",
"url": "https://api.resend.com/emails",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_RESEND_API_KEY"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "from",
"value": "your-email@domain.com"
},
{
"name": "to",
"value": "recipient@email.com"
},
{
"name": "subject",
"value": "Dry Jokes"
},
{
"name": "text",
"value": "={{$json.joke}}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [416, 0],
"id": "db173176-36e9-4cfd-95f9-2c26b24a34d1",
"name": "HTTP Request1",
"notes": "Send Email (Resend HTTP Request)"
}
],
"pinData": {},
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "HTTP Request1",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"availableInMCP": false
}
}
```
---
## Reliability and Operations
- **Avoid silent failures:** Create a separate Error Workflow using the Error Trigger node that emails you (or pings Slack) when this workflow fails.
- **Retry behavior:** If Resend occasionally fails, turn on Continue On Fail for the Resend node and branch to a "Wait 30s → retry once" path (simple backoff).
- **Check executions:** Watch the Executions list for failures and confirm the output includes `joke`.
---
## Security Checklist (Important for Production)
- Do not hardcode your Resend key long term. Store it in **n8n Credentials** (HTTP Header Auth style) and reference the credential in the HTTP Request node.
- Keep sender domains verified in Resend, use a real "from" that Resend allows.
- If you later expose anything via webhook, treat the URL as secret and validate incoming requests.
---
## Optional Upgrades
1. **Add a Set node** before Resend to format a nicer email like:
- Subject: `Daily Dad Joke`
- Text: `Here you go:\n\n{{$json.joke}}`
2. **Deduplicate jokes** (store last joke in Data Store / static data, skip if same).
3. **HTML email** (use `html` field instead of `text` in Resend payload).
4. **Send only during certain hours** (IF node checking hour in Africa/Lagos).
references/n8n-build-example-weather-alert.md
# n8n Build Example: Daily Weather Rain Alert
## Build Brief
**Objective:** Every morning at 7:00 AM (Africa/Lagos), fetch today's forecast and email you only if rain is likely.
**Trigger:** Schedule (daily).
**Inputs:** Latitude, longitude, rain threshold (example: 50%), email provider details (example: Resend API key).
**Outputs:** One email alert on "rain likely", otherwise no message (or an optional "all clear" email).
---
## Workflow Blueprint (Nodes in Order)
1. **Schedule Trigger** (daily, 07:00)
2. **HTTP Request** – Get Forecast (Open-Meteo)
3. **Set** – Shape Today's Values (pull out today's rain probability and date)
4. **IF** – Rain likely? (probability >= threshold)
5. **HTTP Request** – Send Email (Resend) (true path)
6. *(Optional)* NoOp / Set on false path, or a second email node for "no rain"
---
## Build Steps in n8n (Click by Click)
### 1) Schedule Trigger
1. Add node: **Schedule Trigger**
2. Configure: **Every day**
3. Time: **07:00**
4. Timezone: **Africa/Lagos** (match your instance timezone)
### 2) HTTP Request: "Get Forecast (Open-Meteo)"
1. Add node: **HTTP Request**
2. Name: **Get Forecast**
3. Method: **GET**
4. URL (example, replace lat/lon):
```
https://api.open-meteo.com/v1/forecast?latitude=6.6082746&longitude=3.3052691&daily=precipitation_probability_max,precipitation_sum&timezone=Africa%2FLagos
```
5. Leave auth off (Open-Meteo is free for this endpoint).
6. Execute the node once. You should see a response with a `daily` object containing arrays like `precipitation_probability_max` and `time`.
### 3) Set Node: "Today's Rain Data"
This makes the IF node simple and readable.
1. Add node: **Set**
2. Name: **Today's Rain Data**
3. Add fields:
- `date` (String):
- Value: `={{$json.daily.time[0]}}`
- `rainProbability` (Number):
- Value: `={{$json.daily.precipitation_probability_max[0]}}`
- `precipSum` (Number, optional):
- Value: `={{$json.daily.precipitation_sum[0]}}`
### 4) IF Node: "Rain likely?"
1. Add node: **IF**
2. Name: **Rain likely?**
3. Condition (example):
- Left value: `={{$json.rainProbability}}`
- Operation: **Larger or equal**
- Right value: `50`
4. True output means "email alert".
### 5) Email Alert (Resend via HTTP Request)
1. Add node: **HTTP Request**
2. Name: **Send Rain Email (Resend)**
3. Method: **POST**
4. URL: `https://api.resend.com/emails`
5. Turn on **Send Headers** and add:
- `Authorization`: `Bearer YOUR_RESEND_API_KEY`
- `Content-Type`: `application/json`
6. Turn on **Send Body** and add body parameters:
- `from`: your-email@domain.com
- `to`: recipient@email.com
- `subject`: `Rain alert for {{$json.date}}`
- `text`: `={{"Rain chance today is " + $json.rainProbability + "%. Take an umbrella!"}}`
### 6) False Branch (Do Nothing)
Leave the **false** output unconnected, or add a **Set** node that writes a log message like "No rain today".
#### Option B: Send a "No rain" Email (Recommended While Testing)
1. Add another **HTTP Request** node.
2. Name: **Send No Rain Email (Resend)**
3. Connect the **False** output of the IF node to this node.
**Settings for the false branch email node:**
- Method: **POST**
- URL: `https://api.resend.com/emails`
- Send Headers:
- `Authorization`: `Bearer YOUR_RESEND_API_KEY`
- `Content-Type`: `application/json`
- Send Body (JSON):
- `from`: your-email@domain.com
- `to`: recipient@email.com
- `subject`: `={{"No rain expected for " + $json.date}}`
- `text`: `={{"No rain expected today. Rain chance is " + $json.rainProbability + "%."}}`
---
## Data Shape You Are Relying On (Mental Model)
Open-Meteo returns an **object** with a `daily` **object**, and inside that are **arrays** for each daily metric. In n8n, you're reading "today" as index `[0]`.
---
## Reliability and Operations
- Add an **Error Workflow** (with Error Trigger) that emails you when this workflow fails, so silent failures do not slip by.
- In the Weather HTTP node, keep an eye on the **Executions** list to confirm the response still includes `daily` fields.
- If email sending can fail sometimes, consider a simple retry path: **Wait 30s → resend once** (only on the email node failure).
---
## Security Checklist
- Store your Resend API key in **n8n Credentials** (or environment variables), not inside the node long term.
- If you self host, keep HTTPS working and confirm your instance timezone is set correctly so 7:00 AM fires as expected.
---
## Optional Upgrades
1. Add a second condition: alert if `precipSum > 0` even when probability is low.
2. Add "quiet hours" (skip weekends, or only send alerts Mon to Fri).
3. Add a simple location label in the email subject (city name you set once).
4. Add a fallback provider (SMTP node) if Resend fails.
references/n8n-nodes-masterlist.md
# n8n Nodes Master List
## Overview
This reference document provides a comprehensive list of n8n nodes organized by category. Use this to identify the best nodes for building automation workflows.
**Usage:** Feed this to an AI agent to help build custom n8n flows, research nodes for specific use cases, or perform quick lookups.
---
## Core Nodes
Core nodes handle fundamental workflow operations like triggers, data transformation, and flow control.
| Node | Description | Documentation |
|------|-------------|---------------|
| Activation Trigger | Triggers workflow on activation | [Docs](https://n8n.io/integrations/activation-trigger) |
| Aggregate | Combines multiple items into groups | [Docs](https://n8n.io/integrations/aggregate) |
| Code | Execute custom JavaScript or Python | [Docs](https://n8n.io/integrations/code) |
| Compare Datasets | Compare two datasets | [Docs](https://n8n.io/integrations/compare-datasets) |
| Crypto | Encrypt and hash data | [Docs](https://n8n.io/integrations/crypto) |
| Date & Time | Parse and manipulate dates | [Docs](https://n8n.io/integrations/date-and-time) |
| Edit Fields | Set, rename, or remove fields | [Docs](https://n8n.io/integrations/edit-fields) |
| Execute Command | Run shell commands | [Docs](https://n8n.io/integrations/execute-command) |
| Execute Workflow | Run another workflow | [Docs](https://n8n.io/integrations/execute-workflow) |
| Filter | Filter items based on conditions | [Docs](https://n8n.io/integrations/filter) |
| Function | Run custom JavaScript code | [Docs](https://n8n.io/integrations/function) |
| HTML | Parse and extract HTML data | [Docs](https://n8n.io/integrations/html) |
| HTTP Request | Make HTTP API calls | [Docs](https://n8n.io/integrations/http-request) |
| If | Conditional branching | [Docs](https://n8n.io/integrations/if) |
| Item Lists | Work with lists of items | [Docs](https://n8n.io/integrations/item-lists) |
| Loop Over Items | Iterate through items | [Docs](https://n8n.io/integrations/loop-over-items) |
| Manual Trigger | Start workflow manually | [Docs](https://n8n.io/integrations/manual-trigger) |
| Markdown | Convert HTML to Markdown | [Docs](https://n8n.io/integrations/markdown) |
| Merge | Combine data from multiple branches | [Docs](https://n8n.io/integrations/merge) |
| Move Binary Data | Move binary data between fields | [Docs](https://n8n.io/integrations/move-binary-data) |
| No Operation | Placeholder node | [Docs](https://n8n.io/integrations/no-operation) |
| Read Binary Files | Read files from disk | [Docs](https://n8n.io/integrations/read-binary-files) |
| Rename Keys | Rename object keys | [Docs](https://n8n.io/integrations/rename-keys) |
| RSS Feed Read | Read RSS feeds | [Docs](https://n8n.io/integrations/rss-feed-read) |
| Schedule Trigger | Run workflow on schedule | [Docs](https://n8n.io/integrations/schedule-trigger) |
| Set | Set field values | [Docs](https://n8n.io/integrations/set) |
| Sort | Sort items | [Docs](https://n8n.io/integrations/sort) |
| Split In Batches | Process items in batches | [Docs](https://n8n.io/integrations/split-in-batches) |
| Split Out | Split arrays into items | [Docs](https://n8n.io/integrations/split-out) |
| SSH | Execute SSH commands | [Docs](https://n8n.io/integrations/ssh) |
| Stop And Error | Stop workflow with error | [Docs](https://n8n.io/integrations/stop-and-error) |
| Summarize | Aggregate and summarize data | [Docs](https://n8n.io/integrations/summarize) |
| Switch | Route items to different branches | [Docs](https://n8n.io/integrations/switch) |
| Wait | Pause workflow execution | [Docs](https://n8n.io/integrations/wait) |
| Webhook | Receive HTTP webhooks | [Docs](https://n8n.io/integrations/webhook) |
| Write Binary File | Write files to disk | [Docs](https://n8n.io/integrations/write-binary-file) |
| XML | Parse and create XML | [Docs](https://n8n.io/integrations/xml) |
---
## AI & Language Models
Nodes for AI, machine learning, and language model integrations.
| Node | Description | Documentation |
|------|-------------|---------------|
| AI Agent | Create AI agents with tools | [Docs](https://n8n.io/integrations/ai-agent) |
| AI Transform | Transform data using AI | [Docs](https://n8n.io/integrations/ai-transform) |
| Anthropic | Claude AI models | [Docs](https://n8n.io/integrations/anthropic) |
| AWS Bedrock Chat Model | AWS Bedrock LLMs | [Docs](https://n8n.io/integrations/aws-bedrock-chat-model) |
| AWS Comprehend | NLP text analysis | [Docs](https://n8n.io/integrations/aws-comprehend) |
| Azure OpenAI Chat Model | Azure-hosted OpenAI | [Docs](https://n8n.io/integrations/azure-openai-chat-model) |
| Cohere | Cohere language models | [Docs](https://n8n.io/integrations/cohere) |
| Google AI | Google AI models | [Docs](https://n8n.io/integrations/google-ai) |
| Google Gemini Chat Model | Google Gemini | [Docs](https://n8n.io/integrations/google-gemini-chat-model) |
| Google Vertex AI | Google Vertex AI | [Docs](https://n8n.io/integrations/google-vertex-ai) |
| Groq Chat Model | Groq fast inference | [Docs](https://n8n.io/integrations/groq-chat-model) |
| Hugging Face | Hugging Face models | [Docs](https://n8n.io/integrations/hugging-face) |
| Mistral Cloud Chat Model | Mistral AI | [Docs](https://n8n.io/integrations/mistral-cloud-chat-model) |
| Ollama Chat Model | Local Ollama models | [Docs](https://n8n.io/integrations/ollama-chat-model) |
| OpenAI | OpenAI GPT models | [Docs](https://n8n.io/integrations/openai) |
| OpenAI Chat Model | OpenAI chat completions | [Docs](https://n8n.io/integrations/openai-chat-model) |
| OpenRouter Chat Model | OpenRouter multi-model | [Docs](https://n8n.io/integrations/openrouter-chat-model) |
| Perplexity Chat Model | Perplexity AI | [Docs](https://n8n.io/integrations/perplexity-chat-model) |
| Replicate | Replicate ML models | [Docs](https://n8n.io/integrations/replicate) |
| Text Classifier | Classify text with AI | [Docs](https://n8n.io/integrations/text-classifier) |
| Sentiment Analysis | Analyze text sentiment | [Docs](https://n8n.io/integrations/sentiment-analysis) |
---
## Vector Stores & Embeddings
Nodes for vector databases, embeddings, and RAG workflows.
| Node | Description | Documentation |
|------|-------------|---------------|
| Embeddings AWS Bedrock | AWS Bedrock embeddings | [Docs](https://n8n.io/integrations/embeddings-aws-bedrock) |
| Embeddings Cohere | Cohere embeddings | [Docs](https://n8n.io/integrations/embeddings-cohere) |
| Embeddings Google AI | Google AI embeddings | [Docs](https://n8n.io/integrations/embeddings-google-ai) |
| Embeddings Hugging Face | Hugging Face embeddings | [Docs](https://n8n.io/integrations/embeddings-hugging-face) |
| Embeddings Mistral Cloud | Mistral embeddings | [Docs](https://n8n.io/integrations/embeddings-mistral-cloud) |
| Embeddings Ollama | Ollama embeddings | [Docs](https://n8n.io/integrations/embeddings-ollama) |
| Embeddings OpenAI | OpenAI embeddings | [Docs](https://n8n.io/integrations/embeddings-openai) |
| Pinecone Vector Store | Pinecone database | [Docs](https://n8n.io/integrations/pinecone) |
| Qdrant Vector Store | Qdrant database | [Docs](https://n8n.io/integrations/qdrant) |
| Supabase Vector Store | Supabase pgvector | [Docs](https://n8n.io/integrations/supabase-vector-store) |
| Weaviate Vector Store | Weaviate database | [Docs](https://n8n.io/integrations/weaviate) |
| Zep Vector Store | Zep memory store | [Docs](https://n8n.io/integrations/zep) |
| In-Memory Vector Store | Temporary vector store | [Docs](https://n8n.io/integrations/in-memory-vector-store) |
| Document Default Data Loader | Load documents | [Docs](https://n8n.io/integrations/document-default-data-loader) |
| Recursive Character Text Splitter | Split text into chunks | [Docs](https://n8n.io/integrations/recursive-character-text-splitter) |
| Token Splitter | Split by tokens | [Docs](https://n8n.io/integrations/token-splitter) |
| Vector Store Retriever | Query vector stores | [Docs](https://n8n.io/integrations/vector-store-retriever) |
---
## CRM & Sales
Customer relationship management and sales tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| ActiveCampaign | Marketing automation CRM | [Docs](https://n8n.io/integrations/activecampaign) |
| Affinity | Relationship intelligence | [Docs](https://n8n.io/integrations/affinity) |
| Agile CRM | Sales and marketing CRM | [Docs](https://n8n.io/integrations/agile-crm) |
| Close | Sales CRM | [Docs](https://n8n.io/integrations/close) |
| Copper | Google-integrated CRM | [Docs](https://n8n.io/integrations/copper) |
| Freshsales | Freshworks CRM | [Docs](https://n8n.io/integrations/freshsales) |
| Freshworks CRM | Customer engagement | [Docs](https://n8n.io/integrations/freshworks-crm) |
| HubSpot | Inbound CRM platform | [Docs](https://n8n.io/integrations/hubspot) |
| Intercom | Customer messaging | [Docs](https://n8n.io/integrations/intercom) |
| Keap | Small business CRM | [Docs](https://n8n.io/integrations/keap) |
| Lemlist | Sales engagement | [Docs](https://n8n.io/integrations/lemlist) |
| Mailchimp | Email marketing | [Docs](https://n8n.io/integrations/mailchimp) |
| Pipedrive | Sales CRM | [Docs](https://n8n.io/integrations/pipedrive) |
| Salesforce | Enterprise CRM | [Docs](https://n8n.io/integrations/salesforce) |
| Zendesk | Customer service | [Docs](https://n8n.io/integrations/zendesk) |
| Zoho CRM | Zoho CRM suite | [Docs](https://n8n.io/integrations/zoho-crm) |
---
## Marketing & Email
Email marketing, automation, and outreach tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| AWeber | Email marketing | [Docs](https://n8n.io/integrations/aweber) |
| Brevo | Email and SMS marketing | [Docs](https://n8n.io/integrations/brevo) |
| Campaign Monitor | Email campaigns | [Docs](https://n8n.io/integrations/campaign-monitor) |
| Constant Contact | Email marketing | [Docs](https://n8n.io/integrations/constant-contact) |
| ConvertKit | Creator email marketing | [Docs](https://n8n.io/integrations/convertkit) |
| Customer.io | Messaging automation | [Docs](https://n8n.io/integrations/customerio) |
| Drip | Ecommerce CRM | [Docs](https://n8n.io/integrations/drip) |
| EmailOctopus | Email marketing | [Docs](https://n8n.io/integrations/emailoctopus) |
| GetResponse | Marketing automation | [Docs](https://n8n.io/integrations/getresponse) |
| Instantly | Cold email outreach | [Docs](https://n8n.io/integrations/instantly) |
| Iterable | Growth marketing | [Docs](https://n8n.io/integrations/iterable) |
| Klaviyo | Ecommerce marketing | [Docs](https://n8n.io/integrations/klaviyo) |
| Mailchimp | Email marketing | [Docs](https://n8n.io/integrations/mailchimp) |
| Mailerlite | Email marketing | [Docs](https://n8n.io/integrations/mailerlite) |
| Mailgun | Email API | [Docs](https://n8n.io/integrations/mailgun) |
| Mailjet | Email delivery | [Docs](https://n8n.io/integrations/mailjet) |
| Mautic | Open source marketing | [Docs](https://n8n.io/integrations/mautic) |
| Postmark | Transactional email | [Docs](https://n8n.io/integrations/postmark) |
| SendGrid | Email API | [Docs](https://n8n.io/integrations/sendgrid) |
| Sendinblue | Marketing platform | [Docs](https://n8n.io/integrations/sendinblue) |
---
## Project Management
Task and project management tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| Asana | Work management | [Docs](https://n8n.io/integrations/asana) |
| Basecamp | Project management | [Docs](https://n8n.io/integrations/basecamp) |
| ClickUp | Productivity platform | [Docs](https://n8n.io/integrations/clickup) |
| Jira | Issue tracking | [Docs](https://n8n.io/integrations/jira) |
| Linear | Issue tracking | [Docs](https://n8n.io/integrations/linear) |
| Monday.com | Work OS | [Docs](https://n8n.io/integrations/mondaycom) |
| Notion | Workspace | [Docs](https://n8n.io/integrations/notion) |
| Todoist | Task management | [Docs](https://n8n.io/integrations/todoist) |
| Trello | Kanban boards | [Docs](https://n8n.io/integrations/trello) |
| Wrike | Work management | [Docs](https://n8n.io/integrations/wrike) |
---
## Communication
Messaging and communication platforms.
| Node | Description | Documentation |
|------|-------------|---------------|
| Discord | Gaming community platform | [Docs](https://n8n.io/integrations/discord) |
| Gmail | Google email | [Docs](https://n8n.io/integrations/gmail) |
| Google Chat | Google workspace chat | [Docs](https://n8n.io/integrations/google-chat) |
| IMAP | Email retrieval | [Docs](https://n8n.io/integrations/imap) |
| Matrix | Decentralized chat | [Docs](https://n8n.io/integrations/matrix) |
| Microsoft Outlook | Microsoft email | [Docs](https://n8n.io/integrations/microsoft-outlook) |
| Microsoft Teams | Team collaboration | [Docs](https://n8n.io/integrations/microsoft-teams) |
| Slack | Team messaging | [Docs](https://n8n.io/integrations/slack) |
| Telegram | Messaging app | [Docs](https://n8n.io/integrations/telegram) |
| Twilio | SMS and voice | [Docs](https://n8n.io/integrations/twilio) |
| WhatsApp Business Cloud | WhatsApp messaging | [Docs](https://n8n.io/integrations/whatsapp-business-cloud) |
---
## Databases
Database connections and operations.
| Node | Description | Documentation |
|------|-------------|---------------|
| Airtable | Spreadsheet database | [Docs](https://n8n.io/integrations/airtable) |
| AWS DynamoDB | NoSQL database | [Docs](https://n8n.io/integrations/aws-dynamodb) |
| Azure Cosmos DB | Multi-model database | [Docs](https://n8n.io/integrations/azure-cosmos-db) |
| Baserow | Open source Airtable | [Docs](https://n8n.io/integrations/baserow) |
| Coda | Doc-database hybrid | [Docs](https://n8n.io/integrations/coda) |
| CrateDB | Distributed SQL | [Docs](https://n8n.io/integrations/cratedb) |
| Elasticsearch | Search engine | [Docs](https://n8n.io/integrations/elasticsearch) |
| Firebase Realtime Database | Google realtime DB | [Docs](https://n8n.io/integrations/firebase-realtime-database) |
| Google BigQuery | Data warehouse | [Docs](https://n8n.io/integrations/google-bigquery) |
| Google Sheets | Spreadsheets | [Docs](https://n8n.io/integrations/google-sheets) |
| MariaDB | MySQL fork | [Docs](https://n8n.io/integrations/mariadb) |
| Microsoft SQL | SQL Server | [Docs](https://n8n.io/integrations/microsoft-sql) |
| MongoDB | NoSQL database | [Docs](https://n8n.io/integrations/mongodb) |
| MySQL | Relational database | [Docs](https://n8n.io/integrations/mysql) |
| NocoDB | Open source Airtable | [Docs](https://n8n.io/integrations/nocodb) |
| Postgres | PostgreSQL database | [Docs](https://n8n.io/integrations/postgres) |
| QuestDB | Time series database | [Docs](https://n8n.io/integrations/questdb) |
| Redis | In-memory data store | [Docs](https://n8n.io/integrations/redis) |
| Snowflake | Cloud data warehouse | [Docs](https://n8n.io/integrations/snowflake) |
| SQLite | Embedded database | [Docs](https://n8n.io/integrations/sqlite) |
| Supabase | Postgres platform | [Docs](https://n8n.io/integrations/supabase) |
| TimescaleDB | Time series database | [Docs](https://n8n.io/integrations/timescaledb) |
---
## Cloud & Infrastructure
Cloud services and infrastructure tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| AWS Certificate Manager | SSL/TLS certificates | [Docs](https://n8n.io/integrations/aws-certificate-manager) |
| AWS Cognito | User authentication | [Docs](https://n8n.io/integrations/aws-cognito) |
| AWS IAM | Identity management | [Docs](https://n8n.io/integrations/aws-iam) |
| AWS Lambda | Serverless functions | [Docs](https://n8n.io/integrations/aws-lambda) |
| AWS Rekognition | Image analysis | [Docs](https://n8n.io/integrations/aws-rekognition) |
| AWS S3 | Object storage | [Docs](https://n8n.io/integrations/aws-s3) |
| AWS SES | Email service | [Docs](https://n8n.io/integrations/aws-ses) |
| AWS SNS | Notifications | [Docs](https://n8n.io/integrations/aws-sns) |
| AWS SQS | Message queuing | [Docs](https://n8n.io/integrations/aws-sqs) |
| AWS Textract | Document OCR | [Docs](https://n8n.io/integrations/aws-textract) |
| AWS Transcribe | Speech to text | [Docs](https://n8n.io/integrations/aws-transcribe) |
| Azure Storage | Blob storage | [Docs](https://n8n.io/integrations/azure-storage) |
| Cloudflare | CDN and security | [Docs](https://n8n.io/integrations/cloudflare) |
| DigitalOcean | Cloud infrastructure | [Docs](https://n8n.io/integrations/digitalocean) |
| Docker | Container management | [Docs](https://n8n.io/integrations/docker) |
| Google Cloud Storage | Object storage | [Docs](https://n8n.io/integrations/google-cloud-storage) |
| Kubernetes | Container orchestration | [Docs](https://n8n.io/integrations/kubernetes) |
| Minio | S3-compatible storage | [Docs](https://n8n.io/integrations/minio) |
| Terraform | Infrastructure as code | [Docs](https://n8n.io/integrations/terraform) |
---
## Social Media
Social media platforms and management.
| Node | Description | Documentation |
|------|-------------|---------------|
| Facebook | Social platform | [Docs](https://n8n.io/integrations/facebook) |
| Instagram | Photo sharing | [Docs](https://n8n.io/integrations/instagram) |
| LinkedIn | Professional network | [Docs](https://n8n.io/integrations/linkedin) |
| Medium | Publishing platform | [Docs](https://n8n.io/integrations/medium) |
| Pinterest | Visual discovery | [Docs](https://n8n.io/integrations/pinterest) |
| Reddit | Social news | [Docs](https://n8n.io/integrations/reddit) |
| TikTok | Video platform | [Docs](https://n8n.io/integrations/tiktok) |
| Twitter | Microblogging | [Docs](https://n8n.io/integrations/twitter) |
| YouTube | Video platform | [Docs](https://n8n.io/integrations/youtube) |
---
## E-commerce
E-commerce platforms and payment processing.
| Node | Description | Documentation |
|------|-------------|---------------|
| Chargebee | Subscription billing | [Docs](https://n8n.io/integrations/chargebee) |
| Magento | E-commerce platform | [Docs](https://n8n.io/integrations/magento) |
| Paddle | SaaS payments | [Docs](https://n8n.io/integrations/paddle) |
| PayPal | Payment processing | [Docs](https://n8n.io/integrations/paypal) |
| Recurly | Subscription management | [Docs](https://n8n.io/integrations/recurly) |
| Shopify | E-commerce platform | [Docs](https://n8n.io/integrations/shopify) |
| Stripe | Payment processing | [Docs](https://n8n.io/integrations/stripe) |
| WooCommerce | WordPress commerce | [Docs](https://n8n.io/integrations/woocommerce) |
---
## Developer Tools
Development, version control, and DevOps tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| Bitbucket | Git hosting | [Docs](https://n8n.io/integrations/bitbucket) |
| CircleCI | CI/CD platform | [Docs](https://n8n.io/integrations/circleci) |
| GitHub | Git hosting | [Docs](https://n8n.io/integrations/github) |
| GitLab | DevOps platform | [Docs](https://n8n.io/integrations/gitlab) |
| Jenkins | CI/CD server | [Docs](https://n8n.io/integrations/jenkins) |
| PagerDuty | Incident management | [Docs](https://n8n.io/integrations/pagerduty) |
| Sentry | Error tracking | [Docs](https://n8n.io/integrations/sentry) |
---
## Files & Documents
File storage, document processing, and content management.
| Node | Description | Documentation |
|------|-------------|---------------|
| Box | Cloud storage | [Docs](https://n8n.io/integrations/box) |
| Dropbox | Cloud storage | [Docs](https://n8n.io/integrations/dropbox) |
| FTP | File transfer | [Docs](https://n8n.io/integrations/ftp) |
| Google Drive | Cloud storage | [Docs](https://n8n.io/integrations/google-drive) |
| Microsoft OneDrive | Cloud storage | [Docs](https://n8n.io/integrations/microsoft-onedrive) |
| Microsoft SharePoint | Enterprise content | [Docs](https://n8n.io/integrations/microsoft-sharepoint) |
| Nextcloud | Self-hosted cloud | [Docs](https://n8n.io/integrations/nextcloud) |
| PDF Extract | Parse PDF files | [Docs](https://n8n.io/integrations/pdf-extract) |
---
## Analytics & Monitoring
Analytics, tracking, and monitoring tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| Google Analytics | Web analytics | [Docs](https://n8n.io/integrations/google-analytics) |
| Grafana | Observability | [Docs](https://n8n.io/integrations/grafana) |
| Matomo | Analytics platform | [Docs](https://n8n.io/integrations/matomo) |
| Mixpanel | Product analytics | [Docs](https://n8n.io/integrations/mixpanel) |
| Plausible | Privacy analytics | [Docs](https://n8n.io/integrations/plausible) |
| Prometheus | Monitoring | [Docs](https://n8n.io/integrations/prometheus) |
| Segment | Customer data | [Docs](https://n8n.io/integrations/segment) |
---
## Forms & Surveys
Form builders and survey tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| Cognito Forms | Form builder | [Docs](https://n8n.io/integrations/cognito-forms) |
| Formstack | Form builder | [Docs](https://n8n.io/integrations/formstack) |
| Google Forms | Google forms | [Docs](https://n8n.io/integrations/google-forms) |
| JotForm | Form builder | [Docs](https://n8n.io/integrations/jotform) |
| SurveyMonkey | Survey platform | [Docs](https://n8n.io/integrations/surveymonkey) |
| Tally | Form builder | [Docs](https://n8n.io/integrations/tally) |
| Typeform | Interactive forms | [Docs](https://n8n.io/integrations/typeform) |
---
## HR & Recruiting
Human resources and recruiting tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| BambooHR | HR software | [Docs](https://n8n.io/integrations/bamboohr) |
| Greenhouse | Recruiting | [Docs](https://n8n.io/integrations/greenhouse) |
| Lever | Recruiting | [Docs](https://n8n.io/integrations/lever) |
| Personio | HR platform | [Docs](https://n8n.io/integrations/personio) |
| Workable | Recruiting | [Docs](https://n8n.io/integrations/workable) |
---
## Scheduling & Calendar
Calendar and scheduling tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| Acuity Scheduling | Appointment scheduling | [Docs](https://n8n.io/integrations/acuity-scheduling-trigger) |
| Cal.com | Open source scheduling | [Docs](https://n8n.io/integrations/calcom) |
| Calendly | Meeting scheduling | [Docs](https://n8n.io/integrations/calendly) |
| Google Calendar | Google calendar | [Docs](https://n8n.io/integrations/google-calendar) |
| Microsoft Outlook Calendar | Outlook calendar | [Docs](https://n8n.io/integrations/microsoft-outlook-calendar) |
---
## Support & Helpdesk
Customer support and helpdesk tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| Crisp | Customer messaging | [Docs](https://n8n.io/integrations/crisp) |
| Freshdesk | Helpdesk | [Docs](https://n8n.io/integrations/freshdesk) |
| Help Scout | Customer support | [Docs](https://n8n.io/integrations/help-scout) |
| Zendesk | Customer service | [Docs](https://n8n.io/integrations/zendesk) |
| Zoho Desk | Helpdesk | [Docs](https://n8n.io/integrations/zoho-desk) |
---
## Web Scraping & Data Extraction
Web scraping and data extraction tools.
| Node | Description | Documentation |
|------|-------------|---------------|
| AI Scraper | AI-powered scraping | [Docs](https://n8n.io/integrations/ai-scraper) |
| Apify | Web scraping platform | [Docs](https://n8n.io/integrations/apify) |
| Bright Data | Proxy and scraping | [Docs](https://n8n.io/integrations/bright-data) |
| Firecrawl | Web crawling | [Docs](https://n8n.io/integrations/firecrawl) |
| Spider | Web scraping | [Docs](https://n8n.io/integrations/spider) |
---
## Automation & Integration
General automation and integration platforms.
| Node | Description | Documentation |
|------|-------------|---------------|
| AMQP | Message queuing | [Docs](https://n8n.io/integrations/amqp-sender) |
| GraphQL | GraphQL API calls | [Docs](https://n8n.io/integrations/graphql) |
| MQTT | IoT messaging | [Docs](https://n8n.io/integrations/mqtt) |
| RabbitMQ | Message broker | [Docs](https://n8n.io/integrations/rabbitmq) |
| Webhook | HTTP webhooks | [Docs](https://n8n.io/integrations/webhook) |
| Zapier | Automation platform | [Docs](https://n8n.io/integrations/zapier) |
---
## Additional Resources
- **Full Integration List:** [n8n.io/integrations](https://n8n.io/integrations)
- **n8n Documentation:** [docs.n8n.io](https://docs.n8n.io)
- **Community Templates:** [n8n.io/workflows](https://n8n.io/workflows)
- **Community Forum:** [community.n8n.io](https://community.n8n.io)
---
*This document provides a curated overview of commonly used n8n nodes. For the complete list of 500+ integrations, visit the official n8n integrations page.*
references/n8n-workflow-automation-guide.md
# n8n: A Complete A-Z Beginner's Guide to Workflow Automation
## Table of Contents
1. [Introduction: What is n8n?](#introduction-what-is-n8n)
2. [n8n in Context: History and Comparisons](#n8n-in-context-history-and-how-it-compares-to-other-tools)
3. [Installation Options](#installation-options-n8n-cloud-vs-self-hosted)
4. [Getting Started](#getting-started-step-by-step-setup-for-n8n)
5. [Navigating the Visual Editor](#navigating-the-n8n-visual-editor)
6. [Key Concepts in Workflows](#key-concepts-in-n8n-workflows)
7. [Types of Nodes](#types-of-nodes-triggers-webhooks-functions-and-more)
8. [Connecting to External APIs](#connecting-to-external-apis-with-and-without-coding)
9. [Using Webhooks](#using-webhooks-to-receive-data)
10. [Building Workflows](#building-workflows-visually-step-by-step-example)
11. [Scheduling and Triggering](#scheduling-and-triggering-workflows)
12. [Error Handling](#handling-errors-retries-and-logging)
13. [Example Use Cases](#example-use-cases-for-n8n)
14. [Extending n8n](#extending-n8n-community-nodes-and-custom-integrations)
15. [Security Best Practices](#security-best-practices-for-n8n)
16. [Deployment and Scaling](#deployment-and-scaling-for-self-hosted-n8n)
17. [Troubleshooting](#limitations-common-mistakes-and-troubleshooting-tips)
---
## Introduction: What is n8n?
n8n is an open-source workflow automation tool that lets you connect different apps, services, and data without needing to write code. It's like a digital assembly line for your tasks - you set up a series of steps (called a workflow) and n8n automatically moves data through those steps to get things done.
Each step is a **node** that might fetch data, send a message, or perform some action. n8n provides a visual editor where you can drag and drop these nodes and connect them, making automation design accessible even if you aren't a programmer.
### Key Characteristics of n8n
- **Open Source & Self-Hostable:** First released in 2019 as an open-source alternative to proprietary automation tools. You can run it on your own server for free (Community Edition), ensuring full control over your data.
- **Cloud or On-Premise:** Use n8n Cloud (hosted by the n8n team) or install on your own machine/server.
- **Visual "No-Code" Interface:** Build workflows with a point-and-click approach. Create nodes and connect them with arrows, defining how data flows.
- **Code Flexibility:** While no-code friendly, n8n caters to power users with function nodes (JavaScript code) or custom nodes.
- **Connect Anything:** n8n connects to hundreds of apps through built-in nodes (integrations). If an app isn't supported out-of-the-box, use a generic HTTP node or community node.
---
## n8n in Context: History and How It Compares to Other Tools
### Comparison with Other Tools
| Tool | Year | Type | Key Characteristics |
|------|------|------|---------------------|
| **Zapier** | 2011 | Cloud SaaS | Very user-friendly, simple trigger-action recipes, limited flexibility |
| **Integromat/Make** | 2012 | Cloud SaaS | Advanced visual builder, complex logic, closed-source |
| **n8n** | 2019 | Open Source | Self-hostable, extensible, code flexibility, fair-code license |
### Positioning
- **Zapier:** Very easy (plug-and-play) but less flexible in complex scenarios
- **Make and n8n:** Handle complex logic and large workflows; Make is proprietary, n8n is open-source
- **n8n:** Chosen for control, avoiding subscription costs, hosting data on-premises, or extending with custom code
### Analogy
- **Zapier:** Ready-to-eat meal - convenient but limited options
- **n8n:** Home-cooked meal - requires effort but full freedom to customize
### How Integrations Work
- **APIs:** Like phone numbers - you call to request or send information
- **Webhooks:** Like getting an incoming call - set up your number and get notified when something happens
- **Automation tools (n8n/Zapier):** Like a receptionist who knows all numbers and handles calls for you
---
## Installation Options: n8n Cloud vs Self-Hosted
### n8n Cloud (Hosted)
**Pros:**
- No installation needed - start in minutes
- Managed updates, bug fixes, and scaling
- Support and reliability
- Free trial available
**Cons:**
- Cost after free tier
- Less control over data
- Some community nodes unavailable
### Self-Hosted n8n
**Pros:**
- Full control over instance and data
- Free Community Edition
- Unlimited workflows (hardware limited)
- Offline usage possible
**Cons:**
- Technical skill required
- Responsible for maintenance, updates, backups
- Initial setup overhead
### Choosing Between Them
- **Total beginner with no tech background:** Start with n8n Cloud
- **IT resources or data control needs:** Consider self-hosting
- **Prototype on Cloud, migrate to self-host** as you scale
---
## Getting Started: Step-by-Step Setup for n8n
### Setting Up n8n Cloud
1. **Sign Up:** Go to n8n.io and sign up for Cloud service
2. **Log In:** Access the n8n dashboard
3. **Create Workflow:** Click "Start from scratch"
4. **Name and Save:** Give your workflow a name
5. **Ready to Build:** Start adding nodes
### Setting Up n8n Self-Hosted
#### Prerequisites
- Machine with modern OS (Linux, Windows, or Mac)
- Docker installed OR Node.js (version 16+)
- For production: PostgreSQL database (SQLite works for quick start)
#### Method 1: Docker (Recommended)
```bash
docker run -it --rm -p 5678:5678 n8nio/n8n
```
Open browser to `http://localhost:5678`
#### Method 2: Node.js (npm)
```bash
npm install --global n8n
n8n
```
#### Post-Installation Considerations
- Switch to PostgreSQL for production
- Mount volume for `/home/node/.n8n` for data persistence
- Set `N8N_ENCRYPTION_KEY` environment variable
- Secure editor behind authentication
---
## Navigating the n8n Visual Editor
### Main Components
- **Workflow Canvas:** Drag-and-drop space for building automation flows
- **Nodes:** Building blocks representing specific tasks/actions
- **Nodes Panel:** Browse or search for nodes to add
- **Connections:** Lines connecting nodes determining execution order and data flow
- **Trigger Node Position:** Special node that starts workflows (marked with lightning bolt)
- **Node Configuration Pane:** Settings panel for each node
- **Workflow Top Bar:** Execute, Activate/Deactivate, Save, Settings
- **Sidebar:** Workflows, Credentials, Executions, Templates
- **Logs & Output Panel:** Shows execution logs and debugging info
---
## Key Concepts in n8n Workflows
### 1. Workflow
The entire automation recipe - a set of connected nodes from start to finish.
### 2. Nodes
Individual steps or building blocks. Each node has a specific function (fetch data, calculate, send output).
### 3. Triggers
Special nodes that **start** a workflow:
- **Time-based:** Cron/Schedule Trigger
- **Webhook trigger:** Provides URL for external HTTP requests
- **App-specific triggers:** IMAP Email, Stripe, etc.
- **Manual trigger:** Button press for testing
### 4. Actions (Regular Nodes)
Steps that follow triggers, performing tasks like:
- Querying APIs
- Transforming data
- Sending outputs to services
### 5. Credentials
Stored login details or API keys for external services. Encrypted in database.
### 6. Parameters
Settings/fields you configure on each node.
### 7. Data (Items)
JSON structures passed between nodes. Each node can add or modify data.
### 8. Workflow Execution
Each run of a workflow (triggered or manual). Tracked in Executions list.
### 9. Success vs Error Paths
By default, errors stop workflow execution. Enable "Continue On Fail" to handle errors inline.
---
## Types of Nodes: Triggers, Webhooks, Functions, and More
### 1. Trigger Nodes
- **Cron (Schedule Trigger):** Fires on time schedule
- **Webhook Trigger:** Provides URL for incoming HTTP requests
- **App/Event Triggers:** Telegram, Gmail, Shopify triggers
- **n8n Trigger:** Fires on manual start or instance start
### 2. HTTP Request Node
Most versatile action node - call any web API by configuring URL, method, headers, parameters, and body.
### 3. Function & Code Nodes
Write custom JavaScript code within workflow:
- **Function:** Processes all incoming items at once
- **Function Item/Code:** Runs for each item individually
### 4. Set Node
Set or modify data fields without coding.
### 5. IF Node (Conditional)
Branching based on condition - outputs to true or false branches.
### 6. Merge and Split Nodes
- **Merge:** Combine two data streams
- **Split In Batches:** Break list of items into batches
### 7. Service-Specific Nodes
- Google Sheets, Slack, Database nodes
- Email nodes (IMAP, SMTP)
- AI nodes (OpenAI, etc.)
### 8. Community Nodes
Third-party contributed nodes for niche services or extended functionality.
---
## Connecting to External APIs (With and Without Coding)
### Three Approaches
#### 1. Built-in Integration Nodes (No Code)
Use dedicated nodes (GitHub, Airtable, etc.) with pre-built operations.
#### 2. HTTP Request Node (Low Code)
Call API endpoints manually - configure URL, method, auth in fields.
#### 3. Function Nodes (With Code)
Write JavaScript for complex scenarios (e.g., HMAC signatures, client libraries).
### Example: Joke API + Email
```
[Schedule Trigger] → [Fetch Joke (HTTP GET)] → [Send Email (HTTP POST)]
```
1. Schedule Trigger every 5 minutes
2. HTTP Request GET to `https://icanhazdadjoke.com/` with `Accept: application/json` header
3. HTTP Request POST to Resend API with joke in body
### Using Credentials
- Set up in Credentials section or when adding node
- Stored encrypted in database
- Prefer OAuth when available
---
## Using Webhooks to Receive Data
### How Webhooks Work in n8n
1. **Add Webhook Trigger node** - generates unique URL
2. **Configure** - choose GET or POST, test vs production mode
3. **Use URL in external service** - provide to service that sends data
4. **Process incoming data** - add nodes to handle the webhook payload
### Example: Form Submissions
1. Add Webhook Trigger, copy URL
2. Set URL as webhook target in form service
3. n8n triggers on submission, outputs form fields
4. Add Mailchimp node to subscribe user
5. Optionally add Respond to Webhook node
### Testing Webhooks
- Use "Test" mode in Webhook node
- Workflow waits for one incoming request
- Switch to production URL when done
### Security Considerations
- Treat webhook URLs as secret
- Enable authentication (Basic Auth or header keys)
- Validate payloads (check signatures)
- Sanitize/validate input data
---
## Building Workflows Visually: Step-by-Step Example
### Example: Daily Weather Email
**Scenario:** Fetch weather every morning, email if rain is likely.
#### Steps
1. **Create New Workflow** - name it "Daily Weather Alert"
2. **Add Schedule Trigger**
- Every 1 day at 7:00 AM
3. **Add HTTP Request Node**
- URL: Open-Meteo API with lat/lon and precipitation params
- Method: GET
4. **Add IF Node**
- Condition: `$json["daily"]["precipitation_probability"][0]` > 50
5. **Add Email Node (True Branch)**
- Gmail or SMTP node
- Subject: "Rain Alert"
- Body: "It might rain today!"
6. **Handle False Branch** (Optional)
- Leave unconnected or send "No rain" email
7. **Test Workflow**
- Execute manually
- Check email
8. **Activate**
- Toggle switch to make active
### Key Concepts Demonstrated
- **Connecting Nodes:** One node's output feeds into the next
- **Mapping Data:** Use expressions like `{{$json["field"]}}`
- **Parallel vs Sequential:** Branching creates parallel paths
- **Testing Individually:** Use "Execute Node" button
---
## Building an AI Chat Agent with n8n
### Steps
1. **Create new workflow**
2. **Add Chat Trigger** - built-in chat window for testing
3. **Add AI Agent node** - orchestrates conversation with LLM
4. **Attach chat model** - OpenAI Chat Model (e.g., gpt-4o-mini)
5. **Add credentials** - OpenAI API key
6. **Test** - open chat panel, send message
7. **Customize system prompt** - AI Agent → Options → System message
8. **Add memory** - Simple Memory for context persistence
9. **Save & activate**
### What's Happening
- **Chat Trigger:** Provides chat UI, emits user messages
- **AI Agent:** Orchestrates conversation, can use tools
- **System message:** Sets agent's personality and guardrails
- **Memory:** Stores recent turns for context
---
## Scheduling and Triggering Workflows
### Trigger Types
- **Manual Execution:** Click "Execute Workflow" in editor
- **Time-Based:** Schedule Trigger (Cron)
- **Event-Based:** Webhooks and app-specific triggers
- **API/Sub-workflows:** Execute Workflow node, n8n API
### Activating Workflows
- Toggle workflow to active for triggers to work
- For Cron: schedules job in background
- For Webhooks: starts listening on URL
### Concurrency and Queue
- Default: one execution at a time per instance
- Queue mode available for parallelism and high throughput
### Tips
- Avoid extremely frequent schedules
- Prefer webhooks over polling when available
- Use IF nodes for conditional running (e.g., only weekdays)
---
## Handling Errors, Retries, and Logging
### 1. Built-in Error Behavior
Default: errors stop workflow, logged in Executions list.
### 2. Continue On Fail
Enable per node - outputs error object, workflow continues.
### 3. Error Trigger Workflow
Create dedicated error handling workflow:
1. Create workflow with Error Trigger node
2. In main workflow settings, set Error Workflow
3. Error workflow receives failure details
4. Send alerts, log errors, etc.
### 4. Retries
Options:
- Loop with counter (Function + retry logic)
- Auto Retry Workflow (error workflow re-queues)
- n8n Cloud may have built-in retry settings
### 5. Logging and Monitoring
- Executions list shows all past runs
- Log streaming to external tools (enterprise)
- `/metrics` endpoint for Prometheus
- Cloud: built-in dashboards
### Debugging Tips
- Use Debug panel to inspect node input/output
- Insert temporary Set nodes for inspection
- Read error messages carefully
- Use community forum for help
---
## Example Use Cases for n8n
1. **Lead Capture and CRM Update:** Form submission → Create CRM contact → Send welcome email
2. **Content Syndication:** New blog post → Share to Twitter, Facebook, LinkedIn, Slack
3. **E-commerce Order Processing:** New order → Generate invoice PDF → Upload to Drive → Email customer
4. **Notifications & Alerts:** Server down → Slack message + SMS + Jira ticket
5. **Reports and Dashboards:** Weekly → Pull analytics data → Compile report → Email
6. **Data Synchronization:** User update in System A → Update in System B
7. **AI-driven Workflows:** New ticket → AI categorization → Route based on urgency
8. **Community & Social Automation:** Keyword mention on Twitter → Log or auto-respond
9. **IoT and Home Automation:** Sensor trigger → Send notification or control device
---
## Extending n8n: Community Nodes and Custom Integrations
### Community Nodes
**Finding:** Check n8n Integrations section or Community forum.
**Installing:**
1. **GUI:** Built-in way to install verified community nodes
2. **Command Line:** `npm install n8n-nodes-someintegration`
3. **Docker:** Use `N8N_INSTALL_PACKAGES` environment variable
**Risks:** Not official, may not be rigorously tested. Use trusted sources.
### Creating Custom Nodes
For developers:
1. Set up project using n8n node dev tooling
2. Define node (inputs, outputs, parameters, logic)
3. Compile and install as community package
### Templates
Pre-built workflows for common tasks - accessible via Templates menu.
### Using Code Directly
- **Function/Code Nodes:** Inline JS for quick tasks
- **Execute Command Node:** Run shell commands (use with caution)
---
## Security Best Practices for n8n
### Access Protection
- Use strong passwords, enable 2FA
- Put n8n behind authentication
- Use role-based access control (enterprise)
### Use HTTPS
- Encrypt data in transit
- Use reverse proxy with SSL certificate
### Firewall and Network (Self-Host)
- Close unnecessary ports
- Lock down SSH
- Consider VPN or Cloudflare Tunnel
### Credential Security
- Set persistent `N8N_ENCRYPTION_KEY`
- Use OAuth when possible
- Regularly rotate credentials
- Never expose in plaintext
### Webhook Security
- Enable webhook authentication
- Validate payloads and signatures
- Treat URLs as secret
### Updates and Patching
- Stay up to date with n8n releases
### Limit Resource Exposure
- Disable unused features (Execute Command)
- Only install trusted community nodes
### Backups
- Backup workflows and credentials securely
- Encrypt backups
---
## Deployment and Scaling for Self-Hosted n8n
### Deployment Options
- **Docker Compose:** n8n + PostgreSQL + Redis
- **One-Click Apps:** DigitalOcean marketplace, cloud templates
- **Traditional Node.js:** PM2 or systemd for process management
- **Kubernetes:** For advanced/enterprise setups
### Database Considerations
- **Default:** SQLite (fine for low volume)
- **Production:** PostgreSQL or MySQL
- Multiple instances must share same database
### Scaling Up (Vertical)
- More CPU/RAM
- Configure concurrency
- Monitor resource usage
### Scaling Out (Horizontal with Queue Mode)
1. Main instance coordinates triggers and UI
2. Jobs pushed to Redis queue
3. Worker instances pull and execute
4. Provides parallelism and resilience
Requirements:
- Redis server
- Same database and encryption key for all instances
### High Availability
- Run with redundancy
- Use database clustering
- Have standby instances ready
### Backups and Versioning
- Export workflows regularly
- Backup database
- Enable workflow version history
---
## Limitations, Common Mistakes, and Troubleshooting Tips
### Known Limitations
- **Single Execution (Default):** One workflow at a time per instance
- **Memory Usage:** Large data can cause issues
- **No Transaction Rollback:** Must design compensating actions
- **Function Node Limits:** Can't use arbitrary npm packages
### Common Mistakes
1. **Forgetting to Activate Workflows**
2. **No Error Handling**
3. **Giant Linear Workflows** - break into sub-workflows
4. **Ignoring Webhook Security**
5. **Overusing Function Nodes** - use built-in nodes when possible
6. **Hardcoding Values** - use credentials and environment variables
7. **Not Testing with Real Data**
8. **Not Using Workflow Logs**
9. **Skipping Credentials Setup**
10. **Resource Cleanup** - delete temp files
11. **Infinite Loop Workflows** - use conditions to prevent
### Troubleshooting Tips
- **Read error messages** - identify failed node
- **Use Debug panel** - inspect data at each step
- **Simulate triggers manually** - ensure logic works
- **Check timezone settings** - for schedule triggers
- **Search community forum** - others likely had similar issues
- **Label nodes descriptively** - easier to follow logs
- **Upgrade if issues persist** - check for bug fixes
---
## Resources
- [n8n Official Documentation](https://docs.n8n.io/)
- [n8n Community Forum](https://community.n8n.io/)
- [n8n Templates](https://n8n.io/workflows/)
- [n8n GitHub](https://github.com/n8n-io/n8n)
SKILL.md
---
name: n8n-automation
description: Designs, builds, debugs, and documents n8n workflows and AI agent automations. Use when the user mentions "n8n," "workflow automation," "n8n nodes," "automation flow," "AI agent workflow," "n8n trigger," or wants to build automated workflows connecting apps and services.
version: "1.0.0"
argument-hint: "[workflow-type] [integration]"
---
# n8n Automation Assistant
Expert assistant for designing, building, and debugging n8n workflows and AI agent automations.
## Role
You are an **n8n Workflow Engineer** specializing in:
- Workflow architecture and design
- Node selection and configuration
- AI agent integration patterns
- Trigger and execution logic
- Error handling and reliability
- Integration between 500+ apps and services
## Core Concepts
### What is n8n?
n8n is an open-source workflow automation platform that:
- Connects apps and services via nodes
- Supports triggers, actions, and conditional logic
- Enables AI agent workflows with LangChain integration
- Can be self-hosted or cloud-hosted
### Workflow Components
| Component | Purpose |
|-----------|---------|
| **Trigger nodes** | Start workflows (webhooks, schedules, app events) |
| **Regular nodes** | Process data, call APIs, transform data |
| **AI nodes** | LLM calls, agents, tools, memory |
| **Core nodes** | Control flow (IF, Switch, Merge, Loop) |
## Workflow Design Process
### Step 1: Define the Goal
Clarify:
- What triggers the workflow?
- What data needs to flow through?
- What is the desired output/action?
- What error conditions exist?
### Step 2: Map the Flow
1. Identify trigger type
2. List required integrations
3. Define data transformations
4. Plan error handling
5. Consider rate limits and quotas
### Step 3: Select Nodes
Use the node reference to find:
- Trigger nodes for your data source
- Action nodes for each integration
- Transform nodes for data manipulation
- Conditional nodes for branching logic
### Step 4: Configure and Test
- Test each node individually
- Use test data before production
- Verify error paths
- Check execution logs
## Common Workflow Patterns
### Data Sync Pattern
```
Trigger (Schedule/Webhook) → Fetch Data → Transform → Update Destination
```
### Notification Pattern
```
Trigger (Event) → Filter/Condition → Format Message → Send Notification
```
### AI Agent Pattern
```
Trigger → AI Agent Node → Tools (API calls, Search) → Response Handler
```
### Multi-Step Processing
```
Trigger → Split Data → Process Each → Merge Results → Output
```
## AI Agent Workflows
### Agent Node Configuration
n8n supports AI agents via LangChain integration:
- **Chat models**: OpenAI, Anthropic, Bedrock
- **Tools**: Custom API calls, code execution
- **Memory**: Conversation history, vector stores
- **Output parsers**: Structured data extraction
### Agent Prompt Formula
When configuring AI agent prompts:
1. Define the agent's role clearly
2. Specify available tools and when to use them
3. Set output format expectations
4. Include error handling instructions
## Output Format
When designing workflows:
```
## Workflow Overview
[Purpose and trigger]
## Node Sequence
1. [Node Type]: [Configuration]
2. [Node Type]: [Configuration]
...
## Data Flow
[How data transforms between nodes]
## Error Handling
[What happens when things fail]
## Testing Plan
[How to verify the workflow works]
```
When debugging:
```
## Issue Analysis
[What's failing and why]
## Root Cause
[The underlying problem]
## Solution
[Step-by-step fix]
## Prevention
[How to avoid this in future]
```
## Node Categories
### Triggers
- Webhook, Schedule, Manual
- App-specific triggers (Gmail, Slack, Airtable, etc.)
- AMQP, Kafka, Redis queues
### Data Operations
- HTTP Request, GraphQL
- Database nodes (Postgres, MySQL, MongoDB)
- Spreadsheet nodes (Google Sheets, Airtable)
- File operations (Read, Write, FTP)
### AI & Language
- Anthropic, OpenAI, AWS Bedrock
- LangChain agents and tools
- Text classification, embeddings
- Document loaders
### Flow Control
- IF, Switch, Merge, Split
- Loop, Wait, Stop
- Error Trigger, Retry
## Reference Files
- [n8n Nodes List](references/n8n-nodes-masterlist.md) - Complete list of 500+ n8n nodes with descriptions
## Constraints
- Always consider rate limits when designing workflows
- Test with small data sets before scaling
- Include error handling for every external API call
- Use credentials properly (never hardcode secrets)
- Consider execution timeout limits
- Document complex workflows for maintainability