The video provides a comprehensive guide to n8n, an automation platform, focusing on mastering its most frequently used features. It demonstrates building three automations: a simple daily weather email, a form-driven inquiry router, and an advanced AI personal assistant. The tutorial also covers n8n's core concepts, node types, self-hosting options, and the distinction between automations and dynamic agents.
Introduction to n8n and Core Concepts #
- What is n8n?
- Node-based automation platform with growing popularity, especially for AI agents.
- Automations vs. Agents
- Automations: Fixed, set sequence (A to B to C), even with branches or AI.
- Agents: Dynamic, can reason, make decisions, and choose actions based on context.
- Use Cases for n8n
- Personal Productivity: AI assistants for email, calendar, documents.
- Marketing & Business: Automate social media, CRM, customer onboarding, sales processes.
- E-commerce: Sync product data, process orders, handle customer support.
- Data & Reporting: Pull, clean, and generate reports from multiple sources.
- Home & Lifestyle: Smart home integration, time/location-based routines.
- AI Integrations: Connect language models, image tools, custom APIs for summarization, content creation, complex agents.
Building Automation 1: Daily Weather Email #
- Objective: Create a simple automation to run daily, check the weather, and email it.
- Workflow Setup:
- New workflow named "daily weather."
- Trigger Node (Schedule):
- Sets workflow to run daily at 6 AM.
- Trigger interval: days, 1 day between, trigger hour: 6, minutes: 0.
- Action Node (OpenWeather):
- Connects to Open Weather API to get current weather data.
- Credentials Setup:
- Create an account on openweather.org.
- Copy API key from "API keys" section.
- Paste into n8n's access token field.
- Settings:
- Current weather, Imperial units, By zip code (enter zip code).
- Testing: Use "Test Step" to verify data retrieval.
- Data Structure: Left side (input from previous node), middle (settings), right side (output to next node). Output data viewable as schema, table, or JSON.
- Action Node (Gmail):
- Sends an email with weather information.
- Credentials Setup: Sign in with Google, approve access.
- Settings:
- Recipient email (personal email).
- Subject: "Daily weather."
- Email type: Text.
- Message populated dynamically by dragging data fields (temperature, location, min/max temp, wind speed) from the OpenWeather output.
- Disable "append nad attribution" option.
- Final Steps:
- Save regularly.
- "Test Workflow" to run end-to-end.
- Check email for successful delivery.
- Canvas Tips:
- Broom icon to tidy up layout.
- Zoom in/out, "zoom to fit" to center.
- Executions Tab: View past workflow runs, success/failure status.
- "Copy to editor" to revert to previous version.
- Activate workflow (toggle "active") to run automatically.
Account Setup & Self-Hosting n8n #
- n8n Cloud: Easiest option, $20/month after free trial.
- Self-Hosting: More control, lower cost, two methods:
- Local Install with Docker: More technical, not covered in video.
- Virtual Private Server (VPS): Easier middle ground, used by presenter.
- Hostinger VPS (Sponsor):
- One-click installation template for n8n.
- Select "self-hosted NAD option" under VPS services.
- KVM2 plan recommended.
- Use coupon code "Futuredia."
- Manage app, activate free license key (sent via email).
Core Node Types #
- Categories:
- Triggers: Initiate workflows (schedule, form, chat input, webhook).
- Actions: Pre-built integrations (Google products, weather, NASA, Notion, Airtable, Spotify, Stripe, etc.).
- HTTP Request: Universal adapter for connecting to any API not on the pre-built list.
- Logic Nodes: Control data flow (filter, branch, merge, loop – e.g., "if yes, do this; if no, do that").
- AI Agent Node: Powers final build, connects to LLMs, adds memory, attaches tools.
Building Automation 2: Form-Driven Inquiry Router #
- Objective: Route sponsorship inquiries based on budget, auto-respond via email, and log to Google Sheet.
- Workflow Setup:
- New workflow.
- Trigger Node (Form Submission):
- Uses n8n's default test forms (or any form platform like HubSpot).
- Add fields: Company Name, Contact Name, Email, Website, Budget (number), Notes (text area).
- Pin Data: After filling out and submitting the test form, pin the data to avoid re-entering for testing.
- Logic Node (Switch):
- Routes forms based on budget size.
- Drag "budget" field into condition.
- Rule 1: "is less than" 1 million (for "lowball" offers).
- Rule 2: "is greater than or equal to" 1 million (for "serious" offers).
- Creates two separate branches.
- Action Node (Gmail - for both branches):
- Credentials Setup: More steps for self-hosted Google credentials (documentation link provided). Client ID and Client Secret needed.
- Settings:
- Recipient: Drag "email" field from form input.
- Subject: Dynamic (e.g., "Hello [company name]").
- Message: Dynamic (e.g., "Sam Altman, how dare you waste my time..." or "I'm listening...").
- Disable n8n attribution.
- Duplicating Nodes: Duplicate the first Gmail node for the second branch and adjust message.
- Action Node (Google Sheets - for both branches):
- Add a new row with form data.
- Credentials Setup: Add Google Sheets API from Google Console, enable, use same Client ID/Secret.
- Sheet Creation: Create a new Google Sheet (e.g., "sponsor inquiry tracker") with columns for all form fields + "action."
- Settings:
- Document: Paste sheet URL.
- Sheet: Select "sheet one."
- Populate columns: Drag data fields from form input.
- "Action" column: Manually enter "decline" or "follow up sent."
- Test step.
- Duplicate for the second branch and adjust the "action" text.
- Refinements:
- Rename nodes for clarity.
- Rename switch node paths.
- Unpin data and "clear execution" before full workflow test.
- Test with different budget amounts to verify branching.
- Expansion Ideas:
- Enrich Lead: Use AI agent to research company, summarize, or pull LinkedIn profiles/scrape sites.
- Merge Nodes: Combine data from multiple sources (e.g., scraping multiple subreddits).
- Set Nodes: Clean or reshape data (e.g., remove dollar signs from budget field if it was a text input).
Understanding JSON #
- JSON (JavaScript Object Notation): How data moves through nodes.
$
JSON: Refers to data from the previous node (e.g.,$json.budget
means the "budget" field from the previous node's output).- Specific Node Data: For data from earlier nodes, specifies the node name (e.g.,
{{$json["On Form Submission"].company}}
means "company" field from "On Form Submission" node). - Brackets: Used for fields with spaces (e.g.,
["Company Name"]
). - Practical Use: Drag and drop fields are primary; no need to write JSON from scratch. ChatGPT can explain/generate snippets.
- Advanced Expressions:
math.round()
for cleaning numbers; more complex expressions for data cleaning (ask ChatGPT).
AI Agent Node, HTTP Requests & APIs #
- Agent Types:
- Automation: Static, rule-based, fixed path.
- Agent: Dynamic, flexible, reasons, plans, decides tools.
- Agent Core Components:
- Brain: Large Language Model (LLM) for reasoning and language (ChatGPT, Claude, Gemini).
- Memory: Provides context, remembers past interactions (conversation history, external docs, vector database).
- Tools: How the agent interacts with the outside world (retrieve data, take action, orchestrate other workflows/agents).
- HTTP Requests & APIs:
- API (Application Programming Interface): How software communicates (like vending machine buttons).
GET
Request: Pulls information (e.g., weather, video, news feed).POST
Request: Sends information (e.g., form submission, add to sheet, prompt to LLM).- HTTP Request Node: Used for APIs not covered by built-in integrations.
- Example (Air Quality Data):
airnow.gov
has air quality API but no built-in n8n integration.- Use HTTP Request node (
GET
request). - Find API documentation, generate URL (e.g., query tool on
airnow.gov
). - Paste URL into n8n's HTTP Request node.
- Combine with existing weather data using a merge node for a single email.
Building AI Personal Assistant Agent #
- Objective: Create an AI agent that manages calendar, emails, and documents, with custom tools for Reddit, YouTube, and video generation.
- Workflow Setup:
- Trigger Node (Chat Trigger): For interacting within n8n.
- Can be later swapped for Slack, WhatsApp, Telegram, Discord.
- AI Agent Node:
- Brain (LLM):
- Select OpenAI.
- Credentials: Go to
platform.openai.com/s
, add funds, create API key, copy immediately, paste into n8n. - Model: GPT4o.
- Memory: Simple memory (e.g., 10 messages) for built-in chat.
- Tools:
- Google Calendar: Set read-only permission (summarize schedule) or full permission (add/change events).
- Gmail: Set read-only (summarize emails) or full permission (send emails).
- Google Sheet: Connect to the sponsor intake sheet (same selection as before).
- System Prompt:
- Click "Add Options," then "System Message."
- Content (ask ChatGPT to generate): Role (personal assistant), instructions, tools available and when to use them, relevant context, restrictions.
- Brain (LLM):
- Trigger Node (Chat Trigger): For interacting within n8n.
- Testing Initial Agent:
- Open chat in n8n.
- Ask "What do you think of NAD?" (tests LLM).
- Ask "Summarize my recent emails." (tests Gmail tool).
- Ask "Do I have any good sponsorship requests?" (tests Google Sheet tool).
- Ask "What openings do I have on my calendar tomorrow?" (tests Google Calendar tool).
- Ask "Draft an email response for me and include the two options I have free for meetings during the day." (tests LLM + tools).
- Advanced Tool Integration (Calling Other Workflows/Agents):
- Problem: Adding all tools into one agent makes it hard to organize and for agent to reason.
- Solution: Create separate workflows (sub-agents) for specific tasks (e.g., calendar agent, Gmail agent) that the main agent can call.
- Example Calendar Agent: Separate workflow with trigger "When executed by another workflow."
- Integrating Sub-Agents:
- Delete original Google Calendar tool from main agent.
- Add "Call n8n Workflow" tool.
- Choose calendar agent from list.
- Input fields: Use
{{$json["parameter_name"]}}
or click stars for model to define automatically. - Update system prompt to inform agent about the new sub-agent.
- Full Personal Assistant Demo:
- Main agent has calendar, Gmail, documents as sub-agents.
- Additional custom tools: Reddit Curator, YouTube Summarizer, YouTube Shorts Creator (HTTP Request to another workflow).
- All tools documented in the system prompt.
- Demo Interactions:
- "What are the comments like on my recent YouTube video?" (triggers YouTube summarizer -> processes with LLM).
- "What are the best recent posts about AI on Reddit?" (triggers Reddit curator -> scrapes multiple subreddits -> processes with LLM).
- "Post an AISMR short to my YouTube channel." (triggers YouTube Shorts creator workflow via webhook for async processing).
Final Tips #
- Expect Errors: Part of the process, test, iterate, adjust.
- Use ChatGPT as Build Partner: Train it on n8n docs.
- Keep Exploring:
- Retrieval Augmented Generation (RAG): Uses vector databases (e.g., Pine Cone) for larger knowledge bases beyond chat history or Google Docs.
- n8n Templates: Thousands available to learn from and build upon.
- Futuredia Course Platform: Over 500 lessons on AI (ChatGPT, prompt engineering, custom GPTs, etc.).
last updated: