/content-research.json |
| /research --topic "..." | Runs research on a topic directly | No Notion calendar lookup needed |
| python src/main.py run-agent --agent content_researcher --topic "..." | CLI equivalent of the topic-based slash command | Use if you have not wired up the slash command |
| Output JSON fields | executive_summary, key_findings, competitor_coverage, recommended_angle, suggested_outline, sources | Structured brief the agent always returns |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Agent output reads generic, like plain ChatGPT, not tailored to your business | Confirm the agent's system prompt loads business-context.md, content-strategy.md, and competitor-watchlist.md as Step 1 before any research |
| Agent can't search or scrape anything | Complete the Article 1 foundation first: Claude Code CLI, Node.js, Perplexity and Firecrawl API keys, both MCP servers configured in Claude Code settings |
| Trying to do this kind of research inside Claude Projects | Claude Projects can't reach MCP tools, so Perplexity search and Firecrawl scraping have to be done by hand, copy-pasting for every session |
| Reaching for n8n for a one-off, right-now research task | n8n needs 2+ hours of setup (hosting, API nodes, workflow building) plus monthly hosting costs; it fits scheduled or triggered research, not ad-hoc |
| No Notion content calendar to look up a post ID | Skip the ID lookup and run with the --topic flag instead: python src/main.py run-agent --agent content_researcher --topic "your topic" |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **PubFlow OS Agents: Build Your AI Research Team**.
Read Lesson 2 on Substack →
## More in this section
- [Lesson 3: My AI Agent Analyzes SERPs and Optimizes for ChatGPT (Build Log #3)](/courses/pubflow-agents/lessons/my-ai-agent-analyzes-serps-and-optimizes-for-chatgpt/)
## Continue the course
Browse all lessons in the [PubFlow OS Agents: Build Your AI Research Team](/courses/pubflow-agents/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.gumroad.com/l/content-os-ai-agents) to get new lessons in your inbox.
---
# Zero-Shot, One-Shot, and Few-Shot Prompting Explained
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/zero-shot-one-shot-and-few-shot-prompting-explained/
> Three fundamental prompting patterns with practical examples
Zero-shot, one-shot, and few-shot prompting are three ways to structure an LLM prompt: give instructions only, add one example, or add two to five examples of the input-output pattern you want. This lesson covers when to use each method, how many examples to include, and how to combine instructions with examples for reliable, consistent output.
## What you will be able to do
- Choose between zero-shot, one-shot, and few-shot prompting based on how common or unusual the task is
- Write few-shot prompts using 2 to 5 examples that are varied but consistent, so the model learns the pattern instead of overfitting
- Structure a combined prompt in order: role, goal, task, instructions, examples, context/input, rules, format
- Decide how many examples to use, starting with 2 and adding more only when results come back inconsistent
- Adapt the newsletter subject line, social post, and customer support reply templates to your own recurring writing tasks
## Before you start
- Access to an LLM such as ChatGPT, Claude, or Gemini
- A specific recurring task in mind (subject lines, captions, support replies, meeting notes) to apply the patterns to
- One or two real examples of your own best output, to use as few-shot examples
## Reference
| Pattern | Examples used | When to use | Note |
|---|---|---|---|
| Zero-shot | 0 | Common, well-understood tasks (summarize, translate, explain out-of-office replies) | Fastest to write, but output can vary between runs and miss subtle requirements |
| One-shot | 1 | You have a specific format or style in mind, or need brand-voice consistency | Clear format guidance, but a single example can cause overfitting |
| Few-shot | 2 to 3 | The sweet spot for most tasks: enough pattern recognition without wasting context | Start here before adding more examples |
| Few-shot | 4 to 5 | Complex patterns, unusual formats, tasks where consistency is critical | Takes longer to prepare and uses more context window |
| Few-shot | 5+ | Rarely needed | Rarely improves results and wastes context window |
| Combined prompt order | n/a | Any task needing both instructions and demonstrated pattern | Role, Goal, Task, Instructions, Examples, Context/Input, Rules, Format |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Zero-shot output is inconsistent between runs or misses subtle requirements | Move to one-shot or few-shot so the model copies a demonstrated pattern instead of guessing |
| Few-shot examples are all too similar (e.g. every subject line starts with a number) | Use varied examples that follow the same underlying pattern, not the same surface structure |
| Examples use vague placeholders like "[topic]" instead of real content | Use real, high-quality content in every example so the model has something concrete to copy |
| Output length does not match what you wanted | Match the length of your examples to the length you want in the output |
| Adding more and more examples hoping for better results | Stop at 2 to 5; beyond that it rarely improves results and just wastes context window |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 3 on Substack →
## More in this section
- [Lesson 1: LLMs and Prompts in Generative AI](/courses/prompt-engineering/lessons/llms-and-prompts-in-generative-ai/)
- [Lesson 2: How to control the large language models output?](/courses/prompt-engineering/lessons/how-to-control-the-large-language-models-output/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# Structured Output Prompts That Never Break
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/structured-output-prompts-that-never-break/
> Write structured output prompts that return reliable JSON from OpenAI models every time, without broken or malformed responses.
Structured output prompting is a technique for getting AI models to return valid JSON consistently, using four layers: a schema definition, one example output, strict formatting rules, and a validation instruction. It turns AI extraction into data that flows directly into databases, spreadsheets, or automations without manual cleanup.
## What you will be able to do
- Write a four-part structured output prompt (schema, example, strict rules, validation instruction) that produces valid JSON consistently
- Define schema lines that specify field names and data types instead of vague format requests
- Apply field-level formatting rules for strings, numbers, booleans, and arrays to prevent null values, wrong types, and extra fields
- Diagnose and fix common JSON output errors, such as preamble text, inconsistent capitalization, quoted numbers, and code fences
- Set model temperature and build basic validation checks (JSON parsing, required field checks) into a workflow to catch remaining errors
## Before you start
- An AI chat interface or API access (ChatGPT, Claude, or similar) to test prompts against
- Basic familiarity with JSON syntax: objects, fields, and data types like string, number, boolean, array
- A sample data extraction task (e.g. a product description or contact text) to practice the prompt pattern on
- Optional: API access if using OpenAI's JSON Mode (response_format parameter) or Anthropic's tool use schemas
## Reference
| Element | Example instruction | Purpose |
|---|---|---|
| Schema definition | "Return a JSON object with these exact fields: name (string), age (integer), email (string), active (boolean)." | Names each field and its data type so the model cannot guess the format |
| Perfect example | One complete example JSON output shown before the rules | Shows the exact target so the model has something concrete to match |
| Strict rules | "Use empty string for missing text, never null"; "currency values as numbers only, no $ symbol" | Defines formatting and default values per field type |
| Validation instruction | "Before returning, verify that all required fields are present and all data types match the schema." | Has the model check its own output before returning it |
| Anti-preamble instruction | "Output ONLY the JSON object, nothing before or after"; "Start your response with the opening brace {" | Stops the model from adding commentary or intro text |
| Anti-markdown instruction | "Do not wrap the output in code fences or backticks" | Stops the model from returning \`\`\`json wrapped output |
| Type enforcement | "All numbers must be numeric types, never strings"; "booleans must be true or false, never quoted" | Prevents type mismatches that break parsers |
| Temperature setting | Set to 0.0 to 0.1 for JSON extraction | Lower temperature reduces the randomness that causes format drift |
## Common errors and fixes
| Problem | Fix |
|---|---|
| Model adds text before or after the JSON | Add: "Start your response with { and end it with }. No text outside the JSON object." |
| Field names have inconsistent capitalization | Add: "(case-sensitive, match exactly as written)" after the schema definition |
| Numbers come back as strings like "79.99" instead of 79.99 | Add: "All numeric values must be unquoted numbers, not strings in quotes." |
| Null values appear instead of the intended defaults | Add: "Never use null. Use empty string for missing text, 0 for missing numbers, false for missing booleans." |
| Model wraps the JSON in code fences (\`\`\`json) | Add: "Return raw JSON without any markdown formatting or code blocks." |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 4 on Substack →
## More in this section
- [Lesson 5: Chain of Thought Prompting](/courses/prompt-engineering/lessons/chain-of-thought-prompting/)
- [Lesson 6: Break Big AI Tasks Into Small Steps](/courses/prompt-engineering/lessons/break-big-ai-tasks-into-small-steps/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# Stop Wasting 3 Hours Per Competitive Analysis
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/stop-wasting-3-hours-per-competitive-analysis/
> Paste competitor data once, get polished executive summaries in 90 seconds. 3-stage AI pipeline demonstrating all 8 prompt engineering patterns.
AI Competitive Analysis is a 3-stage n8n pipeline, Extract, Analyze, Write, built on OpenAI GPT-4.1, that turns raw competitor data pasted once into a board-ready executive summary delivered to Notion. It replaces a 2-3 hour manual copy-paste research routine with a 90-second automated run costing about $0.10-0.20 in OpenAI usage.
## What you will be able to do
- Build a 3-stage n8n pipeline that extracts competitor data into structured JSON, analyzes it with chain-of-thought reasoning, and writes an executive summary.
- Configure OpenAI and Notion credentials in n8n so analysis reports land automatically on a Notion page you share with the integration.
- Switch the workflow between quick mode for a single competitor and deep mode for multi-competitor analysis.
- Diagnose common failures such as invalid JSON output, a missing Notion page, or low quality analysis.
- Swap OpenAI nodes for Anthropic nodes or change models (GPT-4.1-mini, GPT-3.5-turbo) to trade cost against quality.
## Before you start
- An n8n instance, self-hosted for free or n8n cloud at $20 a month
- An OpenAI API key from platform.openai.com with billing enabled for GPT-4.1 usage
- A Notion account with an integration token, and the target Notion page shared with that integration
- Comfort importing and running a workflow in n8n; no coding required
## Reference
| Pattern | Stage 1 (Extract) | Stage 2 (Analyze) | Stage 3 (Write) |
|---|---|---|---|
| Role Setting | Data extraction specialist | Competitive analyst | Content strategist |
| Temperature | 0.2 (deterministic) | 0.6 (balanced) | 0.7 (creative) |
| Zero/Few-shot | Zero-shot | Few-shot (with example) | - |
| Structured Output | JSON schema | - | Markdown template |
| Chain-of-Thought | - | Step-by-step reasoning | - |
| Self-Critique | - | - | Review checklist |
| RAG/Grounding | Live web data | Stage 1 data | Stage 2 analysis |
| Multi-Stage | Part of 3-stage architecture | Part of 3-stage architecture | Part of 3-stage architecture |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Stage 1 produces invalid JSON | Check that input data is clearly structured with labels like Company:, Pricing:, Features:. The quality gate catches this and routes to a warning path |
| Notion page not created | Verify the integration is shared with the target page, check the page ID in the environment variable, and ensure the integration has Insert content permission |
| Analysis quality is low | Provide more detailed competitor data: specific pricing numbers and actual feature names instead of general descriptions |
| OpenAI rate limit errors | Add a Wait node (1-2 seconds) between stages, or upgrade your OpenAI account tier |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 9 on Substack →
## More in this section
- [Lesson 7: Lesson 7: RAG Ground the Model with Your Own Sources](/courses/prompt-engineering/lessons/lesson-7-rag-ground-the-model-with-your-own-sources/)
- [Lesson 8: From Prompting Patterns to Production Workflows: The Complete Integration Tutorial for ChatGPT and Claude](/courses/prompt-engineering/lessons/from-prompting-patterns-to-production-workflows-the-complete-integration-tutoria/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# LLMs and Prompts in Generative AI
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/llms-and-prompts-in-generative-ai/
> Introduction to LLMs and prompt engineering fundamentals
Large Language Models (LLMs) such as ChatGPT, Claude, and Gemini generate text by predicting the next token from patterns learned in massive amounts of training text, not by looking up facts. This lesson covers tokens, context windows, and the six-part prompt structure (role, task, context, rules, examples, format) for writing prompts that get useful, specific answers.
## What you will be able to do
- Write prompts using the six-part structure: role, task, context, rules, examples, format
- Estimate roughly how many tokens a prompt uses (about 750 tokens per 1,000 words) and keep it within the context window
- Explain why LLMs hallucinate and apply the safety tips (treat the model as an assistant, set boundaries, ask for sources) to reduce risk
- Apply the three-step formula, name the role, state the task with a verb, set rules and format, to turn a vague prompt into a clear one
- Run a prompt against the good-prompt checklist before sending it
## Before you start
- Access to an LLM chat tool such as ChatGPT, Claude, or Gemini
- Basic familiarity with typing a message into an AI chat interface
- No coding or technical background needed
## Reference
| Prompt part | What it does | Example from the lesson |
|---|---|---|
| Role | Sets who the model should pretend to be | "Act as a science teacher for grade five" |
| Task | States what should be done, using a verb | Summarize, rewrite, compare, or plan |
| Context | Gives facts the model needs | Notes, data, or short passages |
| Rules | Sets boundaries on the answer | "Keep it under 150 words," "use simple words" |
| Examples | Shows the kind of output wanted (few-shot) | One or two sample inputs with expected answers |
| Format | Tells the model how to shape the answer | Paragraphs, bullet list, JSON, or table |
| Token rule of thumb | Estimates prompt/response size for cost and context limits | About 1,000 words equals 750 tokens |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Prompt is vague and long | Cut fluff, state the task with a verb, add one or two rules, then stop |
| No audience is set | Say who the reader is: age, role, or skill level |
| No format is given | Ask for a structure like bullets, table, JSON, or clear sections |
| Too many goals in one ask | Split into small steps: plan, then draft, then polish |
| Model gives a wrong answer with confidence (hallucination) | Ask for sources when they matter, and stop to rethink the task if the answer seems wrong or unsafe |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 1 on Substack →
## More in this section
- [Lesson 2: How to control the large language models output?](/courses/prompt-engineering/lessons/how-to-control-the-large-language-models-output/)
- [Lesson 3: Zero-Shot, One-Shot, and Few-Shot Prompting Explained](/courses/prompt-engineering/lessons/zero-shot-one-shot-and-few-shot-prompting-explained/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# Lesson 7: RAG Ground the Model with Your Own Sources
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/lesson-7-rag-ground-the-model-with-your-own-sources/
> Prompt Engineering - Lesson 7: RAG Ground the Model with Your Own Sources
Retrieval-Augmented Generation (RAG) is a prompting technique that grounds AI answers in documents you supply, instead of the model's training data. The lesson covers how RAG works, how to chunk documents without losing context, and how to write prompts that force citations and refusals when information is missing, cutting hallucinations.
## What you will be able to do
- Write RAG prompts that answer only from provided context and cite sources
- Chunk documents into 200-500 word pieces with overlap so key facts don't get split across chunks
- Set confidence rules, strict, moderate, or lenient, that control when the model refuses to answer instead of guessing
- Decide when to use RAG versus fine-tuning for a given business use case
- Rank and select which documents to include in a prompt when working with multiple sources under a token budget
## Before you start
- Access to a chat interface such as ChatGPT or Claude
- Documents you want the AI to reference, such as reports, handbooks, or product docs, in text form
- Basic understanding of prompts and token limits, covered in the lesson on LLM settings
## Reference
| Element | Guidance |
|---|---|
| Simple RAG (small docs) | Paste the full document into the chat plus your prompt; works for documents under 2,000 words |
| Chunk size | 200-500 words per chunk |
| Chunk overlap | Include 1-2 sentences from the previous chunk at the start of the next one |
| Chunk boundaries | Split at section headers, paragraph breaks, complete sentences, or natural topic shifts |
| Never split | Mid-sentence, lists or tables, code blocks, or related facts such as dates paired with numbers |
| Confidence rule: Strict | Only answer if the exact information is explicitly stated; refuse when in doubt |
| Confidence rule: Moderate | Answer if clearly stated or directly inferable from multiple facts; cite all facts used |
| Token budget (4K example) | Instructions about 500 tokens, answer about 500 tokens, context about 3,000 tokens (roughly 2,000 words) |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| A key fact, like a sales figure, gets split across two chunks and only one is retrieved | Split at section headers or paragraph breaks, and add 1-2 sentences of overlap between chunks |
| The model gives an answer with no way to verify it | Add a rule requiring the model to cite the specific document and section for each claim |
| The model has no permission to say it doesn't know, so it guesses at missing data (e.g. inventing a Q4 revenue figure from Q3 trends) | Add a refusal rule: if the answer isn't in the context, say so explicitly |
| Using a lenient confidence rule lets the model fill gaps with assumptions | Use a strict or moderate confidence rule instead; lenient is not recommended |
| Irrelevant documents (e.g. HR Policies for a marketing spend question) get included and waste context budget | Rank documents by relevance to the question and include only the most relevant ones first |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 7 on Substack →
## More in this section
- [Lesson 8: From Prompting Patterns to Production Workflows: The Complete Integration Tutorial for ChatGPT and Claude](/courses/prompt-engineering/lessons/from-prompting-patterns-to-production-workflows-the-complete-integration-tutoria/)
- [Lesson 9: Stop Wasting 3 Hours Per Competitive Analysis](/courses/prompt-engineering/lessons/stop-wasting-3-hours-per-competitive-analysis/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# From Prompting Patterns to Production Workflows: The Complete Integration Tutorial for ChatGPT and Claude
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/from-prompting-patterns-to-production-workflows-the-complete-integration-tutoria/
> Turn one-off prompts into reusable, production-ready AI workflows for ChatGPT and Claude, with an integration tutorial and templates.
A production AI workflow is a repeatable three-stage process (Research and Gather, Reason and Analyze, Structure and Write) that combines ChatGPT and Claude so tasks like competitor analysis or customer feedback synthesis produce consistent output every time, without picking a new prompting pattern for each run.
## What you will be able to do
- Build a three-stage workflow (Research and Gather, Reason and Analyze, Structure and Write) that runs the same way every time instead of starting from scratch
- Assign each stage to the model it suits best using the Handoff Pattern: ChatGPT for browsing and current research, Claude for analysis, writing, and structured output
- Set temperature per stage: 0.1 to 0.3 for fact extraction, 0.5 to 0.7 for analysis, 0.6 to 0.8 for final writing
- Apply quality gates between stages so missing citations, unresolved 'Not found' entries, or weak reasoning get caught before they reach the final draft
- Adapt the worked competitor-analysis example (with its JSON schema and prompt structure) as a template for your own research and writing workflows
## Before you start
- Access to both ChatGPT and Claude, a browser tab for each is enough, no API required
- Working knowledge of Lessons 1 through 7 in this series: roles, temperature and top-p settings, few-shot examples, structured JSON output, chain-of-thought reasoning, plan-draft-critique, and RAG/source grounding
- Source material to run through the workflow, such as scraped competitor pages, support tickets, or article text
## Reference
| Stage | Purpose | Patterns Used | Temperature | Output |
|---|---|---|---|---|
| Stage 1: Research and Gather | Gathers facts from sources and extracts structured data | RAG/source grounding, zero-shot extraction rules, structured output | 0.1 to 0.3 | Structured research notes with citations, as JSON or organized sections |
| Stage 2: Reason and Analyze | Reasons through the research and connects insights | Chain-of-thought reasoning, few-shot examples, role setting | 0.5 to 0.7 | Synthesized findings with a visible reasoning chain |
| Stage 3: Structure and Write | Transforms analysis into the polished final deliverable | Structured output, multi-stage self-critique, citation enforcement | 0.6 to 0.8 | Final document in the required format |
| Model pick: writing and editing | Newsletters, articles, tone-sensitive content | n/a | n/a | Claude, for more natural prose |
| Model pick: current-data research | Competitor pricing, recent news | n/a | n/a | ChatGPT, for web browsing |
| Model pick: code generation | Automation scripts, technical output | n/a | n/a | ChatGPT, for Code Interpreter |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Stage 1 output makes a claim with no citation to a source document | Reject it at the quality gate and rerun Stage 1 rather than passing it to Stage 2 |
| Stage 1 has 'Not found in documents' entries that matter to the task | Resolve the gap before moving on, since Stage 2 and 3 will build on whatever Stage 1 hands them |
| Stage 2 analysis has no visible reasoning steps | Retry Stage 2 with adjusted instructions that explicitly ask it to show its reasoning |
| Stage 2 insights aren't tied back to Stage 1 data, or the logic has gaps | Send it back to Stage 2 instead of letting Stage 3 write from shaky analysis |
| Stage 3 output drops citations or doesn't match the required structure | Rerun Stage 3, the built-in self-critique step should catch this before you accept it as final |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 8 on Substack →
## More in this section
- [Lesson 7: Lesson 7: RAG Ground the Model with Your Own Sources](/courses/prompt-engineering/lessons/lesson-7-rag-ground-the-model-with-your-own-sources/)
- [Lesson 9: Stop Wasting 3 Hours Per Competitive Analysis](/courses/prompt-engineering/lessons/stop-wasting-3-hours-per-competitive-analysis/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# How to control the large language models output?
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/how-to-control-the-large-language-models-output/
> Techniques for controlling LLM outputs and behavior
LLM settings (temperature, top-p, top-k, max tokens, frequency and presence penalties) are parameters available through APIs and playgrounds like OpenAI Playground or Google AI Studio that control how a large language model picks its next words. This lesson explains what each setting does and gives starter recipes for extraction, summaries, planning, brainstorming, and writing.
## What you will be able to do
- Set temperature, top-p, and max tokens to match a task instead of guessing
- Pick starter recipe values (temperature and top-p) for extraction, summaries, planning, brainstorming, and writing tasks
- Diagnose and fix common output problems: topic drift, cut-off answers, repeated words, and broken JSON
- Use a seed parameter to get repeatable results for tests or demos
- Reduce repetition in output with frequency and presence penalties
## Before you start
- Access to an LLM API or playground such as OpenAI Playground or Google AI Studio, since these settings are not available in standard ChatGPT or Claude chat interfaces
- An account with the AI provider (free trials are available)
- Basic familiarity with prompts and how large language models generate text, covered in the earlier lesson on how LLMs work
## Reference
| Setting | Range | What it does | When to use |
|---|---|---|---|
| Temperature | 0.0 to 2.0 (above 1.0 rarely useful) | Controls randomness in token selection; low is predictable, high is creative | 0.0-0.3 for extraction, code, math; 0.4-0.7 for summaries and writing; 0.8-1.0 for brainstorming |
| Top-p (nucleus sampling) | 0.0 to 1.0, commonly around 0.9 | Picks from the smallest group of tokens whose probability adds up to p | Leave at 0.9 for most tasks; lower to 0.8 for careful work, raise to 0.95 for brainstorming |
| Top-k | integer, e.g. 40 | Picks only from the top k most likely tokens by rank | Rarely touched; some providers use this instead of top-p |
| Max tokens (output length) | numeric limit | Sets the maximum response length; the answer cuts off at the limit | Set high enough for the expected output, or add a length target in the prompt |
| Stop markers | custom strings such as , STOP, END | Tells the model when to stop generating | Use for strict formats like JSON to cut off extra text |
| Seed | any number you choose | Makes output repeatable with the same prompt and settings | Use when exact repeatability matters, such as tests or demos |
| Frequency penalty | positive value, try 0.3 to 0.5 | Discourages words that already appeared multiple times, more each time | Raise if the output repeats the same word many times |
| Presence penalty | positive value, try 0.3 to 0.5 | Discourages any word that appeared even once, encouraging new topics | Raise if the model keeps circling the same topics |
## Common errors and fixes
| Problem | Fix |
|---|---|
| Answer drifts off topic | Lower temperature a little, add a clear rule restating the goal, and add a refusal rule for low confidence |
| Answer is too short or cuts off | Add a word or token target in the prompt, increase max output length, and remove extra context to leave room |
| Answer is boring or stiff | Raise temperature a little, raise top-p a little, and add a style note or example |
| Answer repeats words or lines | Add a small frequency penalty and ask the model to avoid repeating phrases |
| JSON breaks your parser | Lower temperature, add a strict schema and example, tell the model to produce only JSON with no narrative text, and add a stop marker if supported |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 2 on Substack →
## More in this section
- [Lesson 1: LLMs and Prompts in Generative AI](/courses/prompt-engineering/lessons/llms-and-prompts-in-generative-ai/)
- [Lesson 3: Zero-Shot, One-Shot, and Few-Shot Prompting Explained](/courses/prompt-engineering/lessons/zero-shot-one-shot-and-few-shot-prompting-explained/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# Chain of Thought Prompting
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/chain-of-thought-prompting/
> Using chain of thought prompting for complex reasoning tasks
Chain of thought prompting asks an AI model to reason through a problem step by step, out loud, before giving a final answer, instead of jumping straight to a conclusion. Adding a phrase like "let's think step by step" reduces errors on math, logic, multi-step instructions, and business decisions because the reasoning becomes visible and checkable.
## What you will be able to do
- Add zero-shot chain of thought trigger phrases, such as "let's think step by step" or "work through this carefully before answering," to any prompt
- Run self-consistency checks: solve a problem 3-5 times at temperature above 0 and keep the answer that shows up most often
- Use step back prompting to make the model restate a problem in its own words before solving it, so it catches misread questions
- Structure ReAct prompts with Thought, Action, Observation, Thought, Answer so the model uses tools and cites sources instead of guessing
- Judge when chain of thought is worth using and when it's overkill for simple lookups, translations, or one-step formatting
## Before you start
- Access to a chat-based LLM such as Claude, ChatGPT, or Gemini
- Comfort writing plain-language prompts, no coding required for basic chain of thought
- API or playground access for self-consistency, since it works best with temperature set above 0 and requires running the same prompt several times
- Familiarity with zero-shot and few-shot prompting from earlier lessons in this course is helpful but not required
## Reference
| Technique | What it does | How to trigger it | Best for |
|---|---|---|---|
| Chain of thought | Model reasons in explicit steps before giving a final answer | Add "Think step by step," "Show your reasoning," "Explain your thought process," or "Break this down into steps" | Math problems, logic puzzles, multi-step instructions, complex decisions |
| Zero-shot CoT phrases | Single-phrase triggers tested across Claude, ChatGPT, and Gemini | Use phrases like "Let's think step by step" or "Reason through this systematically, then state your answer" | Any task where you want reasoning without providing examples |
| Self-consistency | Runs the same prompt multiple times and keeps the most common answer | Ask the model to solve the problem 3 different ways, then state which answer appears most often; use temperature above 0 | High-stakes decisions, calculations, problems with multiple solution paths |
| Step back (task restatement) | Model restates the problem before solving it | Add "First, restate the problem in your own words. Then solve it step by step." | Word problems, multi-part questions, problems that could be misunderstood |
| ReAct | Model alternates reasoning with tool use such as search or calculator | Structure the prompt as Thought, Action, Observation, Thought, Answer | Research tasks, current facts, tasks needing citations or verification |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Model jumps to an answer and adds or skips a step incorrectly | Add "think step by step" or "show your reasoning" so it works through the problem before answering |
| Model misreads a word problem and calculates the wrong relationship | Use step back prompting: have it restate the problem in its own words before solving |
| A single attempt contains a hidden calculation error you can't catch | Run self-consistency: repeat the same prompt 3-5 times at temperature above 0 and pick the most frequent answer |
| Chain of thought gets applied to simple factual lookups, translations, or one-step formatting | Skip it. These tasks have only one obvious step, so CoT adds cost and time without improving accuracy |
| Self-consistency gets used on every task | Reserve it for high-stakes or high-cost-of-error tasks since it needs multiple API calls and costs more |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 5 on Substack →
## More in this section
- [Lesson 4: Structured Output Prompts That Never Break](/courses/prompt-engineering/lessons/structured-output-prompts-that-never-break/)
- [Lesson 6: Break Big AI Tasks Into Small Steps](/courses/prompt-engineering/lessons/break-big-ai-tasks-into-small-steps/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# Break Big AI Tasks Into Small Steps
URL: https://www.genaiunplugged.com/courses/prompt-engineering/lessons/break-big-ai-tasks-into-small-steps/
> Plan, Draft, Critique method for breaking down complex AI tasks
The Plan-Draft-Critique Method breaks a complex AI task into three separate prompts: Plan (outline the structure), Draft (write one section at a time), and Critique (review against specific criteria). Instead of one giant request, you stage the work in phases, review at each step, and catch errors before they compound into the final output.
## What you will be able to do
- Write a Plan prompt that outlines structure only, using the instruction "Do NOT write the content yet, only the plan" to stop the model from jumping ahead
- Draft one section at a time from an approved plan, feeding in context from previous sections so quality and continuity hold up
- Write a Critique prompt that checks content against specific criteria (clarity, completeness, accuracy, consistency, audience fit) and prioritizes issues by impact
- Choose a list plan for straightforward sequential tasks or a tree plan for complex projects with dependent parts
- Use a debate prompt to argue two sides of a decision, with a recommendation, before committing to an approach
## Before you start
- Access to an AI chat tool such as ChatGPT or Claude
- A task substantial enough to justify multiple prompts: the article's guide points to tasks over 500 words or with multiple distinct sections
- Willingness to review and approve output at each stage before moving to the next one
## Reference
| Stage | Purpose | Key instruction or template element |
|---|---|---|
| Plan | Outline the structure before any content is written | "Do NOT write the content yet, only the plan." |
| Draft | Write one section at a time from the approved plan | "Write only this section. Do not continue to other sections." |
| Critique | Evaluate finished content against fixed criteria | Checks clarity, completeness, accuracy, consistency, audience fit; issues prioritized High/Medium/Low |
| List plan | Straightforward tasks with clear sequential steps | Numbered or bulleted list of items |
| Tree plan | Complex projects where parts connect to each other | Nested structure, e.g. 1.1, 1.1.1, showing dependencies |
| Debate | Decisions with no obvious right answer | Side A benefits/risks, Side B benefits/risks, comparison, recommendation |
| Refinement loop | Improve critical content over multiple passes | Plan, Draft, Critique, Revise, Re-critique, repeat until quality threshold is met |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| One prompt asks the AI to do the whole task at once (e.g. "Write a marketing plan for my new fitness app") | Split it into Plan, Draft, and Critique prompts instead of one giant request |
| Draft prompt has no scope limit | Model keeps writing past the current section, causing context drift; add "Write only this section. Do not continue to other sections." |
| Plan prompt is missing the no-content instruction | Model starts drafting content instead of just outlining structure; add "Do NOT write the content yet, only the plan." |
| Critique prompt just says "make it better" | Feedback comes back vague instead of actionable; give specific criteria and require quoted problems with concrete fixes |
| Single prompt used for a long or multi-section task | Output misses the target audience, ignores constraints, and wastes tokens on unusable content; use Plan-Draft-Critique when the task is over 500 words, has multiple sections, or is expensive to get wrong |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Prompt Engineering for AI Automation**.
Read Lesson 6 on Substack →
## More in this section
- [Lesson 4: Structured Output Prompts That Never Break](/courses/prompt-engineering/lessons/structured-output-prompts-that-never-break/)
- [Lesson 5: Chain of Thought Prompting](/courses/prompt-engineering/lessons/chain-of-thought-prompting/)
## Continue the course
Browse all lessons in the [Prompt Engineering for AI Automation](/courses/prompt-engineering/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/llms-and-prompts-in-generative-ai) to get new lessons in your inbox.
---
# What Nobody Tells You About AI Automation Costs - Start Tracking Them Now!
URL: https://www.genaiunplugged.com/courses/production-n8n/lessons/what-nobody-tells-you-about-ai-automation-costs-start-tracking-them-now/
> Token budgets, execution counts, and maintenance hours quietly add up. See the real automation costs and how to start tracking them.
A zero-touch n8n cost scanner reads token usage straight from n8n's execution metadata to track AI API spending (Claude, Perplexity, Firecrawl) across every workflow, without touching existing workflows. It logs costs to Google Sheets, sends a weekly cost digest, and fires budget alerts before a surprise bill lands, part of a production n8n workflows series.
## What you will be able to do
- Build a single n8n scanner workflow that reads token usage from execution metadata for every AI workflow, without modifying any of them
- Set up a Google Sheets dashboard that shows monthly totals, daily trends, and top-spending workflows
- Configure budget alerts that fire once a day when spending crosses a threshold, instead of per execution
- Generate a weekly email digest that breaks down cost by workflow and by model
- Estimate hidden costs beyond API tokens, including n8n execution limits, data scraping, storage, and maintenance hours, so you can plan a realistic monthly budget
## Before you start
- An n8n instance (self-hosted or Cloud) with existing AI workflows using nodes like OpenAI, Anthropic, or Google Gemini
- Access to n8n's REST API to list and fetch execution data
- A Google Sheets account to receive the cost log and dashboard
- Basic familiarity with n8n workflow building (nodes, triggers, HTTP requests)
## Reference
| Cost item | Rate | Real-world translation |
|---|---|---|
| Claude Sonnet 4.6 | $3 per million input tokens, $15 per million output tokens | 1,000 content generation calls is about $30; 10,000 calls is about $300 |
| Perplexity API | $5 per 1,000 searches | 100 queries/week is about $2/month; 500 queries/week is about $10/month |
| n8n Cloud Starter | 2,500 executions/month, $24 | A workflow running every 15 minutes (96/day) is about 2,880 executions/month, over the limit |
| n8n Cloud Pro | 10,000 executions/month, $60 | Covers higher-frequency workflows that outgrow Starter |
| Firecrawl | $19 per 3,000 pages, varies by plan | 500 competitor sites scraped daily is about 150,000 pages/month, needs $99-$399 plans |
| Apify | $29/month Starter (includes $29 in credits), $0.30 per compute unit | Scales with scraping volume and compute-heavy jobs |
| Airtable Free | 1,000 records per base | 100 executions/day logged is about 3,000 records/month, exceeds free tier in about 10 days |
| Airtable Team | 50,000 records per base, $24/user/month | 500 executions/day is about 15,000 records/month |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| You add tracking nodes manually to each workflow and forget to update new ones | Build one scanner workflow that reads token usage from n8n execution metadata for every workflow automatically |
| A workflow you forgot about, like an hourly competitor scan, quietly costs $75/month | Run the scanner's per-workflow cost report to spot and pause low-value automations |
| A low-frequency workflow that runs every 5 minutes burns through n8n's execution limit even though it delivers little value | Track execution count against value delivered, not just API cost, and adjust trigger frequency |
| The scanner only captures LLM calls, missing Perplexity, Firecrawl, and other external API costs, about 20 percent of total spend | Add the optional manual tracking pattern from Step 7 of the article for non-AI API costs |
| Google Sheets or Airtable logging hits free-tier record limits faster than expected as execution volume grows | Plan for a paid tier, such as Airtable Team at 50,000 records, before volume outgrows the free plan |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **From Demo to Dependable: Production n8n Workflows**.
Read Lesson 1 on Substack →
## More in this section
- [Lesson 2: When NOT to Automate: The Break-Even Framework [FD2D #2]](/courses/production-n8n/lessons/when-not-to-automate-the-break-even-framework-fd2d-2/)
## Continue the course
Browse all lessons in the [From Demo to Dependable: Production n8n Workflows](/courses/production-n8n/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-automation-cost-tracking) to get new lessons in your inbox.
---
# Workflow Contracts That Save You [FD2D #3]
URL: https://www.genaiunplugged.com/courses/production-n8n/lessons/workflow-contracts-that-save-you-fd2d-3/
> Define contracts, stop fragility. Input contracts, output contracts, error contracts - validation before and after AI.
Workflow contracts are a three-layer validation system for n8n automations: input contracts check data as it enters, output contracts verify AI-generated results before they publish, and error contracts route failures to Slack or email instead of letting them fail silently. Dheeraj reports this approach cut his workflow failures by about 90%.
## What you will be able to do
- Add an IF node validation gate right after a trigger to reject bad data before it reaches AI calls or API requests.
- Write regex and expression conditions for email format, URL format, required fields, date ranges, and numeric ranges in n8n's IF node.
- Write an AI prompt with a structure-enforcement block, then parse and validate the JSON output with a Set node and IF node for required fields, length limits, and item counts.
- Set up a separate Error Handler workflow using n8n's built-in Error Trigger node to catch failures automatically.
- Route validation and error failures to Slack or email notifications, including workflow name, node, and error message, instead of letting them fail silently.
## Before you start
- An existing n8n workflow (trigger plus processing steps) to add validation to.
- A Slack or email node configured in n8n for failure notifications.
- Basic familiarity with n8n's IF node, Set node, and expression syntax ({{ }}).
- An AI node (such as Claude) in the workflow if building output contracts for AI-generated content.
## Reference
| Validation type | n8n expression or step | What it catches |
|---|---|---|
| Email format | `{{ $json.email.match(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/) }}` | Invalid email before it reaches the CRM |
| URL format | `{{ $json.url.match(/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/) }}` | Malformed link fields |
| Required field (not empty) | `{{ $json.field_name && $json.field_name.trim().length > 0 }}` | Missing or blank required data |
| Date is in the future | `{{ new Date($json.date_field) > new Date() }}` | Accidentally scheduling posts in the past |
| Number in range (10-10000) | `{{ $json.number_field >= 10 && $json.number_field <= 10000 }}` | Pricing typos like $10,000 instead of $100 |
| String length minimum (10 chars) | `{{ $json.text_field && $json.text_field.length >= 10 }}` | Text fields that are too short to be valid |
| Error Trigger node | First node in a separate "Error Handler" workflow | Catches any workflow error automatically and reports it |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Workflow shows "success" but bad data (e.g. emoji in an email field) reaches the CRM, which then rejects it | Add an Input Validation Gate (IF node) right after the trigger to check field format before processing continues |
| Claude wraps JSON in markdown code blocks or renames a field (e.g. "email_address" instead of "email"), breaking the workflow | Add explicit structure rules to the AI prompt (no markdown wrapping, exact field names) and validate the parsed output with an IF node |
| A source row (e.g. in a spreadsheet) is deleted and the workflow runs successfully with missing data, unnoticed until someone complains | Add required-field checks before processing so missing data is caught and reported instead of passed through silently |
| AI output technically succeeds but breaks a quality limit, like a Twitter post over 280 characters | Add a second IF node after field-existence checks to validate length and item count against your limits |
| Failures happen with no visibility into which workflow or node broke | Build a separate Error Handler workflow with an Error Trigger node that sends Slack or email notifications with workflow name, node, error message, and execution link |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **From Demo to Dependable: Production n8n Workflows**.
Read Lesson 3 on Substack →
## More in this section
- [Lesson 4: Failure Is a Feature: Designing Error Handling [FD2D #4]](/courses/production-n8n/lessons/failure-is-a-feature-designing-error-handling-fd2d-4/)
- [Lesson 5: The Postmortem Framework: Learning from Failures [FD2D #5]](/courses/production-n8n/lessons/the-postmortem-framework-learning-from-failures-fd2d-5/)
## Continue the course
Browse all lessons in the [From Demo to Dependable: Production n8n Workflows](/courses/production-n8n/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-automation-cost-tracking) to get new lessons in your inbox.
---
# When NOT to Automate: The Break-Even Framework [FD2D #2]
URL: https://www.genaiunplugged.com/courses/production-n8n/lessons/when-not-to-automate-the-break-even-framework-fd2d-2/
> The smartest automation is sometimes no automation. Learn the break-even calculation for when manual beats automated.
The Break-Even Framework is a formula for deciding whether an AI automation is worth building: Break-Even Point (months) = Setup Time divided by (Time Saved per instance times Monthly Frequency). If that number is over six months, the lesson says stay manual. It comes from the article When NOT to Automate, part of the From Demo to Dependable course.
## What you will be able to do
- Calculate a break-even point for any automation idea using setup time, time saved per instance, and frequency.
- Apply the six-month threshold to decide whether an automation is worth building or not.
- Spot the three traps that derail automation decisions: complexity cascade, frequency fallacy, and perfection prison.
- Correct your frequency estimate by counting the last three months of actual usage and cutting that number in half.
- Account for maintenance tax so a good-looking break-even number does not hide a task that needs constant upkeep.
## Before you start
- A specific recurring task you are considering automating, with a rough sense of how long it takes manually.
- Some ability to estimate build/setup time for the tool involved (the article uses n8n and Claude Code as examples).
- Access to your own last three months of task frequency, or a willingness to estimate honestly and halve it.
## Reference
| Variable | Definition | How to estimate it |
|---|---|---|
| Setup Time | Hours to build and test the automation, including learning a new tool and troubleshooting | If you think it will take 2 hours, plan for 4 |
| Time Saved Per Instance | Manual time minus automated time, per single use of the task | Not the manual task length itself, the difference between manual and automated |
| Frequency | How many times per month you actually do the task | Use your last 3 months of real data, then cut that number in half |
| Break-Even Formula | Break-Even (months) = Setup Time divided by (Time Saved x Monthly Frequency) | Example: 2 hours divided by (43 min x 4/month) = 0.7 months |
| Decision Threshold | If break-even is more than 6 months, stay manual | Reasoning: tools change, the business evolves, maintenance compounds |
| Maintenance Tax | Ongoing upkeep time not counted in the setup-time estimate | Can turn a good break-even number into a bad automation, as in the newsletter formatting example |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Complexity Cascade: a simple automation grows extra integrations, authentication, error handling, and logging until a 1-hour build becomes a 6-hour project | Set a hard time limit before starting. If it is not done by then, the task is too complex for its time savings, go back to manual or find a simpler approach |
| Frequency Fallacy: you estimate task frequency from your goals (post daily) instead of your actual behavior (post 3 times a week) | Count actual occurrences over the last 3 months, then cut that number in half for your estimate |
| Perfection Prison: you keep tweaking a working automation for marginal gains, like spending 5 hours to save an extra 30 seconds | Stop once the automation hits its time-savings target, done is better than perfect |
| Rounding setup time down or frequency up when doing the math, which was the source of most miscalculations in the article | Be honest: double a shaky setup-time estimate, and use the halved 3-month frequency average, not your publishing goal |
| Ignoring maintenance tax: the break-even math looks favorable but the underlying task (formatting, layout) changes constantly | Ask whether the process is stable. If it changes often, budget ongoing upkeep time or stay manual and use a template instead |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **From Demo to Dependable: Production n8n Workflows**.
Read Lesson 2 on Substack →
## More in this section
- [Lesson 1: What Nobody Tells You About AI Automation Costs - Start Tracking Them Now!](/courses/production-n8n/lessons/what-nobody-tells-you-about-ai-automation-costs-start-tracking-them-now/)
## Continue the course
Browse all lessons in the [From Demo to Dependable: Production n8n Workflows](/courses/production-n8n/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-automation-cost-tracking) to get new lessons in your inbox.
---
# The Postmortem Framework: Learning from Failures [FD2D #5]
URL: https://www.genaiunplugged.com/courses/production-n8n/lessons/the-postmortem-framework-learning-from-failures-fd2d-5/
> Failures are data. Capture them systematically with the 5-section postmortem template.
A postmortem framework is a 5-section template (What Happened, Why It Happened, What We Learned, What We'll Do Differently, Success Metrics) for documenting automation failures in n8n, Claude Code, or any AI system. Storing entries in a Claude Projects Failure Database lets you run pattern analysis after five postmortems and cut repeated mistakes by 60%.
## What you will be able to do
- Build a Claude Projects "Failure Database" with custom instructions that guide you through the 5-section postmortem template
- Document a single automation failure in about 15 minutes using conversational prompts
- Run a pattern analysis prompt after five or more postmortems to surface your top three failure types and their root causes
- Turn identified patterns into a prioritized prevention action plan with testing requirements and success metrics
- Connect a Level 4 n8n error escalation alert to a postmortem entry so technical details are pre-populated
## Before you start
- A claude.ai account with access to Claude Projects
- At least one recent automation failure to document, such as a broken n8n workflow or failed Claude Code agent
- Familiarity with the 4-level n8n error handling system from the previous article in the series, needed to wire automatic triggering
- Optional: screenshots, workflow JSON exports, or API logs from the failure to upload as supporting evidence
## Reference
| Step | Action |
|---|---|
| 1. Create project | In claude.ai, click Projects, then Create Project, and name it "Failure Database" |
| 2. Add description | Enter: "Systematic documentation of automation failures, root cause analysis, and pattern recognition to prevent repeated mistakes." |
| 3. Install template | Click Edit project details, paste the postmortem system instructions into Custom instructions, click Save changes |
| 4. Document first failure | Type "Run postmortem: [brief description of what failed]" in the project chat and answer Claude's follow-up questions |
| 5. Upload evidence (optional) | Click the paperclip icon and attach screenshots, workflow JSON exports, or API logs |
| 6. Repeat and analyze | Log every new failure going forward; after 5 or more postmortems, run the pattern analysis prompt |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Postmortems feel like dwelling on shame after you already fixed the problem | Treat it like an aviation black box: the point is system data, not blame |
| Blank-page syndrome eats 45 minutes because there is no template | Use the 5-section template so Claude prompts you section by section |
| Memory fades within 48 hours, so the exact error message and workaround get lost | Document within 15 minutes of fixing the issue, while details are fresh |
| Notes end up in a Google Doc or Notion page you never find again | Store every entry in one Claude Projects "Failure Database" so it stays searchable in project memory |
| Postmortems stay one-off entries instead of building into pattern data | Set a calendar reminder to log every failure, then run pattern analysis once you have 5 or more postmortems |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **From Demo to Dependable: Production n8n Workflows**.
Read Lesson 5 on Substack →
## More in this section
- [Lesson 3: Workflow Contracts That Save You [FD2D #3]](/courses/production-n8n/lessons/workflow-contracts-that-save-you-fd2d-3/)
- [Lesson 4: Failure Is a Feature: Designing Error Handling [FD2D #4]](/courses/production-n8n/lessons/failure-is-a-feature-designing-error-handling-fd2d-4/)
## Continue the course
Browse all lessons in the [From Demo to Dependable: Production n8n Workflows](/courses/production-n8n/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-automation-cost-tracking) to get new lessons in your inbox.
---
# The Maintenance Tax: What Nobody Tells You [FD2D #6]
URL: https://www.genaiunplugged.com/courses/production-n8n/lessons/the-maintenance-tax-what-nobody-tells-you-fd2d-6/
> Launching is 20% of the work. Maintaining is 80%. API changes, model drift, data quality decay.
The Maintenance Tax is the ongoing work of keeping an AI automation alive after launch: API changes, model drift, and data decay that account for roughly 80% of total automation effort. This lesson explains what causes automations to break, how to estimate monthly maintenance hours, and seven strategies to cut that time by 40-60%.
## What you will be able to do
- Identify the three failure sources (API changes, model drift, data quality decay) that break a running automation
- Estimate your own monthly maintenance load using the formula: automations times complexity times API change frequency, plus documentation debt
- Compare n8n, Claude Code, and Claude Projects by maintenance profile to pick the right tool for a given workflow
- Add redundancy and fallback checks at points where a workflow currently has a single point of failure
- Separate critical failures from recoverable errors so notifications only fire when something actually needs a 2am fix
## Before you start
- At least one automation (n8n workflow, Claude Code script, or similar) already running in production
- Basic familiarity with API integrations, webhooks, and OAuth reconnection flows
- Access to the tool you're maintaining, to add Sticky Notes, comments, or error triggers
## Reference
| Strategy | What it does |
|---|---|
| Choose stable APIs | Before integrating, check for version numbers, advance notice of breaking changes, migration docs, and release frequency. Stripe-style versioned APIs beat unversioned beta tools |
| Build redundancy at critical points | Add fallback checks (for example, parse company name from subject line or sender domain if the email body format changes) so one parsing failure does not halt the workflow |
| Document while you build | Add comments or Sticky Notes explaining why a filter, regex, or delay exists, including the specific API version or field it depends on |
| Use error notifications strategically | Alert immediately on critical failures (payment processing, lost leads); batch recoverable errors (successful retries, backup methods) into a daily digest |
| Version your prompts | Save the working prompt version before updating it, with model version and change notes, so you can roll back if the new version breaks output format |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Stripe changes its API version and nests invoice fields differently (e.g. line_items.data[0].description moves under price.product), breaking the JSON parser | Choose APIs with versioning and migration guides, and check migration notes before the platform deprecates the old version |
| Google updates its OAuth implementation and the n8n Google Sheets node can't authenticate | Reconnect, reauthorize, and update scopes; expect this roughly every 12-18 months across major platforms |
| A model update changes output formatting (for example Claude returns markdown tables instead of bullet lists), breaking the downstream parser | Version prompts before updating production ones, and keep a working baseline (e.g. revert to v1.3) to restore if the new version breaks something |
| A teammate adds a new status or tag (e.g. "Ready - Needs Image") that isn't covered by the workflow's filter logic, so nothing posts | Add fallback handling for new values and document why the original filter was written the way it was |
| A client submits data in an unexpected format (e.g. phone number as 555.123.4567 instead of 555-123-4567) and the validation regex rejects it, halting onboarding | Build redundancy that checks multiple field variants and normalizes formats, including international numbers, before validation |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **From Demo to Dependable: Production n8n Workflows**.
Read Lesson 6 on Substack →
## Continue the course
Browse all lessons in the [From Demo to Dependable: Production n8n Workflows](/courses/production-n8n/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-automation-cost-tracking) to get new lessons in your inbox.
---
# Failure Is a Feature: Designing Error Handling [FD2D #4]
URL: https://www.genaiunplugged.com/courses/production-n8n/lessons/failure-is-a-feature-designing-error-handling-fd2d-4/
> Every workflow fails. Design for it from day one. Retry policies, fallback paths, escalation, and the error handling ladder.
This lesson builds error handling into n8n workflows using a 4-level framework, ignore, retry, fallback, escalate, so failures never go silent. It covers wiring Continue on Fail, Error Trigger, Wait, and Merge nodes, plus four AI-specific failure modes like schema validation errors and semantic failures that pass validation but return wrong answers.
## What you will be able to do
- Map your three most critical workflows by failure point, impact, and likelihood before building anything
- Configure Continue on Fail on n8n nodes for failures that don't need action (Level 1)
- Build a retry loop with a retry counter, an IF check, and a Wait node using exponential backoff (Level 2)
- Wire a fallback path with a Merge node so the workflow switches to a backup system when the primary keeps failing (Level 3)
- Set up a Slack or email escalation node that alerts a human only when automation can't recover (Level 4)
## Before you start
- An n8n instance (self-hosted or cloud) and a workflow you want to protect
- Access to the external APIs or services the workflow calls, so you can test failure paths
- Basic familiarity with n8n nodes: HTTP Request, IF, Set, Merge, Error Trigger
- A Slack or email destination to receive Level 4 escalation alerts
## Reference
| Level | Purpose | n8n implementation | Use it for |
|---|---|---|---|
| 1. Ignore | Accept failures that don't affect the outcome | Enable "Continue on Fail" on the node | Optional data enrichment, logging calls, duplicate checks |
| 2. Retry | Auto-retry transient errors before giving up | Error Trigger, plus a Set node (retry_count), an IF node (retry_count < 3), a Wait node (Math.pow(2, retry_count) seconds), looped back to the original node | External API calls, AI model calls, database queries under load, file uploads |
| 3. Fallback | Switch to a backup system once retries are exhausted | Alternate HTTP Request node on the IF node's False output, combined with a Merge node in Append mode | Payment processing (Stripe to PayPal), CRM sync (HubSpot to Google Sheets), email delivery, AI calls (Claude to a simpler model or prompt) |
| 4. Escalate | Alert a human with actionable context when automation can't recover | Error Trigger, a Set node formatting error_summary, workflow_name, and failed_node, then a Slack or Email node plus Stop and Error | Any failure that survives fallback and needs manual intervention |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Workflow fails silently, for example an API times out and a lead just disappears with no notification | Add an Error Trigger node and a Level 4 escalation (Slack or email) so failures always produce a visible alert |
| AI API call times out or hits a rate limit (for example an Anthropic 429 or a temporarily unavailable model) | Treat it as transient: apply Level 2 retry with exponential backoff using a Wait node |
| AI response comes back as HTTP 200 but fails schema validation, missing fields or hallucinated field names | Don't just retry the same prompt. Apply Level 2 with a corrected prompt naming the missing field, or fall back to a simpler prompt (Level 3) |
| AI response validates against the schema but the content is confidently wrong, for example total_cost: -500 | Add a separate output validation node that checks business rules before passing data downstream, and escalate (Level 4) if it fails |
| A multi-step agent skips a step (for example step 3 of 6 fails) but no top-level error fires because continue_on_error was set for another reason | Track completion state explicitly, log which tools ran, succeeded, or were skipped, and escalate if the final output is missing data from a required step |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **From Demo to Dependable: Production n8n Workflows**.
Read Lesson 4 on Substack →
## More in this section
- [Lesson 3: Workflow Contracts That Save You [FD2D #3]](/courses/production-n8n/lessons/workflow-contracts-that-save-you-fd2d-3/)
- [Lesson 5: The Postmortem Framework: Learning from Failures [FD2D #5]](/courses/production-n8n/lessons/the-postmortem-framework-learning-from-failures-fd2d-5/)
## Continue the course
Browse all lessons in the [From Demo to Dependable: Production n8n Workflows](/courses/production-n8n/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-automation-cost-tracking) to get new lessons in your inbox.
---
# OpenClaw AI Agent: Security, Cost, Architecture, and Setup Deep Dive
URL: https://www.genaiunplugged.com/courses/openclaw/lessons/openclaw-ai-agent-security-cost-architecture-and-setup-deep-dive/
> A live session with Wyndo covering OpenClaw AI agent security, real costs, architecture decisions, and the full setup walkthrough.
OpenClaw is an autonomous AI agent (225,000+ GitHub stars) that reads Slack, updates Notion, sends emails, and monitors your calendar without you copy-pasting between tabs. This lesson covers its four core components (soul.md, user.md, memory, heartbeat.md), the prompt injection and credential risks, and the cost controls needed to avoid runaway API bills.
## What you will be able to do
- Configure the four core OpenClaw files (soul.md, user.md, memory, heartbeat.md) to set up a personalized, autonomous agent
- Set hard spending limits (max_daily_tokens, max_monthly_spend, alert_threshold) to prevent surprise API bills
- Recognize and defend against prompt injection attacks that can leak credentials to an attacker
- Choose the right AI model (Claude Sonnet 4.6, Opus 4.6, or Kimi) for each task to control token costs
- Decide whether OpenClaw fits your workflow using the security and data-sensitivity criteria in the decision framework
## Before you start
- A VPS (AWS, Hetzner, DigitalOcean) or a dedicated old computer, since OpenClaw should never run on your personal machine
- An Anthropic account with access to Claude models (Sonnet 4.6, Opus 4.6) or another supported AI model
- Comfort with basic technical setup: installing software and editing configuration files like soul.md and heartbeat.md
- Willingness to actively monitor costs and security, especially in the first few weeks
## Reference
| Component/Setting | What it does | Example / Value |
|---|---|---|
| soul.md | Defines the agent's personality, tone, role, and boundaries | Pepper Potts (chief of staff), David Goggins (workout coach), Morty (entertainment) |
| user.md | Holds your personal/business context so responses are personalized | Business, schedule, preferences, goals |
| Memory (Rack system) | Persistent memory across sessions | Remembers past decisions, recurring tasks, corrected mistakes |
| heartbeat.md | Automated monitoring and triggered actions | Defines what to monitor, when to check, what actions to trigger |
| max_daily_tokens | Hard cap on daily token usage | 100000 |
| max_monthly_spend | Hard cap on monthly spend | 150 |
| alert_threshold | Warning threshold before hitting the hard cap | 80% |
| Pro Plan vs Max Plan | Anthropic subscription tiers for running OpenClaw | Pro $20/month; Max $100/month (5x more tokens) |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Agent given broad Gmail access gets its context overloaded, compacts conversations, loses its original instructions, and bulk-deletes emails (real incident) | Never grant broad access to sensitive systems; restrict OpenClaw to internal workflows only |
| Prompt injection hidden in an email or document overrides the agent's instructions and can send credentials to an attacker | Never let OpenClaw process emails or documents from untrusted sources |
| No hard spending limits configured, so an overnight run racks up $200+ in API charges before you notice (some users report $200/day) | Set max_daily_tokens, max_monthly_spend, and alert_threshold in config, capped at 50-70% of your comfort zone |
| Running OpenClaw on your personal computer risks it reading your personal files, passwords, and financial data if compromised | Run it on a separate VPS or dedicated old computer, and use Tailscale or similar for network isolation |
| Credentials pasted directly into soul.md or user.md as plain text, or full-access API keys handed to the agent | Use environment variables or secure vaults, and use read-only, scoped API tokens wherever possible |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **OpenClaw for Solopreneurs: AI Agents That Work While You Sleep**.
Read Lesson 0 on Substack →
## Continue the course
Browse all lessons in the [OpenClaw for Solopreneurs: AI Agents That Work While You Sleep](/courses/openclaw/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-openclaw-beginner-non-developer-assessment) to get new lessons in your inbox.
---
# What OpenClaw Actually Is (And Isn't) — A Non-Developer's Honest Assessment
URL: https://www.genaiunplugged.com/courses/openclaw/lessons/what-openclaw-actually-is-and-isnt-a-non-developers-honest-assessment/
> A non-developer breaks down OpenClaw architecture, realistic use cases, honest limitations, and real cost numbers from a live session.
OpenClaw is an open-source autonomous AI agent system that runs monitoring loops every 30 minutes on your own machine or a server, without you prompting it. You configure its behavior through markdown files like SOUL.md, USER.md, IDENTITY.md, MEMORY.md, and HEARTBEAT.md, and it reports back through WhatsApp, Discord, or iMessage.
## What you will be able to do
- Set up a Morning Briefing Agent that checks Gmail, calendar, and Todoist and posts a summary to Slack before you're at your desk.
- Distinguish OpenClaw's scheduled, proactive monitoring from ChatGPT/Claude's prompt-and-wait model and from n8n's event-triggered automation.
- Configure the core markdown files (SOUL.md, USER.md, IDENTITY.md, MEMORY.md, HEARTBEAT.md) that control what the agent does and won't do.
- Estimate realistic monthly API costs depending on whether you run Claude Opus, a budget model, or a local Ollama setup.
- Score your own readiness against the 10-point checklist to decide whether to set up OpenClaw now or wait 3-6 months.
## Before you start
- Comfort with SSH into a VPS and running command-line tools, or willingness to run OpenClaw locally.
- Ability to edit and debug plain-text markdown configuration files.
- A dedicated test email account separate from your primary or client communication account.
- 4+ hours for initial setup and about 60 minutes a week for ongoing maintenance.
## Reference
| File | Role | What it defines |
|---|---|---|
| SOUL.md | Employee handbook | Core values, communication style, governance rules: what the agent can do, what needs your approval, what's off limits |
| USER.md | Profile card | Your name, role, work patterns, time zone, working style preferences |
| IDENTITY.md | Business card | The agent's name, avatar, emoji, and vibe; lets you run multiple agents with different identities |
| MEMORY.md | Notebook of verified facts | Durable context about your environment, decisions, and recurring patterns; auto-updated by the agent, so it needs regular review |
| HEARTBEAT.md | Daily checklist | The monitoring loops and their schedule, for example every 30 minutes or daily at 7 AM |
| Daily logs | Activity record | Timestamped record of what the agent did, used for debugging and auditing actions |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Agent deletes emails or ignores STOP commands (the META AI safety director incident on February 23rd) | Use a dedicated test email account for OpenClaw, not your primary or client communication account |
| MEMORY.md grows unchecked and pushes SOUL.md safety instructions out of the context window | Review what the agent writes to MEMORY.md regularly and keep it small and structured, not a dumping ground |
| Malicious skills installed from ClawdHub (341+ found, 36% with code flaws) | Audit any skill before installing it rather than pulling from ClawdHub without review |
| Exposed instance leaks API keys and credentials (reported on 30,000 to 42,000 instances) | Harden your own deployment; OpenClaw's defaults ship insecure and nobody does this for you |
| Running Claude Opus on every HEARTBEAT.md check produces $300 to $750 a month in bills | Switch to a budget model such as DeepSeek, Kimi K2.5, or Gemini Flash, or run locally through Ollama for standard monitoring loops |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **OpenClaw for Solopreneurs: AI Agents That Work While You Sleep**.
Read Lesson 1 on Substack →
## Continue the course
Browse all lessons in the [OpenClaw for Solopreneurs: AI Agents That Work While You Sleep](/courses/openclaw/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-openclaw-beginner-non-developer-assessment) to get new lessons in your inbox.
---
# What is Automation | Why It Matters | Your First n8n Automation Demo
URL: https://www.genaiunplugged.com/courses/n8n/lessons/what-is-automation/
> See what automation actually means, why it matters for your work, and watch a first n8n automation demo built from scratch.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 1. Introduction.
Watch the video above for the full tutorial, or read the written guide below.
## What is automation and why does it matter?
Automation executes a predictable set of actions based on specific conditions, removing the manual steps that create human error, slow throughput, higher resource costs, and low employee satisfaction. By replacing intuition-driven decisions with data-driven logic, automation lets businesses scale without hiring more people, boosts productivity by freeing employees for creative work, and cuts operational costs because a computer program is cheaper and faster than a person repeating the same task daily.
## How do you structure an n8n automation workflow?
Every n8n workflow contains three components. A trigger is the event that wakes the workflow up: a form submission, an incoming email, a WhatsApp or SMS message, a new lead, or a scheduled time such as every day at 8:00 a.m. Processing is the middle step where data gets filtered, segmented, modified, or transformed. Actions are the final output that completes the workflow, such as saving a record to a CRM, sending a welcome email, or posting a Slack alert to the sales team. The lead qualification demo in the lesson shows one workflow handling four outcomes from a single form submission: ignoring incomplete leads, routing low-value leads to an email sequence, saving high-value leads to a Google Sheet, and firing a Slack notification when an ideal-customer-profile match appears.
Before building any workflow in n8n, map the entire process as a flowchart using a tool like Miro or draw.io. Mapping upfront reveals every trigger, data path, and action so you can place all three key components before touching a single node. Then start small: test one section at a time and expand only after each piece works correctly.
Testing in automation matters more than in manual work because errors scale. A workflow running at volume will repeat a mistake thousands of times before anyone notices. Test every path and edge case thoroughly before going to production, then keep monitoring the live workflow so small problems get caught and fixed before they compound into larger ones.
## Key Takeaways
- Automation solves four manual-work problems: subjective decisions that cause inconsistent results, slow repetitive tasks, high resource costs from needing more staff, and low employee satisfaction from doing mundane work every day.
- Every n8n workflow has exactly three components: a trigger (the event that starts it), processing (filtering, segmenting, or transforming data), and an action (the final output such as a CRM update, an email, or a Slack message).
- The lead qualification demo shows one n8n workflow handling four outcomes from a single form submission: ignoring incomplete leads, adding low-value leads to an email sequence, saving high-value leads to a Google Sheet, and alerting the sales team in Slack.
- Map the full workflow as a flowchart before building in n8n; tools like Miro and draw.io help you identify every trigger, data path, and action upfront.
- A poorly designed workflow scales errors just as fast as it scales results, so always start small, test every edge case, and keep monitoring after launch.
## Related Lessons
- [Lesson 1: n8n AI Automation Course Introduction | Build AI Workflows (Zero to Hero)](/courses/n8n/lessons/n8n-ai-automation-course-introduction/)
- [Lesson 3: What is n8n & Why It's the Best Automation Tool | Auto-save Gmail Attachments](/courses/n8n/lessons/what-is-n8n-why-its-the-best-automation-tool/)
- [Lesson 17: n8n vs Zapier vs Make.com Comparison](/courses/n8n/lessons/n8n-vs-zapier-vs-makecom-comparison/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What types of events can trigger an n8n workflow?
Triggers in n8n can be any detectable event: a web form submission, an incoming email, a WhatsApp or SMS message, a Discord message, a new lead entering a system, or a scheduled time such as every Monday or every day at 5:00 p.m. Every workflow must begin with a trigger because it is the event that tells the automation to wake up and start processing data.
### What happens during the processing step in an n8n automation workflow?
The processing step filters, segments, modifies, or transforms incoming data before any action runs. In the lead qualification example from the lesson, processing checks whether company information is present, classifies the lead as low-value or high-value, and routes each category to a different downstream path. The lesson compares this step to a train station where data arrives, gets directed to the right platform, and continues toward its destination.
### Why does automation lower costs compared to doing the same work manually?
Automation replaces repetitive manual tasks with a computer program that runs the same logic consistently, so you need fewer employees for those tasks and can handle more volume without increasing headcount or work hours. The lesson uses a customer onboarding example where one automated workflow replaces an employee who would otherwise call customers, enter data into a CRM, and send a welcome email manually.
### What are the four best practices for building n8n automation workflows?
n8n workflow builders should follow four practices from the lesson: map the full process as a flowchart using tools like Miro or draw.io before building anything; start small and test one section at a time before expanding; thoroughly test every path and edge case before going to production because errors scale just like successful runs do; and monitor the live workflow continuously so problems get caught and fixed before they compound into larger issues.
---
# What is n8n & Why It's the Best Automation Tool | Auto-save Gmail Attachments
URL: https://www.genaiunplugged.com/courses/n8n/lessons/what-is-n8n-why-its-the-best-automation-tool/
> Discover what n8n is and why it beats other automation tools, then build your first workflow that auto-saves Gmail attachments.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 1. Introduction.
Watch the video above for the full tutorial, or read the written guide below.
## What is n8n and how does it compare to Zapier and Make.com?
n8n connects hundreds of apps, builds multi-step workflows, and runs AI agents without writing a single line of code, all on a source-available platform you self-host or deploy to the cloud. Three features separate it from Zapier and Make.com: workflow-based pricing (one charge per complete execution, not per step or operation), full self-hosting with no vendor lock-in, and native support for complex AI automations using conditional logic nodes, a code node, and an HTTP node.
## How do you build a Gmail-to-Google Drive attachment-saver in n8n?
The Gmail attachment workflow chains four nodes in sequence: a Gmail trigger, a Filter node, a Google Drive node, and a Discord node. The Gmail trigger wakes the workflow when a new email arrives and outputs all email properties including binary attachments. The Filter node checks whether an attachment exists and passes only matching emails forward. Google Drive uploads the file, and Discord posts a confirmation message using the email subject.
n8n nodes fall into three categories, all visible in this four-node demo. Trigger nodes start execution: the Gmail trigger fires on new email, but a new Google Sheet row, a CRM entry, or a scheduled time like every Monday at 7:00 a.m. all work as triggers too. Data-transformation nodes handle the middle: the Filter node evaluates a binary condition (attachment present or not) and routes only matching emails into the "kept" branch. Action nodes close the chain: the Discord node constructs a message from an expression that pulls the email subject directly from the Gmail trigger's output.
The Gmail trigger node exposes its settings panel when you double-click it on the canvas. The left side shows incoming data, the right side shows output; clicking "Fetch test event" pulls a real email and displays its full payload, including ID, subject, labels, and binary attachments. The Google Drive node accepts saved Google account credentials, sets the operation to "upload," references the binary attachment from the Gmail trigger, and targets a named folder such as "hands-on labs." Clicking "Test workflow" at the bottom of the canvas runs all four nodes in sequence and marks each with a green check mark on success.
## Key Takeaways
- n8n charges one fee per complete workflow execution, not per step, so a workflow with hundreds of nodes costs the same as a two-node one, making monthly costs predictable.
- n8n runs on a local machine, a private cloud server, or an enterprise instance, eliminating the vendor lock-in that applies to cloud-only tools like Zapier and Make.com.
- Every n8n workflow uses three node categories: trigger nodes that start execution, data-transformation nodes that filter and route data, and action nodes that complete tasks like uploading files or sending messages.
- The Gmail attachment workflow demonstrates the core pattern: Gmail trigger fires on new email, Filter node checks for a binary attachment, Google Drive node uploads the file, Discord node sends a subject-based confirmation.
- Mapping a business process in plain English before building in n8n makes the logic transferable: swap Gmail for Apple Mail, Google Drive for OneDrive, or Discord for Slack without changing the underlying workflow structure.
## Related Lessons
- [Lesson 1: n8n AI Automation Course Introduction | Build AI Workflows (Zero to Hero)](/courses/n8n/lessons/n8n-ai-automation-course-introduction/)
- [Lesson 2: What is Automation | Why It Matters | Your First n8n Automation Demo](/courses/n8n/lessons/what-is-automation/)
- [Lesson 17: n8n vs Zapier vs Make.com Comparison](/courses/n8n/lessons/n8n-vs-zapier-vs-makecom-comparison/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### How does n8n's workflow-based pricing differ from Zapier's and Make.com's per-step pricing?
n8n charges one fee per complete workflow execution regardless of how many nodes or data points run inside it. Zapier and Make.com charge per task, operation, or step, which becomes unpredictable when a single workflow contains hundreds of data-processing nodes. n8n's model keeps monthly automation costs predictable and easier to budget, especially for complex workflows.
### What does the Filter node do in an n8n workflow?
The Filter node checks a condition against incoming data and routes only matching items forward. In the Gmail attachment workflow, the Filter node checks whether a binary attachment exists on the incoming email. Emails that meet the condition move into the "kept" branch and continue to the Google Drive node; emails without attachments are dropped and the workflow stops for that item.
### What self-hosting options does n8n support?
n8n supports self-hosting on a local machine, a private cloud server, or an enterprise deployment, as well as an n8n-managed cloud subscription. Self-hosting keeps your business logic and data on your own infrastructure. Zapier and Make.com offer only cloud-hosted versions, which means your workflow data lives on their servers with no alternative.
### What is a trigger node in n8n, and what examples appear in the Gmail attachment lesson?
Trigger nodes wake an n8n workflow and start its execution; without one, no workflow ever runs. The Gmail trigger in this lesson fires when a new email arrives in the connected inbox. Other trigger examples from the lesson include a new row added to a Google Sheet, a new CRM entry, and a scheduled time such as every Monday at 7:00 a.m.
---
# 60-Minute Secure OpenClaw Setup on Hetzner (The Budget-Safe Way)
URL: https://www.genaiunplugged.com/courses/openclaw/lessons/60-minute-secure-openclaw-setup-on-hetzner/
> Set up OpenClaw securely on a Hetzner VPS in 60 minutes using Docker, Tailscale, and burner accounts, with a model cost comparison table.
The Security-First Setup pattern deploys OpenClaw on a Hetzner CX23 VPS, locked down with UFW firewall rules, SSH key-only access, and a Tailscale VPN before OpenClaw is installed, so the agent has zero public ports. Setup takes 90 minutes and runs under $20 a month, including a Telegram-connected default agent.
## What you will be able to do
- Provision a Hetzner CX23 VPS and lock it down with SSH key-only access and a deny-by-default UFW firewall
- Put the VPS and your laptop on the same private Tailscale network so no OpenClaw port is ever exposed to the public internet
- Set up burner Gmail and Telegram accounts so the agent never touches your real inbox or messages
- Install Docker and run the OpenClaw setup wizard to get a default agent responding to Telegram messages
- Open the OpenClaw dashboard through an SSH tunnel over Tailscale instead of a public URL
## Before you start
- Laptop with terminal access (macOS, Linux, or WSL on Windows)
- Credit card for Hetzner (about $4 a month for the VPS)
- Comfort typing terminal commands (no need to understand them)
- About 90 minutes of focused time, plan for up to 2 hours on a first server setup
## Reference
| Step | Command / Setting | Purpose |
|---|---|---|
| Generate SSH key | `ssh-keygen -t ed25519 -C "openclaw-hetzner"` | Creates the key used for VPS login |
| Cache SSH key | `ssh-add ~/.ssh/id_ed25519` | Avoids retyping the passphrase every SSH command |
| Deny-by-default firewall | `ufw default deny incoming`, `ufw default allow outgoing`, `ufw allow ssh`, `ufw enable` | Closes every port except SSH before OpenClaw touches the system |
| Disable password login | Edit `/etc/ssh/sshd_config`, set `PasswordAuthentication no`, then `systemctl restart ssh` | Requires key-based login, stops brute-force SSH attempts |
| Install and start Tailscale | `curl -fsSL https://tailscale.com/install.sh \| sh` then `tailscale up` | Puts the VPS on a private 100.x.x.x network only your devices can reach |
| Allow Tailscale subnet in UFW | `ufw allow from 100.64.0.0/10` | Lets your Tailscale devices reach the VPS while public traffic stays blocked |
| VPS spec | Hetzner CX23: 4GB RAM, 2 vCPU, 40GB SSD, Ubuntu 24.04 LTS | Enough headroom for OpenClaw plus Docker overhead, about $5 a month with IPv4 |
| Gmail app password | Go directly to `myaccount.google.com/apppasswords` | Lets OpenClaw connect to the burner Gmail via IMAP without the real account password |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| `*** System restart required ***` appears after `apt update && apt upgrade -y` | Run `reboot`, wait 30 seconds, then reconnect with `ssh root@[YOUR-VPS-IP]` |
| SSH connection returns "Permission denied" | Check you used the correct VPS IP and that your public key was actually added in Hetzner's SSH Keys field |
| First SSH connection shows "The authenticity of host can't be established" | This is normal on a first connection, type `yes` to continue |
| Connecting a real Gmail account directly to the agent risks data loss (a reported case had 200+ emails deleted when an agent lost context mid-thread) | Use burner Gmail and Telegram accounts instead of primary accounts, so a mistake only costs burner data |
| Following the common "get it working first, secure it later" setup order leaves the instance exposed, as with the 42,665 scanned OpenClaw instances (93.4% had authentication bypasses) | Do Tailscale, the firewall, and burner accounts before installing OpenClaw, not after |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **OpenClaw for Solopreneurs: AI Agents That Work While You Sleep**.
Read Lesson 2 on Substack →
## Continue the course
Browse all lessons in the [OpenClaw for Solopreneurs: AI Agents That Work While You Sleep](/courses/openclaw/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-openclaw-beginner-non-developer-assessment) to get new lessons in your inbox.
---
# Understanding Data in n8n | JSON, Lists & Items in n8n Explained
URL: https://www.genaiunplugged.com/courses/n8n/lessons/understanding-data-in-n8n/
> Learn how n8n structures data as JSON, understand items and lists, and read the data panel to debug workflows confidently.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## What is JSON and why does n8n use it?
JSON (JavaScript Object Notation) is the universal data exchange format that connects every app n8n integrates with. It stores data as key-value pairs, for example `"order_number": "ORD001"`, and unlike a rigid spreadsheet table it lets each record carry a completely different set of properties. CRMs, Google Sheets, Slack, Discord, and every API n8n touches all speak JSON, making it the foundational language of automation.
JSON solves the rigidity problem that tabular data cannot. A smartphone order and a t-shirt order share header fields (order number, customer name, address) but need completely different product attributes. JSON nests objects inside objects, so product details live inside the order object, and each record describes exactly what it needs without forcing every field into the same columns. Think of it like a bento box where compartment sizes flex to fit the meal, not a fixed-grid cafeteria tray where protein and carbs must share equal space whether they fit or not.
JSON is also a plain text format, which means it compresses easily, transfers across networks cheaply, and parses reliably in every programming language. Those properties are why it became the dominant exchange format between applications and why n8n uses it internally for every node input and output.
## How does a JSON list store multiple items in one structure?
A JSON list, also called an array, stores multiple items inside square brackets `[ ]`. Any time square brackets appear in JSON, everything inside is a collection of individual items that can each have different properties. A single order can contain a list of products: an iPhone with seven attributes and an Avengers t-shirt with five, with no requirement that both items share the same fields.
The distinction between a list and a single object matters in automation. Two separate orders with one product each are like two delivery boxes with one item apiece. One order with two products is one big box with two items inside. JSON describes both cleanly. The outer object holds the shared header data (order number, customer, address) and a key like `products` holds the array, with each product sitting inside its own `{ }` block, separated by commas.
Commas separate items within the array, and the closing square bracket ends the list. Items inside the list do not need to be identical in structure. The smartphone can carry seven attributes while the t-shirt carries five, and JSON handles both without complaint.
## How do you read a JSON value using dot notation?
Dot notation chains key names to walk into nested JSON objects, and square-bracket indexes pick a specific item out of a list. To reach the product name in the first order of a list variable called `orders`, write `orders[0].order.product.name`. The `[0]` grabs the first order (lists are zero-indexed, so position zero is first), each `.` steps into the next nested object, and the final key returns the value.
For a single-order variable called `order_data` there is no outer list, so you skip the index: `order_data.order.products[0].name` returns the first product name directly, and `order_data.order.products[1].price` returns the second product's price, which in the lesson example is $119.
The rule is: use square brackets with a number whenever you are selecting one item from a list, and use dot notation whenever you are stepping into a named object. Chaining both together lets you reach any value no matter how deeply nested. This exact syntax appears in n8n expressions whenever a node references data from a previous node, so mastering the pattern transfers directly to building workflows.
## How does n8n represent and process JSON data as items?
In n8n, a list of JSON objects becomes a list of items, and every node processes each item individually. If a trigger node fetches ten customer orders, every downstream node applies its configured logic to all ten orders one at a time and passes ten output items forward. The item count stays consistent across nodes unless a node is specifically designed to merge or split data.
This per-item processing model means logic you configure once scales automatically to any volume of records. A workflow built to process one order handles a hundred orders without any changes. When debugging unexpected output, checking whether the item count entering a node matches what you expect, and whether the JSON keys you are referencing actually exist on every item, resolves the majority of data-flow mysteries.
## Key Takeaways
- **JSON is the lingua franca of n8n integrations.** Every app n8n connects to exchanges data as JSON key-value pairs, so understanding JSON structure is non-negotiable before building reliable automations.
- **Square brackets signal a list; curly braces signal an object.** Whenever `[ ]` appears in JSON you are dealing with multiple items that each need a zero-based index (`[0]`, `[1]`) to access individually.
- **Dot notation plus index chaining unlocks any value.** Walk nested objects with dots and pick list items with indexes: `orders[0].order.product.name` retrieves the product name from the first order in the list.
- **Every n8n node processes items one at a time.** A node receiving ten items applies its logic ten times and outputs ten items, so one well-configured node handles any volume of records automatically.
- **JSON beats tabular formats for heterogeneous data.** A smartphone order and a t-shirt order coexist in the same list with completely different product attributes, something fixed spreadsheet columns cannot accommodate without creating separate tables.
## Related Lessons
- [Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting](/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/)
- [Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js](/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/)
- [Lesson 6: How to Install n8n for free on local machine using Docker Desktop](/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/)
- [Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings](/courses/n8n/lessons/n8n-interface-walkthrough-2025/)
- [Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions](/courses/n8n/lessons/n8n-node-types-explained/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is JSON and why is it important for n8n automation?
JSON (JavaScript Object Notation) is a structured key-value pair format used by virtually every application to exchange data. In n8n, every node input and output uses JSON, because every external service n8n connects to, including CRMs, Google Sheets, Slack, and REST APIs, communicates in JSON. Understanding JSON structure is the foundation for reading, transforming, and troubleshooting data in any n8n workflow.
### What is the difference between a JSON object and a JSON list in n8n?
A JSON object stores named key-value pairs inside curly braces `{ }`, for example a single order with fields like order number and customer name. A JSON list, also called an array, stores multiple items inside square brackets `[ ]`, for example a list of products inside one order or a list of orders from a trigger. In n8n, lists become collections of items that each node processes individually.
### How do you access a nested JSON value using dot notation in n8n?
Dot notation chains key names to step through nested objects, and square-bracket indexes select a specific item from a list. For a list variable called `orders`, `orders[0].order.product.name` returns the product name from the first order. Lists are zero-indexed, so `[0]` is the first item and `[1]` is the second. This same dot-and-bracket syntax is used directly inside n8n expressions to reference data from previous nodes.
### What are n8n items and how does a node handle a list of them?
n8n items are individual JSON objects inside the list of data passing through a workflow. When a trigger node fetches ten orders, it produces ten items. Every downstream node automatically applies its configured logic to each item separately and passes the same ten items forward. This per-item processing means a workflow built for one record scales to any number of records without additional configuration.
---
# n8n vs Zapier vs Make.com Comparison
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-vs-zapier-vs-makecom-comparison/
> Compare n8n, Zapier, and Make.com on pricing, flexibility, and self hosting to pick the right automation tool for your workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 1. Introduction.
Watch the video above for the full tutorial, or read the written guide below.
## What is the difference between n8n, Zapier, and Make.com?
n8n, Zapier, and Make.com are the three leading workflow automation platforms, each built around a different pricing and control model. Zapier charges per task (each step in a workflow counts separately), Make.com charges per operation (even a condition check costs one operation), and n8n charges per workflow execution regardless of how many nodes or steps it contains. n8n also uniquely supports self-hosting, while Zapier and Make.com are cloud-only. For complex automations on a predictable budget, n8n is the strongest fit.
## How to choose between n8n, Zapier, and Make.com for your use case?
**n8n's per-execution pricing and self-hosting option anchor the two most important decisions.** n8n's model means a 100-node workflow costs the same single execution unit as a 5-node one, making costs predictable as you scale. Zapier's per-task model inflates quickly on branching workflows, and Make.com's per-operation counting charges every condition check. For sensitive data like medical records or PII, n8n is the only tool you can deploy on your own server, which is what HIPAA, SOC 2, and GDPR compliance often requires. Zapier and Make.com are cloud-only and can't meet on-premise data residency needs.
**n8n's workflow canvas, coding support, and AI agent node give technical builders the most flexibility.** n8n supports if-else nodes, switch statements, loops, merge nodes, and full JavaScript and Python scripting directly in the canvas. Zapier covers basic if-this-then-that branching with no loops, and Make.com adds visual routers and branching but locks custom scripting to enterprise plans. For AI, n8n integrates the full OpenAI API, LangChain, and a dedicated AI agent node for building multi-agent workflows. Zapier has AI steps with limited customization, and Make.com supports OpenAI and Hugging Face models but lacks deep API control.
**Zapier's integration count leads, but n8n's HTTP node and error handling close the gap.** Zapier offers 6,000-plus out-of-the-box connectors, n8n offers around 4,000, and Make.com has 1,500. n8n's HTTP node connects to any API or webhook even when no official integration exists, covering apps too niche for the main registry. On error handling, n8n lets you build custom error workflows that log failures to Slack, retry failed steps, or pause execution entirely. Zapier provides basic error paths, and Make.com supports retry and partial execution settings. At enterprise scale, choose Zapier for quick simple setups, Make.com for visual no-code work on the cloud, and n8n when you need self-hosting, custom logic, and Docker-based infrastructure to grow.
## Key Takeaways
- n8n charges per workflow execution, not per step or operation, so a 100-node workflow and a 5-node workflow cost the same single execution unit.
- n8n is the only tool of the three that supports self-hosting and on-premise deployment, making it the only compliant path for HIPAA, SOC 2, or GDPR-regulated data.
- Zapier leads with 6,000-plus integrations, but n8n's HTTP node connects to any API or webhook even when no official connector exists.
- n8n's AI agent node, full OpenAI API integration, and LangChain support make it the most extensible platform for custom AI and multi-agent workflows.
- n8n supports full JavaScript and Python scripting on all plans, while Zapier limits package support and Make.com restricts scripting to enterprise customers.
## Related Lessons
- [Lesson 1: n8n AI Automation Course Introduction | Build AI Workflows (Zero to Hero)](/courses/n8n/lessons/n8n-ai-automation-course-introduction/)
- [Lesson 2: What is Automation | Why It Matters | Your First n8n Automation Demo](/courses/n8n/lessons/what-is-automation/)
- [Lesson 3: What is n8n & Why It's the Best Automation Tool | Auto-save Gmail Attachments](/courses/n8n/lessons/what-is-n8n-why-its-the-best-automation-tool/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### How does n8n's per-execution pricing work compared to Zapier's per-task model?
n8n counts one workflow run as one execution regardless of how many nodes or steps it contains. Zapier counts each step individually as one task, so a five-step workflow running 100 times consumes 500 tasks. Make.com counts every operation, including each condition check, separately. n8n's model delivers predictable costs for complex, branching automations and wins on value as workflow complexity grows.
### Can n8n be self-hosted for HIPAA or GDPR-sensitive workflows?
n8n is open-source and can be deployed on your own server or local network, keeping all workflow data and business logic inside your own infrastructure. Zapier and Make.com are cloud-only and can't meet on-premise data residency requirements. Self-hosted n8n is the only viable path for healthcare, finance, or any use case handling PII subject to HIPAA, SOC 2, or GDPR.
### How does n8n's AI agent node differ from Zapier's and Make.com's AI features?
n8n's AI agent node supports the full OpenAI API and LangChain libraries, letting you build multi-agent pipelines and custom GPT-style chatbots directly inside a workflow. Zapier offers AI steps and an AI-powered builder but limits customization. Make.com supports OpenAI and Hugging Face models but lacks deep API control. n8n is the only option that exposes the full model API surface for custom AI automation.
### When does Zapier or Make.com make more sense than n8n?
Zapier makes sense when you need the broadest out-of-the-box app library (6,000-plus integrations) and prioritize setup speed over long-term cost control. Make.com suits users who want a visual no-code builder with advanced routing while staying on the cloud. Neither fits when self-hosting, full JavaScript and Python scripting, or per-execution pricing is a hard requirement for your workflow.
---
# n8n Quick Start Workflow | Connect Airtable, Notion, Slack & Amazon SES
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-quick-start-workflow/
> Build an n8n quick start workflow connecting Airtable, Notion, Slack, and Amazon SES in one working automation you can reuse.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is n8n's role when connecting multiple business apps?
n8n acts as a universal translator for disconnected business apps. Most software tools , Google Sheets, Airtable, HubSpot, Slack, Notion , do not talk to each other natively. n8n sits in the middle: a trigger fires when something happens in one app, and n8n performs sequential actions across the others, moving data without code or a programmer. The HTTP node covers any app that lacks a dedicated built-in node.
## How to build a lead management workflow connecting Google Forms, Google Sheets, Slack, Notion, and Airtable
The Webhook node is the entry point for this workflow. Configure it with HTTP method POST (not GET, because you are receiving and processing data, not fetching it), then copy its test URL into each Google Form's Apps Script. A single Webhook node can receive submissions from multiple forms at once, replacing the daily manual task of browsing survey responses.
The Google Sheets node handles lead storage, and the IF node replaces manual qualification. Use the "Append Row" operation in Google Sheets, not "Append or Update Row," which errors without a match-column ID. After the row is saved, the IF node evaluates two conditions: company name "is not empty" and email "does not end with gmail.com" or "hotmail.com." Leads meeting all conditions route to the True branch; others go to False and stop.
On the True branch, three sequential nodes handle the qualified lead. A Slack node (resource: Message, operation: Send) posts a "New Lead Alert" with the contact's first and last name dragged from the Webhook output into the message text. A Notion node (resource: Database Page, operation: Create) adds a follow-up task to the sales team's task tracker. To wire up Notion, create an internal integration at notion.so/my-integrations, copy the API secret into n8n credentials, then invite that integration to the specific page via the page's three-dot menu and Connections. Finally, an Airtable node logs the lead in the CRM.
## Key Takeaways
- The Webhook node serves as a single listener for multiple Google Forms: configure each form's Apps Script to POST to the same webhook URL, eliminating manual data collection.
- Use "Append Row" in the Google Sheets node, not "Append or Update Row"; the latter requires a match-column ID and throws a configuration error when adding new records.
- The IF node replaces a human reviewer: combining a company-name "is not empty" check with email-domain conditions routes only business leads to the sales pipeline.
- Notion's internal integration requires three distinct steps: create the integration at notion.so/my-integrations, paste the API secret into n8n, then invite the integration to the target page via that page's Connections menu.
- The HTTP node extends n8n to any REST API not covered by a built-in node, making the Slack, Notion, Airtable, and Google pattern reachable for nearly any business software.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why does the Google Sheets node throw an error when set to 'Append or Update Row'?
The Google Sheets node's 'Append or Update Row' operation requires a 'Column to Match On' parameter so n8n knows which existing row to update. When the goal is only adding new lead records, switch the operation to 'Append Row,' which skips the match-column requirement entirely and inserts a new row without error.
### How does the IF node qualify leads without using AI in this workflow?
The IF node evaluates two conditions against each incoming submission: company name 'is not empty,' confirming the field was filled, and email address 'does not end with gmail.com' or 'hotmail.com,' confirming a business address. Leads satisfying all conditions exit the True branch and trigger Slack, Notion, and Airtable actions; others exit False and stop.
### What are the exact steps to connect a Notion workspace to n8n?
Notion's internal integration setup has three steps. First, go to notion.so/my-integrations, create a new integration, select Internal type (no Notion team approval needed for a single workspace), and copy the API secret. Second, paste that secret into n8n's Notion credential field. Third, open the target Notion page, click the three-dot menu, choose Connections, and search for the integration name to grant it read, update, and insert access.
### Can one Webhook node in n8n receive data from more than one Google Form?
Yes. A single Webhook node configured with HTTP method POST generates one URL that multiple Google Forms can all target. Each form's Apps Script is configured to POST to that same URL. The Webhook node processes every incoming submission regardless of which form sent it, which is how this workflow replaces a manual daily review of many separate survey sheets.
---
# Sub-Workflows
URL: https://www.genaiunplugged.com/courses/n8n/lessons/sub-workflows/
> Build reusable n8n sub-workflows with the Execute Workflow node, pass data between flows, and reuse logic across projects.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What Are Sub-Workflows in n8n?
A sub-workflow is a separate workflow you call from another workflow, like a reusable function. The calling workflow uses the Execute Sub-workflow node, and the sub-workflow runs from its own Execute Sub-workflow Trigger, accepts input data, and returns a result.
## How to Use Sub-Workflows in n8n
Build the reusable logic as its own workflow that starts with an Execute Sub-workflow Trigger. In the main workflow, add an Execute Sub-workflow node, select that workflow, and pass in the data it needs. The sub-workflow runs and hands its output back to the main flow. Use sub-workflows to reuse one tested process across many automations, keep large workflows readable, and isolate logic you change often.
## Key Takeaways
- Understanding the core concepts covered in this lesson
- Practical, hands-on experience you can apply immediately
- Tips from real-world n8n workflow implementations
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What will I learn in this lesson?
A sub-workflow is a reusable workflow you call from another using the Execute Sub-workflow node. You will learn to pass data in and out, and why sub-workflows keep large automations readable and let you reuse one tested process everywhere.
### Do I need to watch the previous lessons first?
This lesson builds on earlier concepts. If you are new to n8n, start with Lesson 1 for the best learning experience.
### Can I get help if I get stuck?
Join the GenAI Unplugged community on Substack where Dheeraj answers questions and shares additional tips.
---
# n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-node-types-explained/
> See how trigger, app, and core nodes fit together in an n8n workflow, with a video walkthrough of building one from scratch.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## What are the four node types in n8n?
n8n classifies every workflow component into one of four node types. Trigger nodes start the automation when a specific event fires, such as a form submission or a new Slack message. App nodes (also called action nodes) add, remove, or send data to external systems. Core nodes handle logic, scheduling, and generic API calls without connecting to an external service. Cluster nodes group multiple nodes into one unit, like an AI agent, and are covered in the AI-integration section of the course.
## How to build a workflow using trigger, app, and core nodes in n8n
Trigger nodes set the starting condition for every production workflow. The simplest option is the Manual Trigger, which fires when you click "Test Workflow." Real automations use event-based triggers instead: a new row added to Google Sheets, a new email in your inbox, or a scheduled time such as every morning at 8 a.m. Every workflow you deploy in n8n must include exactly one trigger node, because that node decides when the automation runs.
App and core nodes sit in the middle of the workflow, processing data between the trigger and the final output. To add one, click the "+" icon on the canvas and search for the service or function you need. Selecting Google Sheets opens the node configuration panel, where you pick the operation (such as "Get Rows"), connect OAuth credentials, and choose the target document and sheet. The panel shows incoming data on the left, configuration settings in the center, and output on the right.
Action nodes complete the workflow by sending results to an external destination, such as updating a spreadsheet, posting a Slack notification, or writing to a database. Once a node runs successfully, you can click "Pin Data" to freeze its output for the rest of your build session, so you do not have to re-execute that node on every test run. n8n charges per workflow execution rather than per node, so pinning data saves build time without adding cost.
## Key Takeaways
- **Trigger nodes** listen for a specific event (form submission, scheduled time, new data row) and every deployed n8n workflow must have exactly one.
- **App nodes** connect to named external services like Google Sheets or Slack to read, write, or trigger actions in those systems.
- **Core nodes** (Filter, Set, Code) transform and route data using logic or custom JavaScript/Python without authenticating to a specific third-party service.
- **Cluster nodes**, such as the AI Agent node, bundle multiple nodes into a single unit and are covered separately in the AI-integration portion of the course.
- **Pin Data** locks a node's output during development, letting you test downstream steps repeatedly without re-fetching live data on every run.
## Related Lessons
- [Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting](/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/)
- [Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js](/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/)
- [Lesson 6: How to Install n8n for free on local machine using Docker Desktop](/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/)
- [Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings](/courses/n8n/lessons/n8n-interface-walkthrough-2025/)
- [Lesson 9: Build Your First n8n Workflow - Send Welcome Emails Automatically](/courses/n8n/lessons/build-your-first-n8n-workflow-send-welcome-emails-automatically/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What makes a trigger node different from app and core nodes in n8n?
Trigger nodes are the only nodes that decide when a workflow runs, not what it does. While app and core nodes process data that is already flowing, a trigger node waits for a specific event, such as a new email, a form submission, or a scheduled time, then starts the entire execution chain. Every deployed n8n workflow must begin with exactly one trigger node.
### How do core nodes differ from app nodes in n8n?
Core nodes perform logic, scheduling, or generic API calls entirely within the workflow without authenticating to a specific named external service. App nodes, by contrast, call a named third-party service such as Google Sheets or Slack. Examples of core nodes include the Filter node (conditional checks), the Set node (adding or modifying fields), and the Code node, which accepts both JavaScript and Python.
### What does the Pin Data feature do in the n8n node editor?
The Pin Data feature freezes a node's output so n8n reuses those cached results for every downstream test run instead of re-executing the node. In the course demo, pinning the Google Sheets 'Get Rows' node locked 100 sample rows in place across the entire build session. A blue icon appears on the node to confirm its output is pinned.
### What is a cluster node in n8n and when is it used?
Cluster nodes group multiple individual nodes into a single combined unit to accomplish a complex task, with the AI Agent node being the primary example given in the course. The instructor classifies cluster nodes as the fourth node type but explicitly defers them to the AI-integration section, so they are not configured in the introductory node-types lesson.
---
# n8n Item Linking Explained | How Data Flows Between Nodes in n8n
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-item-linking-explained/
> See how n8n item linking connects output data back to its source input, so you can trace exactly how data flows between nodes.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is n8n item linking and why does it matter?
Item linking (also called data linking) is n8n's mechanism for tracking which output items originated from which input items as data flows through a workflow. n8n maintains this chain automatically in most scenarios: a single input always links to its output, and multiple outputs all link back to a single input. When that chain breaks, downstream nodes lose access to ancestor data and throw "paired item data unavailable" errors that stall the workflow.
## How to fix broken item linking in n8n Code nodes and Merge nodes
Item linking breaks inside a Code node when the number of output items differs from the number of input items, or when the node constructs entirely new item objects. For example, filtering 10 snack items down to 3 and producing a new `product_review` field for each means n8n can no longer automatically trace which output came from which input. The fix is to add a `pairedItem` property to each output object and set its value to the index of the corresponding input item, for instance `pairedItem: i` where `i` is the loop counter. n8n reads that field to re-establish the chain, converting red expression previews to green in all downstream nodes.
The Merge node introduces a different failure mode. Its "combine by position" mode pairs items strictly by their order in each branch. If two branches produce items in different sequences, positional merging silently joins the wrong records. A snacks branch ordered by ID and a reviews branch in a different order will cross-link cheese-ball reviews to nacho-chips data. The correct fix is to switch the Merge node to "on matching fields" mode and name the field that uniquely identifies records on both sides.
When the matching field carries different names in each input branch, for example `product` on one side and `product_name` on the other, enable the "fields to match have different names" setting and map each side explicitly. After this change, the Merge node joins cheese balls to cheese balls and nacho chips to nacho chips regardless of the order items arrive in either branch.
## Key Takeaways
- Item linking is n8n's provenance chain: each output item references the input item it came from, which is what lets a node read fields from nodes several steps earlier in the workflow.
- n8n breaks automatic linking in a Code node when output count differs from input count or when the code constructs brand-new item objects without `pairedItem` hints.
- Fix broken Code node linking by adding `pairedItem: ` to every output object; n8n uses that field to reconnect the chain and resolve downstream expressions.
- Merge node "combine by position" corrupts data silently when the two input branches deliver items in different orders; use "on matching fields" and specify a shared identifier instead.
- The "paired item data unavailable" error and red expression previews in downstream nodes are the diagnostic signals that item linking broke upstream, most often inside a Code node, Merge node, or Split node.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does 'paired item data unavailable' mean in n8n?
The 'paired item data unavailable' error means a downstream node cannot trace an output item back to the input item that produced it. n8n throws this when a Code node, Merge node, or Split node breaks the item-linking chain, typically by outputting a different number of items than it received or by constructing entirely new item objects without a `pairedItem` reference.
### How do you fix item linking in an n8n Code node?
Add a `pairedItem` property to each object in the Code node's output array and set its value to the index of the corresponding input item. For example, write `pairedItem: i` where `i` is the loop counter. n8n reads that field to reconnect the output item to the correct input, restoring access to fields from all ancestor nodes and clearing 'paired item data unavailable' errors in downstream nodes.
### When does n8n maintain item linking automatically?
n8n maintains item linking automatically when a node has a single input and a single output, when one input produces multiple outputs (all outputs link to that one input), or when the number of inputs equals the number of outputs and their order is preserved. Linking breaks when the counts differ, when a Code node creates entirely new item objects, or when items are reordered without `pairedItem` hints.
### Why does the n8n Merge node produce wrong results with 'combine by position'?
The Merge node's 'combine by position' mode pairs the first item from input one with the first item from input two regardless of content. If two branches produce items in different orders, positional merging silently joins the wrong records. Switching to 'on matching fields' mode and specifying a shared identifier, such as matching `product` on one branch to `product_name` on the other, ensures each item joins its correct counterpart.
---
# n8n AI Automation Course Introduction | Build AI Workflows (Zero to Hero)
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-ai-automation-course-introduction/
> See what the n8n Zero to Hero course covers and set up your workspace so you can start building real AI automation workflows in n8n.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 1. Introduction.
Watch the video above for the full tutorial, or read the written guide below.
## What is the n8n AI Automation Zero to Hero Course?
The n8n AI Automation Zero to Hero Course teaches complete beginners to build AI-powered automation workflows without writing a single line of code. Structured across nine sections, it moves from n8n fundamentals and installation through advanced logic, error handling, and OpenAI/ChatGPT integration, culminating in a capstone project that builds a fully automated, AI-driven faceless YouTube channel running on autopilot.
## How does the course build automation skills across its nine sections?
Sections 1 and 2 establish absolute basics: what automation is, why it matters, how to install n8n (self-hosted or cloud), and the core vocabulary of nodes, workflows, and triggers. Learners build their first automation, a form-submission email responder, and learn how data flows through n8n using JSON and list items before exploring essential nodes hands-on.
Sections 3 and 4 level up the skillset. Section 3 covers connecting external apps like Google Sheets, Slack, and Notion, then dives into advanced logic including IF-else conditions, loops, branching, expressions, the HTTP node, the code node, subworkflows for reusability, and file handling. Section 4 focuses entirely on error handling and debugging, including how to build error-handling workflows that fire a notification the moment a run fails.
Sections 5 through 7 shift to applied projects. Section 5 is a hands-on end-to-end workflow build using all prior concepts. Section 6 introduces OpenAI/ChatGPT APIs to power content generation, AI-driven decision-making (approvals, fraud detection), and automated customer response summarization. Section 7 brings everything together in the course's flagship output: a faceless YouTube channel that researches, writes, posts, and schedules content entirely on autopilot.
## Key Takeaways
- **No-code premise is absolute.** The course explicitly promises that learners build production-ready workflows without writing a single line of code, including the AI-integrated sections.
- **Nine-section structure mirrors a real learning arc.** Each section gates the next: basics before integrations, integrations before error handling, error handling before AI-layer projects.
- **Subworkflows unlock reusability.** Section 3 introduces subworkflows specifically to let learners build small, portable workflow components that plug into larger automations, a pattern the course frames as an industry best practice.
- **The capstone is a faceless YouTube channel.** Section 7 ties every prior concept into one real-world output: an AI-automated channel that generates and publishes content without manual intervention.
- **n8n's open-source nature is positioned as a differentiator.** The course explicitly compares n8n against Zapier and Make.com and highlights open-source as the key distinction, covered in Section 1.
## Related Lessons
- [Lesson 2: What is Automation | Why It Matters | Your First n8n Automation Demo](/courses/n8n/lessons/what-is-automation/)
- [Lesson 3: What is n8n & Why It's the Best Automation Tool | Auto-save Gmail Attachments](/courses/n8n/lessons/what-is-n8n-why-its-the-best-automation-tool/)
- [Lesson 17: n8n vs Zapier vs Make.com Comparison](/courses/n8n/lessons/n8n-vs-zapier-vs-makecom-comparison/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What repetitive tasks does this n8n automation course teach you to eliminate?
The course grounds its examples in three common pain points the transcript names directly: manually sorting hundreds of emails each morning, copying data between spreadsheets in data-entry roles, and logging into multiple platforms to repurpose and post content as a creator. The automation workflows built in the course handle all three, including AI-generated summaries delivered via text or Telegram, auto-updated dashboards, and scheduled social media drafts.
### Does the n8n Zero to Hero course require any coding or programming background?
The n8n Zero to Hero course requires zero coding knowledge. The transcript explicitly states learners will build powerful automation systems without writing a single line of code and without needing Python, a computer science degree, or programming experience. Every concept is taught through hands-on labs and practical workflow builds rather than code-first instruction.
### What is the capstone project built in the n8n AI Automation course?
The capstone project, covered in Section 7, is a fully automated faceless YouTube channel powered by n8n and AI. The channel researches topics, generates content, formats posts, and publishes or schedules everything autonomously, with no manual intervention required. The course positions this as the practical proof that all nine sections of skills combine into one working real-world system.
### How does n8n compare to Zapier and Make.com according to this course?
The course covers the n8n-versus-Zapier and n8n-versus-Make.com comparison in Section 1 and identifies n8n's open-source nature as the primary differentiator. Beyond that, the transcript does not detail specific feature comparisons, so the full breakdown is a topic addressed inside the lesson itself rather than the introduction.
---
# Master Error Handling in n8n | Build Reliable n8n Workflows That Don't Break
URL: https://www.genaiunplugged.com/courses/n8n/lessons/master-error-handling-in-n8n/
> Handle errors in n8n workflows the right way: catch failures, retry safely, and build automations that don't break in production.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 4. Error Handling & Debugging.
Watch the video above for the full tutorial, or read the written guide below.
## What is error handling in n8n?
Error handling in n8n keeps workflows running when something goes wrong by setting fallback actions instead of stopping execution. Every n8n node exposes an "On Error" setting with three choices: stop the workflow (default), continue and pass the error as an item in the regular output, or continue and route failed items to a dedicated error output branch. Picking the right option lets you log failures, notify your team, and process remaining items without interrupting the run.
## How do you configure error handling on any n8n node?
**Open the node's Settings tab**
The Settings tab on every n8n node holds two error-related controls: "Retry on Fail" and "On Error." Retry on Fail triggers automatic re-attempts before the node gives up, which suits temporary API outages where a second or third attempt may succeed on its own. Avoid relying on retry for permanent errors like uploading a PDF to a Notion field that only accepts images; the node fails every attempt regardless of how many retries you configure.
**Choose the right On Error action**
The "On Error" dropdown offers three actions. "Stop Workflow" is the default and halts execution the moment any node fails, including inside a loop. "Continue - pass error message as item in regular output" keeps execution going and injects an error property into the item, which an IF node can detect by checking whether `$json.error` exists. "Continue using error output" adds a second output connector directly to the node, routing failed items through a dedicated error branch so you can handle successes and failures in parallel without needing a separate IF node.
**Add context to your error notifications**
The error output branch carries richer context than a plain error string, including the data URL and success status from the failed iteration. Pipe those fields into your notification node so the message reads something like "error occurred in your workflow due to data in one iteration which had a URL of [PDF link]" rather than a generic "error occurred." A developer receiving that message can immediately diagnose a PDF-versus-image mismatch without re-running the workflow, and the rest of the nine-item loop completes cleanly.
## Key Takeaways
- The "On Error" setting on every n8n node defaults to "Stop Workflow"; switching it to either Continue option lets a loop finish all remaining items even when one record fails.
- "Retry on Fail" is the right tool for temporary outages where a second or third attempt may resolve the issue on its own, not for permanent type mismatches.
- "Continue using error output" splits the node into two physical output connectors, eliminating the need for a separate IF node to route successes and failures.
- The error output branch surfaces contextual data beyond a raw error string, such as the URL of the failing record, giving your team actionable details instead of an abstract alert.
- Brainstorm failure scenarios before building each workflow so error paths are wired in from the start rather than retrofitted after a production crash.
## Related Lessons
- [Lesson 32: Master AI Automation Workflows Debugging & Error Handling with Execution Logs](/courses/n8n/lessons/master-ai-automation-workflows-debugging-error-handling-with-execution-logs/)
- [Lesson 33: How to fix AI Automation Workflows Fast in n8n | Error Handling & Debugging](/courses/n8n/lessons/how-to-fix-ai-automation-workflows-fast-in-n8n/)
- [Lesson 34: Error Workflows in n8n AI Automation | Stop & Error Node | Error Trigger Node](/courses/n8n/lessons/error-workflows-in-n8n-ai-automation/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the difference between 'Continue - pass error message as item in regular output' and 'Continue using error output' in n8n?
'Continue - pass error message as item in regular output' injects an error property into the regular data stream, requiring a downstream IF node to split successful and failed items by checking whether `$json.error` exists. 'Continue using error output' adds a second physical connector to the node itself, routing failures to a dedicated branch automatically and including richer context like the data URL and status of the failed item, with no extra IF node needed.
### When should the Retry on Fail setting be used in n8n?
'Retry on Fail' is appropriate for temporary errors such as an API being momentarily unavailable, where a second or third attempt may succeed on its own. It is not useful for permanent errors like sending a PDF to a Notion field configured to accept only images; in those cases, every retry fails identically and only adds delay before the node finally throws the error.
### How does the n8n IF node detect whether an error occurred in a previous node?
The IF node reads a `$json.error` property that n8n injects into the item when 'On Error' is set to 'Continue - pass error message as item in regular output.' Set the IF condition to check whether that field exists; items carrying the property route to the true branch for error handling such as sending a notification, while clean items route to the false branch to continue processing normally.
### Why does one record's failure stop an entire n8n loop, and how do you prevent it?
n8n's default 'On Error' action is 'Stop Workflow,' which halts execution the moment any node fails, including mid-loop. Changing the failing node's 'On Error' setting to either Continue option lets the Loop Over Items node keep processing remaining records, so eight out of nine uploads can complete successfully even when the fifth item throws a bad-request error.
---
# n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-interface-walkthrough-2025/
> Tour the full n8n interface for 2025: navigate the UI, admin panel, and settings to get comfortable before building workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## What is the n8n workspace interface and how is it organized?
The n8n workspace interface opens on an Overview tab that shows every workflow, credential, and execution in one place. Projects bucket that content by team or purpose, while folders inside each project add a second organizational layer. The Starter plan includes one shared project; Pro unlocks three. A sidebar also links to the Admin panel, Templates library, Variables, and personal settings.
## How to navigate projects, admin settings, and workflow tools in n8n
The Admin panel's dashboard reports monthly execution counts, workspace online or offline status, and the running n8n version. The gear icon inside the panel opens Workspace Settings, where the time zone field controls when schedule triggers fire. Every workflow inherits this time zone unless you override it inside a specific workflow's own Settings panel. A Restart button reboots the cloud instance if a runaway workflow makes the workspace unresponsive.
Pricing tiers in the Admin panel determine what features and limits apply. The Starter plan costs $24 per month ($20 billed annually) and includes 2,500 executions, five active workflows, and one shared project. The Pro plan starts at $60 per month for 10,000 executions, 15 active workflows, global variables, and admin roles. n8n counts one execution per complete workflow run regardless of how many nodes it contains, so a 50-step automation costs the same single execution as a 2-step one.
The canvas is where you build automations by connecting nodes. Clicking "Create workflow" opens it and immediately prompts you to pick a trigger node: manual, schedule, webhook, app event, or form submission. Clicking "Test workflow" runs the canvas immediately and writes the result to the Executions tab. To run a workflow in production, toggle it from Inactive to Active; only workflows with non-manual triggers can be activated. Workflow-level settings, reached from the three-dot menu, let you set a per-workflow time zone override, designate an error workflow, choose which executions to save, and set a timeout to stop stuck runs.
## Key Takeaways
- The Overview tab and Projects organize every workflow and credential in your workspace; folders inside projects add a second grouping layer, and the Starter plan limits you to one shared project.
- n8n charges one execution per workflow run regardless of step count, so a 100-node automation still costs one execution against your monthly quota.
- The workspace time zone in Admin > Workspace Settings is inherited by all workflows; override it per workflow inside that workflow's own Settings panel when regional scheduling differs.
- Activating a workflow switches it to production mode so schedule, webhook, and app-event triggers fire automatically; manual-trigger workflows can't be activated and must be run by clicking "Test workflow."
- The Templates library lists 1,588+ pre-built workflows; import directly to a cloud workspace or download as JSON to load into a local n8n instance via "Import from file."
## Related Lessons
- [Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting](/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/)
- [Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js](/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/)
- [Lesson 6: How to Install n8n for free on local machine using Docker Desktop](/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/)
- [Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions](/courses/n8n/lessons/n8n-node-types-explained/)
- [Lesson 9: Build Your First n8n Workflow - Send Welcome Emails Automatically](/courses/n8n/lessons/build-your-first-n8n-workflow-send-welcome-emails-automatically/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does activating a workflow in n8n actually do?
Workflow activation switches a workflow from manual test mode into production mode, letting schedule, webhook, and app-event triggers fire automatically on their own cadence. Manual-trigger workflows can't be activated because they have no autonomous trigger. The Starter plan caps active workflows at five simultaneously; Pro plans raise that limit to 15 or higher depending on tier.
### How does n8n count executions against a monthly plan limit?
n8n bills one execution per complete workflow run, regardless of how many nodes or steps the workflow contains. A 100-node automation costs the same single execution as a 2-node one. The Starter plan includes 2,500 executions per month; the entry-level Pro plan provides 10,000, and larger Pro tiers go up to 50,000.
### What does the workspace time zone setting in n8n control?
The workspace time zone in Admin > Workspace Settings determines when schedule triggers and time-sensitive nodes fire across all workflows in the instance. Every workflow inherits this setting by default. If one workflow needs to run on a different regional schedule, you override the time zone inside that specific workflow's Settings panel without touching the workspace-wide default.
### How do you import a workflow template or JSON file into n8n?
The Templates library in the sidebar lists 1,588+ pre-built workflows; clicking "Use for free" imports one directly to a cloud workspace or copies it as JSON for a local instance. From any open workflow's three-dot menu, "Import from file" loads a local JSON file and "Import from URL" fetches a workflow from a public URL, letting you pull in nodes from external repositories.
---
# n8n API Calling, Collaboration, Workflow Sharing & Credential Management
URL: https://www.genaiunplugged.com/courses/n8n/lessons/n8n-api-calling-collaboration-workflow-sharing-credential-management/
> Call the n8n API, share workflows with your team, and manage credentials so collaborators build without exposing secrets.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 8. Enterprise Features & Conclusion.
Watch the video above for the full tutorial, or read the written guide below.
## What is n8n's role-based access and workflow sharing system?
n8n's role-based access system assigns three roles to control who can do what in a shared workspace. The owner holds full access and is limited to one per instance. Admins can manage users, workflows, and credentials but cannot modify the owner role. Members manage only their own workflows. Workflows are private by default and must be explicitly shared, granting collaborators an editor role on that specific workflow.
## How to share workflows, credentials, and control n8n via API
**Adding users and sharing workflows**
User management lives under Settings > Users. Click Invite, enter the recipient's email address, and they receive an invitation link. Once they accept, their account appears in the Users panel. To share a workflow, open it and click the Share button at the top of the canvas. Select users who have joined your instance, confirm they appear with an editor role, and click Save. To remove access, return to Share, click the delete icon next to the user, and save again. Admin roles require the Pro plan; on the Starter plan, additional invited users default to the member role.
**Sharing credentials without exposing secrets**
Credential sharing lets team members use API keys and OAuth tokens in workflows without ever seeing the underlying values. Navigate to your personal space, click the Credentials tab, open a credential such as an ElevenLabs API key, and click Sharing. Select a project to grant everyone in that project access, or pick individual users, then click Save. To revoke access, click the delete icon next to the user and save. Only the owner and admins can revoke credential access from other users.
**Controlling n8n programmatically via the API**
The n8n API is accessible under Settings > n8n API. Click Create an API key, provide a name, and set an expiration (7, 30, 60, or 90 days; no expiration is not recommended). Review the available scopes: users, workflows (create, read, update, delete, activate, deactivate), executions, credentials, tags, and variables. To call the API from an HTTP Request node, set the method to GET and form the URL as `/api/v1/users`. Add a Header Auth credential named `x-n8n-api-key` with the API key as its value, plus an Accept: application/json header. For in-workflow control, use the dedicated n8n node under the same credential; it wraps the same endpoints in a UI-driven interface and eliminates manual URL construction.
## Key Takeaways
- The owner role is capped at one per instance with full access. Admins can manage users, workflows, and credentials but cannot modify the owner. Members control only their own workflows with no global instance access.
- Workflows are private by default. Sharing requires opening the workflow, clicking Share, selecting invited users who receive an editor role, and clicking Save. Access is revoked the same way using the delete icon.
- Credential sharing lets collaborators use API keys such as ElevenLabs or Google Sheets tokens inside workflows without being able to view or extract the actual key values. Only the owner and admin accounts can revoke this access.
- The n8n API enables programmatic workflow activation and deactivation, making it practical to build a meta-workflow that turns other workflows on at 8 a.m. and off at 6 p.m., preventing wasted execution credits outside business hours.
- The `x-n8n-api-key` header authenticates external code calling the n8n REST API. For in-workflow orchestration, the dedicated n8n node exposes the same actions without requiring manual URL construction.
## Related Lessons
- [Lesson 42: How to Scale n8n Workflows with Enterprise Security & Version Control | Course Conclusion](/courses/n8n/lessons/how-to-scale-n8n-workflows-with-enterprise-security-version-control/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Does sharing a workflow in n8n automatically share its credentials?
Workflow sharing and credential sharing in n8n are completely separate actions. Sharing a workflow grants collaborators an editor role on that workflow but gives them no access to the credentials it uses. To let them execute the workflow successfully, you must also open each credential under Settings > Credentials, click Sharing, select the user, and save. Without this step, the workflow will fail for anyone who tries to run it.
### How does the n8n API key scope system control permissions?
The n8n API key scope system restricts which actions a generated key is permitted to perform. Available scopes cover user management, workflow operations (create, read, update, delete, activate, deactivate), execution log retrieval, credential management, tags, variables, and source control. On the Starter plan, scope selection is disabled and the key receives full access by default. The Pro plan and above let you restrict a key to specific scopes before saving it.
### What is the difference between the HTTP Request node and the n8n node for controlling an n8n instance?
The HTTP Request node makes raw REST calls to the n8n instance URL formatted as `/api/v1/`, authenticated via an `x-n8n-api-key` header. This approach works identically to any external application or programming language targeting the same API. The dedicated n8n node wraps those same endpoints in a UI-driven interface with a credential selector, making it faster to configure from inside a workflow. Use HTTP Request for external integrations; use the n8n node for in-workflow orchestration.
### Why should n8n API keys always have an expiration date?
n8n API keys with no expiration remain valid indefinitely, which widens the damage window if a key is ever leaked or compromised. The API key creation screen under Settings > n8n API offers 7, 30, 60, and 90-day presets plus a custom option. The instructor explicitly flags no-expiration keys as not recommended and advises rotating credentials regularly as a standard security practice to limit the period any single key stays valid.
---
# Master Conditional Logic in n8n - If-Else Node, Execution Order & Branching
URL: https://www.genaiunplugged.com/courses/n8n/lessons/master-conditional-logic-in-n8n-if-else-node-execution-order-branching/
> Learn how the n8n IF node evaluates conditions, controls execution order, and branches your workflow into different paths.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is conditional logic in n8n, and when do you use the IF node versus the Filter node?
The IF node routes every incoming item into one of two branches, a true path or a false path, based on one or more conditions you define. The Filter node evaluates the same kind of conditions but silently discards items that fail and outputs only one branch. Use the IF node when you need to act on both outcomes. Use the Filter node when the false case requires no action and you want a cleaner canvas.
## How to build branching workflows, control execution order, and merge results in n8n
n8n supports three branching types. Conditional branching uses the IF node to split a workflow into a true path and a false path, for example flagging a qualified lead versus an unqualified one. Multipath branching uses the Switch node to create any number of output branches, one per matching condition, such as routing orders by status into pending, processing, cancelled, and refunded paths. Parallel branching fires multiple downstream nodes from a single source node at the same time, like sending both an email and a Slack message for every cancelled order from the same branch output.
Execution order in n8n follows two deterministic rules: top-to-bottom first, then left-to-right when nodes sit at the same height on the canvas. One branch runs to completion before the next starts. This sequence matters because if a node in Branch C depends on data produced by Branch A, but Branch C sits higher or further left, n8n executes it first and the workflow breaks or returns empty results. Arranging branches deliberately on the canvas to match the dependency order you need is not optional; it is structural correctness.
The Merge node resolves multi-branch workflows by waiting for all connected branches to finish, then combining their outputs into a single dataset. In the lesson demo, two parallel Google Sheets queries fetch order headers (104 rows) and order details separately. The Merge node joins them on the shared Order ID field and produces 291 unified rows. Every downstream node from that point works on one clean dataset instead of two disconnected streams.
## Key Takeaways
- The IF node creates two executable branches (true and false); the Filter node outputs only matched items with no false branch, making it the right choice when failed conditions need no handling.
- n8n's three branching types are conditional (IF node, 2 paths), multipath (Switch node, n paths matched by field value), and parallel (multiple nodes connected to one output firing at the same time).
- Execution order is top-to-bottom then left-to-right, and each branch completes fully before the next starts, so placing a dependent node in the wrong position breaks data availability for that node.
- The Merge node waits for all incoming branches, combines results on a matching field such as Order ID, and returns one unified dataset so downstream processing stays coherent.
- Optimizing a multi-branch workflow sometimes means merging branches before a shared action rather than duplicating that action per branch, as shown when cancelled and refunded orders both feed one Merge node before a shared email and Slack step.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What conditions does the IF node support in n8n, and how are multiple conditions combined?
The IF node supports AND and OR logic across multiple conditions. In the lesson demo, three AND conditions run together: company name is not empty, email does not end with gmail.com, and email does not end with hotmail.com. All three must be true for an item to reach the true branch. If any one fails, the item routes to the false branch instead.
### How does the Switch node differ from the IF node when building multipath branches in n8n?
The Switch node matches an incoming field value against multiple conditions and creates one output branch per match, supporting any number of paths. In the lesson demo it matches order_status against four values and produces four separate branches. The IF node always creates exactly two branches, true and false, regardless of how many conditions you configure inside it.
### Why does execution order matter in a multi-branch n8n workflow, and what breaks if it's wrong?
n8n runs one branch at a time, finishing it completely before starting the next, following a top-to-bottom then left-to-right sequence on the canvas. If a node relies on data from a branch that runs later in that sequence, n8n executes that node before its source data exists, producing empty or incorrect output. Correct branch placement on the canvas is what enforces the right dependency order.
### When should you use the Merge node in n8n instead of keeping branches separate?
Use the Merge node when two or more branches produce data that must be combined before any further step can work correctly. In the lesson demo, order headers and order details are fetched in parallel and are useless apart because neither contains the full picture. The Merge node joins them on Order ID and produces 291 unified rows, letting the rest of the workflow operate on one complete dataset.
---
# How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-set-node-in-n8n/
> See why n8n renamed the Set node to Edit Fields, then add, edit, and clean data plus manage keep-only-set and include-other-fields options.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What Is the Set Node (Edit Fields) in n8n?
The Set node, renamed Edit Fields in newer n8n versions, creates, edits, renames, or removes fields on the data items flowing through your workflow. It is how you shape, clean, and standardize data between two nodes without writing code, using either a visual field mapper or raw JSON. Think of it as the node that decides exactly what data moves forward.
## How to Use the Set Node in n8n
Add an Edit Fields (Set) node, then pick a mode. Manual Mapping lets you add each field name and value, dragging in values from earlier nodes as expressions. JSON mode lets you define the whole output object at once. Turn on "Keep Only Set" to drop every other field and pass a clean payload to the next node or API.
Common uses: rename keys to match an API, set default values, type-cast strings to numbers, or trim a large object down to only the fields the next step needs.
## Key Takeaways
- Understanding the core concepts covered in this lesson
- Practical, hands-on experience you can apply immediately
- Tips from real-world n8n workflow implementations
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
- [Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration](/courses/n8n/lessons/how-to-connect-google-forms-webhook-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What will I learn in this lesson?
The Set node, now called Edit Fields, lets you add, edit, rename, or remove fields on items moving through an n8n workflow. You will learn both Manual Mapping and JSON modes, and how 'Keep Only Set' produces a clean payload for the next node.
### Do I need to watch the previous lessons first?
This lesson builds on earlier concepts. If you are new to n8n, start with Lesson 1 for the best learning experience.
### Can I get help if I get stuck?
Join the GenAI Unplugged community on Substack where Dheeraj answers questions and shares additional tips.
---
# Master AI Automation Workflows Debugging & Error Handling with Execution Logs
URL: https://www.genaiunplugged.com/courses/n8n/lessons/master-ai-automation-workflows-debugging-error-handling-with-execution-logs/
> Read n8n execution logs to trace failures, add error handling, and debug AI automation workflows step by step in this video tutorial.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 4. Error Handling & Debugging.
Watch the video above for the full tutorial, or read the written guide below.
## What is the n8n Execution Log and how does it track workflow failures?
The n8n execution log records every workflow run in your project, both manual test executions and live production executions triggered automatically. Each entry captures the execution status (success, error, cancelled, running), the trigger type, start time, runtime duration, and execution ID. Clicking into any entry reveals the full input and output data at every node that ran, and double-clicking a failed node surfaces the exact error message and failure reason.
## How to read n8n execution logs and fix failed workflow nodes
The execution log lives in the **Executions** tab of your n8n project. Two icons distinguish run types: a test icon marks manual executions where you clicked "Execute workflow" in the editor, and a live icon marks production executions fired automatically by an active trigger. You can filter by workflow name, status (error, success, cancelled, running, waiting), and date range. Searching by a specific data value inside execution records requires an n8n Pro plan and is not available on the Basic plan.
Each failed execution highlights the exact node where the error occurred. Clicking the errored node shows its input and output data; double-clicking opens the full error detail. Two concrete examples from the lesson: a Gmail node returned "sender invalid parameter value" because a webhook form submitted a malformed address (just `@genaiunplugged` with no domain), and a Notion node returned "bad request" because a PDF URL was passed to a field expecting an image URL. All upstream node outputs remain intact in the log, so you never need to re-run the workflow to reproduce the data context.
Per-workflow execution storage settings let you control what gets logged. Inside any workflow, open the three-dot menu and go to **Settings** to configure "Save failed production executions," "Save successful production executions," and "Save manual executions" individually, each switchable between Save and Do not save. On an errored node, two settings under **Settings > On error** change how failures propagate: "Continue past error on item in regular output" lets remaining items process but marks the overall execution as successful, silently hiding failures. "Continue using error output" routes failed items into a dedicated error branch with the error message appended, keeping failures visible for downstream handling such as triggering a separate error workflow.
## Key Takeaways
- The n8n execution log distinguishes manual runs (test icon) from production runs (live icon), so you always know whether a failure occurred during development or in live automation.
- Each execution entry preserves the input and output data at every node that ran, letting you identify corrupt, missing, or misformatted data without recreating the execution from scratch.
- The five most common n8n workflow failure causes are: misconfigured node settings, external service downtime (signaled by 4xx or 5xx HTTP errors), missing or incorrectly formatted data, expired credentials or API keys, and conditional logic that misses edge cases such as negative numbers or a boundary requiring "greater than or equal to" instead of "greater than."
- The **Retry on fail** node setting retries a node up to three times with a configurable wait (default 1,000ms), which recovers from temporary service glitches but cannot fix permanent errors like an invalid email address.
- The **Continue using error output** setting creates a success branch and an error branch on the node canvas, preventing silent suppression of failures and enabling handoff to a dedicated error workflow.
## Related Lessons
- [Lesson 21: Master Error Handling in n8n | Build Reliable n8n Workflows That Don't Break](/courses/n8n/lessons/master-error-handling-in-n8n/)
- [Lesson 33: How to fix AI Automation Workflows Fast in n8n | Error Handling & Debugging](/courses/n8n/lessons/how-to-fix-ai-automation-workflows-fast-in-n8n/)
- [Lesson 34: Error Workflows in n8n AI Automation | Stop & Error Node | Error Trigger Node](/courses/n8n/lessons/error-workflows-in-n8n-ai-automation/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the difference between a manual execution and a production execution in n8n?
Manual executions in n8n run when you click the "Execute workflow" button in the editor and appear in the log with a test icon. Production executions fire automatically from an active trigger node, such as a schedule or webhook, and appear with a live icon. A workflow must contain an automatic trigger node before the active/inactive toggle is enabled and production executions can occur.
### How does 'Continue using error output' differ from 'Continue past error on item in regular output' in n8n?
The 'Continue past error on item in regular output' setting passes failed items silently through the success path, so the execution log marks the entire run as successful even when individual records errored. 'Continue using error output' splits the node into two explicit branches on the canvas: a success branch for processed items and an error branch carrying the failed items with error messages appended, so failures remain visible and actionable.
### How can you prevent one bad record from stopping an entire n8n workflow that processes multiple items?
The 'On error' option inside each node's Settings panel controls this behavior. By default it is set to 'Stop workflow,' which halts the entire execution on the first failure. Switching it to 'Continue using error output' lets the workflow process all remaining items, routes the failures, such as records with invalid or empty email addresses, into a dedicated error branch, and allows successful items to continue to the next node.
### What are the most common causes of failed executions in n8n automation workflows?
Workflow failures in n8n fall into five common categories: misconfigured node settings that do not handle unexpected inputs, external service downtime returning temporary or permanent HTTP 4xx or 5xx errors, missing or incorrectly formatted data such as empty or malformed email addresses, expired credentials or API keys causing authentication failures, and conditional logic that fails to account for edge cases like negative numbers or an off-by-one boundary condition.
---
# Lead Enrichment Capstone
URL: https://www.genaiunplugged.com/courses/n8n/lessons/lead-enrichment-capstone/
> Build a complete n8n lead enrichment workflow from scratch, combining everything from the course into one working capstone automation project.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 5. Hands-On Projects.
Watch the video above for the full tutorial, or read the written guide below.
## What is the n8n Lead Enrichment Capstone and what does it automate?
The Lead Enrichment Capstone is a three-part n8n workflow that automates the entire inbound lead lifecycle: form capture, dual-stage email validation, company enrichment, lead scoring, CRM deduplication, team routing, PDF summary generation, and follow-up scheduling. It replaces a multi-person manual process involving interns, business analysts, sales teams, and managers with a single n8n workflow that processes each lead without human intervention at every routine step.
## How to set up the n8n Form Trigger and two-stage email validation pipeline
The n8n Form Trigger node generates a hosted web form inside your n8n workspace, producing a test URL for development and a production URL that activates only after the workflow is set to active. Configure the form with six fields: name (text, required), email (required), company name (required), website (optional), job title (optional), and interest area (dropdown with multi-select, required). Pin the test submission data immediately after the first successful submit so you avoid re-filling the form on every subsequent build step.
The IF node named "basic email validation" runs two n8n built-in functions as AND-joined conditions: `.isEmail()` confirms the field contains a structurally valid email format, and `.extractDomain()` extracts the domain so it can be checked against an array of blacklisted disposable-email services such as fake-mail and temp-mail. Any lead failing this gate is logged to a Google Sheets node configured to append a row to the "All Leads Log" sheet with the timestamp (using the `now` expression), full name, email, company name, status set to "discarded," and reason set to "basic email validation failed."
The Hunter.io node, available natively in n8n, runs the "email verifier" operation against the lead's email address and returns a `status` field and a numeric confidence `score`. A second IF node named "third party email validation" then checks that `status` equals "valid" (with case-insensitive comparison and type conversion enabled) AND that `score` is greater than 20. Leads failing either condition are appended to the same "All Leads Log" sheet with reason "third party email validation failed, invalid status of the email and/or low email deliverability score," keeping a complete audit trail before the workflow continues to company enrichment in parts two and three.
## Key Takeaways
- The n8n Form Trigger node replaces a Google Forms plus webhook setup during development; switch to the production URL and activate the workflow when connecting to a live website form.
- The IF node's built-in `.isEmail()` and `.extractDomain()` functions perform format checking and domain blacklisting without any custom code or external HTTP calls.
- Hunter.io's native n8n node returns both a `status` field (the primary signal, replacing the deprecated `result` field) and a numeric `score`; the capstone uses `status = "valid"` AND `score > 20` as the minimum combined threshold.
- Every discarded lead at any validation stage gets appended to the Google Sheets "All Leads Log" with a timestamped reason string, creating a durable rejection record that prevents the same bad lead from consuming pipeline resources again.
- Part one of the capstone completes automation of steps one and two from the original manual process (form intake and email validation), eliminating the intern and sales-ops roles responsible for those tasks.
## Related Lessons
- [Lesson 27: How to Auto-Save Gmail Attachments to Google Drive | n8n AI Automation Tutorial](/courses/n8n/lessons/how-to-auto-save-gmail-attachments-to-google-drive/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does the n8n Form Trigger node produce and when should you switch to its production URL?
The n8n Form Trigger node generates a hosted web form with two URLs: a test URL usable immediately in development mode and a production URL that only becomes active after the workflow is switched to active. Use the test URL while building and validating each downstream node. Switch to the production URL when wiring the form into a live website, replacing tools like Google Forms connected via webhook.
### How does the IF node perform basic email validation without calling an external API?
The IF node uses two n8n built-in expression functions joined with AND logic. The `.isEmail()` function returns a boolean confirming the field holds a structurally valid email address. The `.extractDomain()` function pulls the domain portion of the email so it can be compared against an array of known disposable-email domains such as fake-mail and temp-mail. Every condition must return true before the lead proceeds to Hunter.io verification.
### Which Hunter.io response fields does the third-party email validation IF node evaluate?
The third-party email validation IF node checks two fields from the Hunter.io verifier response: `status`, which must equal "valid" (compared case-insensitively with type conversion enabled), and `score`, a numeric confidence value that must be greater than 20. Hunter.io has deprecated the `result` field in favor of `status`, so `status` serves as the primary pass/fail signal and `score` acts as a secondary quality threshold.
### Why does the workflow log discarded leads to Google Sheets instead of simply stopping the execution?
The Google Sheets logging step mirrors the manual business process requirement: the intern or assistant was expected to record every rejected lead with a reason so the sales team would never waste time re-processing the same bad contact. The Google Sheets node appends a row to the "All Leads Log" sheet with a timestamp, lead details, status "discarded," and a specific reason string identifying which validation stage failed, giving sales ops a searchable rejection history.
---
# How to Use Remove Duplicates Node in n8n | Clean Your Data Fast
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/
> See how the n8n Remove Duplicates node works, with docs on setup and examples for deduplicating data fast in your workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What does the Remove Duplicates node do in n8n?
The Remove Duplicates node filters out repeated items in your workflow data, offering three operations: remove items repeated within the current input, remove items processed in a previous execution, or clear the duplication history entirely. Without it, downstream nodes receive repeated records, which can trigger multiple emails to the same customer, duplicate orders in your database, or skewed dashboard reports. It is a core data-integrity node in any business automation pipeline.
## How to configure the Remove Duplicates node to deduplicate by a specific field
The Remove Duplicates node's most critical setting is the **Comparison** field, which controls what counts as a duplicate. Three options are available: **All Fields** (every field must match for a row to be flagged), **All Fields Except** (useful when you want to exclude one field and compare everything else), and **Selected Fields** (compare only the fields you explicitly choose). In the lesson workflow, 41 order records contained repeated order IDs across three entries for the same order. Selecting **Selected Fields** and dragging in the `order_id` field reduced the 41 records to 13 unique orders.
Once deduplication is set, open the **Options** panel, click **Add Field**, and enable **Remove Other Fields**. This strips every field except the ones used in comparison, so only the 13 unique order IDs pass forward. That keeps the payload lean before it hits the Aggregate node, which then bundles all IDs into one item for a single email or Slack message.
The correct workflow architecture is one Remove Duplicates node per branch, not a shared node after merging branches. In the lesson, merging all four switch branches (pending, processing, cancelled, refunded) into one Remove Duplicates node caused the downstream Aggregate and email nodes to execute four times, sending four separate messages. The fix was to place individual Remove Duplicates nodes on the pending and processing branches, and to use a Merge node before a single Remove Duplicates node on the combined cancelled-and-refunded branch, since both shared the same final actions.
## Key Takeaways
- The Remove Duplicates node offers three operations: deduplicate within the current input, deduplicate against previous executions, or clear duplication history.
- The **Comparison** setting determines what a duplicate is. **Selected Fields** is the right choice when you only need to compare one or two fields (such as `order_id`) rather than entire rows.
- Enabling **Remove Other Fields** in Options discards non-compared fields immediately, keeping the data payload minimal before it reaches downstream nodes.
- Each branch in a Switch node should have its own Remove Duplicates node. Merging branches before deduplication causes every downstream node to execute once per branch, generating multiple emails or messages.
- Skipping deduplication in a real workflow produces visible business errors: the lesson email showed the same order IDs repeated multiple times before the node was added, then collapsed to 13 unique IDs after.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration](/courses/n8n/lessons/how-to-connect-google-forms-webhook-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the Remove Duplicates node in n8n used for?
The Remove Duplicates node removes repeated records from your workflow data to maintain data integrity. It prevents business errors such as sending multiple emails to the same customer, writing duplicate orders to a database, or skewing report numbers. It operates on either the current input batch or across previous workflow executions.
### What is the difference between the 'All Fields', 'All Fields Except', and 'Selected Fields' comparison options in the Remove Duplicates node?
The Remove Duplicates node compares records using one of three modes. 'All Fields' flags a record as duplicate only if every field matches another row, so records that differ on any field pass through. 'All Fields Except' lets you exclude one field and compare everything else, which is useful when one column like a timestamp is always unique. 'Selected Fields' compares only the fields you explicitly choose, such as order_id, and is the right pick when you want to deduplicate on a single identifier regardless of what other fields contain.
### Why did the lesson workflow send four Slack messages instead of one after adding the Remove Duplicates node?
The Remove Duplicates node was placed after a point where all four Switch branches (pending, processing, cancelled, refunded) were merged into one path. Because n8n executes top to bottom and each branch fed the shared node separately, every downstream node ran four times, producing four messages. The fix was to give each branch its own Remove Duplicates node so each branch stays isolated all the way to its final action.
### What does the 'Remove Other Fields' option do in the Remove Duplicates node?
The 'Remove Other Fields' option, found under the node's Options panel, strips every field from each item except the ones selected for comparison. In the lesson, enabling it after selecting 'order_id' meant only the 13 unique order IDs passed to the Aggregate node, removing all other columns from the payload and keeping the downstream data lean.
---
# How to Use HTTP Node in n8n | Connect Any API or Service in n8n
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-http-node-in-n8n/
> Use the HTTP node in n8n to call any API or service, pass headers and parameters, and pull external data straight into your workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is the HTTP Request node in n8n?
The HTTP Request node is n8n's built-in API client, comparable to Postman, that lets you make GET, POST, PUT, and DELETE requests to any external service with a REST API. It's the correct tool when no dedicated n8n integration exists for the app you want to connect. You configure a method, URL, authentication, query parameters, headers, and an optional request body, then the node returns the response data for downstream use in your workflow.
## How do you configure the HTTP Request node in n8n?
The HTTP Request node offers two configuration paths. The first is parameter-by-parameter: set the **Method** (GET to fetch data, POST to create, PUT to update, DELETE to remove), paste the API's endpoint URL, choose an authentication type, and add any query parameters or headers the API requires. For the AccuWeather one-day forecast API, that means selecting GET, pasting the location-specific endpoint URL, leaving authentication as None, turning on query parameters, and adding the `apikey` field with your key. The node executes and returns the forecast response (minimum and maximum temperature, conditions) for the requested location.
Authentication splits into two buckets. **Predefined credential types** cover popular services n8n already supports, including Airtable and Slack, so you pick the service name and supply your credentials. **Generic credential types** handle everything else: Basic (username and password), Bearer Token, and OAuth2. When an API authenticates via an API key sent as a query parameter, like AccuWeather, you select None in the authentication field and pass the key in the query parameters section instead, bypassing the credential system entirely.
The second path is **Import cURL**. Most API documentation pages include a sample cURL command you can copy directly. Paste it into the Import cURL dialog and the node auto-fills the method, URL, query parameters, and headers in one step. The AccuWeather cURL sample produces the same New York forecast result as the manual setup, confirming both paths are equivalent. For complex requests with many parameters or headers, cURL import eliminates the bulk of manual entry. Query parameters and URL segments can also be set dynamically using n8n expressions, letting earlier nodes in your workflow drive the API call.
## Key Takeaways
- The HTTP Request node acts as a Postman-style REST API client inside n8n, covering any service that lacks a dedicated built-in node.
- GET fetches data, POST sends new data, PUT updates a record, and DELETE removes one. For soft deletes (flagging a record rather than permanently removing it), PUT is the correct method because you're updating, not deleting.
- Predefined credential types handle popular services n8n already knows (Airtable, Slack, and others). Generic types cover Basic, Bearer Token, and OAuth2 for everything else. API-key-in-query-parameter services like AccuWeather need no credential record at all.
- The cURL Import option auto-configures the node from a copied cURL command, saving significant setup time for requests with many headers and parameters.
- Query parameters can be set dynamically with n8n expressions, so values from earlier nodes can populate API call fields at runtime.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What HTTP methods does the HTTP Request node support, and when should I use each one?
The HTTP Request node supports GET, POST, PUT, and DELETE. GET fetches data from an external service, POST sends new data to it, PUT updates an existing record, and DELETE removes one. GET and POST are the most common. For soft deletes, where you flag a record as deleted rather than permanently removing it, PUT is the right choice because you're updating a field, not destroying the record.
### How do I handle authentication in the HTTP Request node?
The HTTP Request node provides two authentication buckets. Predefined credential types cover popular services n8n has already integrated, such as Airtable and Slack, so you select the service and enter your credentials. Generic credential types cover everything else: Basic (username and password), Bearer Token, and OAuth2. If an API uses an API key passed as a query parameter, like AccuWeather, select None for authentication and add the key in the query parameters section.
### What is the difference between query parameters and a request body in the HTTP Request node?
Query parameters in the HTTP Request node are name/value pairs appended to the request URL, such as the `apikey` field the AccuWeather forecast API requires. A request body carries data inside the HTTP request itself and is used when the external service requires a structured payload or doesn't support query parameters. The node supports JSON, form URL encoded, form data, and n8n binary file as body content types, with JSON being the most common for REST APIs.
### How does the cURL Import option work in the HTTP Request node?
The cURL Import option in the HTTP Request node accepts a cURL command copied from an API documentation page and automatically fills in the method, URL, query parameters, and headers. Pasting the AccuWeather sample cURL command configures the node identically to a manual parameter-by-parameter setup and returns the same forecast response. This is especially useful for complex requests that carry many headers or query parameters, where manual entry is error-prone.
---
# How to Use Merge Node in n8n | Combine Data Like a Pro
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-merge-node-in-n8n/
> Learn n8n's Merge node modes, combine by position and append, to join multiple data streams into one clean output for your workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What Is the Merge Node in n8n?
The Merge node combines data from two or more separate branches of a workflow into one stream. It is how you bring back together results that were split earlier or fetched in parallel, so a single later node can work on the combined data.
## How to Use the Merge Node in n8n
Connect two branches into the Merge node, then choose a mode. Append stacks all items from both inputs one after another. Combine joins them by matching field, by position, or by all possible combinations, which works like a SQL join on a shared key. Choose Branch passes through just one input. Use Combine "by matching fields" when you need to enrich one dataset with values from another using a common ID.
## Key Takeaways
- Understanding the core concepts covered in this lesson
- Practical, hands-on experience you can apply immediately
- Tips from real-world n8n workflow implementations
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
- [Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration](/courses/n8n/lessons/how-to-connect-google-forms-webhook-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What will I learn in this lesson?
The Merge node combines data from two or more workflow branches into one stream. You will learn its Append, Combine, and Choose Branch modes, including how to join two datasets on a matching field like a SQL join.
### Do I need to watch the previous lessons first?
This lesson builds on earlier concepts. If you are new to n8n, start with Lesson 1 for the best learning experience.
### Can I get help if I get stuck?
Join the GenAI Unplugged community on Substack where Dheeraj answers questions and shares additional tips.
---
# How to Use Loop Over Items Node in n8n | Batching, Conditional Logic
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-loop-over-items-node-in-n8n/
> Use n8n's Loop Over Items node to split large datasets into manageable batches and apply conditional logic inside each loop iteration.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is the Loop Over Items node in n8n, and when do you need it?
The Loop Over Items node splits a dataset into batches and iterates over each batch, repeating a sequence of steps until all items are processed. Use it when you need controlled batch processing of large datasets, when an API enforces rate limits (such as 100 emails per second), or when a step-by-step process requires a Wait node between iterations. Without it, n8n fires every request simultaneously and gives you no throttle control.
## How to use the Loop Over Items node in a real workflow
The Loop Over Items node exposes two output branches: a loop branch and a done branch. Every node you want to repeat connects into the loop branch, starting with a placeholder called Replace Me. After the last step in the loop, you wire that node's output back into the Loop Over Items node itself, closing the cycle. When all items are exhausted, execution exits through the done branch, where you can trigger downstream steps or attach a Do Nothing node to signal a clean end.
In the transcript workflow, a Gmail Trigger downloads email attachments with the Download Attachments option enabled and Simplify turned off. A Filter node checks that `$json.binary` exists, dropping emails with no attachments. A Split Out node on `$binary` then explodes the single email item into five separate binary items, one per attachment. These five items feed into Loop Over Items, which processes them one at a time.
Inside the loop branch, an HTTP node posts each binary file to a temporary hosting service (tempfiles.org) and returns a public URL. A Notion node then creates a database page in the sales task board, setting the email subject as the page title, a status property of To Do, and an image block populated with that temporary URL. A Wait node set to two seconds follows, preventing rate-limit errors on the Notion API before the output loops back into Loop Over Items. A critical fix covered in the transcript: instead of hardcoding the binary field name as `attachment_0` (which breaks on iteration two), use the expression `Object.keys($binary).first()` to dynamically resolve whichever key is present on each iteration.
## Key Takeaways
- The Loop Over Items node has two output branches: the loop branch (where repeated steps live) and the done branch (what runs after all items are processed).
- Even a batch size of 1 warrants Loop Over Items when you need a Wait node between requests; n8n's default per-item execution gives you no throttle control and will hit rate limits.
- The Split Out node on `$binary` is what converts a single multi-attachment email item into individual binary items that the loop can iterate over.
- Dynamic binary field names require the expression `Object.keys($binary).first()` rather than hardcoded keys like `attachment_0`, which break on the second iteration.
- Notion's API accepts images only by public URL, making a temporary upload step (via HTTP node to a hosting service) a required prerequisite before the Notion create-page call.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why use the Loop Over Items node when n8n already processes each item automatically?
The Loop Over Items node is needed whenever you want to insert a Wait node between individual item executions to respect API rate limits. n8n's default per-item execution fires all requests simultaneously with no delay, which breaks workflows that hit limits like 100 emails per second. Loop Over Items gives you explicit control over pacing, even when your batch size is 1.
### How does the done branch of the Loop Over Items node differ from the loop branch?
The loop branch contains every node you want to repeat for each batch. After the last loop-branch node, you wire its output back into Loop Over Items to continue iteration. The done branch only executes once, after all items are exhausted. You can attach downstream steps there or use a Do Nothing node to mark a clean workflow end.
### How do you fix the 'item has no binary attachment_0' error when looping over email attachments?
Hardcoding the field name as `attachment_0` fails on the second iteration because n8n names subsequent binary files `attachment_1`, `attachment_2`, and so on. Fix it by switching the input data field name to an expression and using `Object.keys($binary).first()`, which dynamically resolves the correct key name on every iteration regardless of its index.
### Why does the Gmail-to-Notion loop workflow upload attachments to a temporary URL first?
The Notion API's image block only accepts a publicly accessible URL, not a raw binary file. n8n does not expose a public URL for attachments it downloads locally. The workflow solves this by posting each binary file to tempfiles.org via an HTTP node first, receiving a public URL in the response, and then passing that URL to the Notion create-database-page call.
---
# How to use Expressions in n8n | Built-In Functions in n8n
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-expressions-in-n8n/
> Write n8n expressions with built-in functions to pull, transform, and reference data dynamically across nodes in any workflow.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What are Expressions in n8n, and when do you use them?
Expressions in n8n let you transform data inside any node field using single-line JavaScript, without building a separate code block. You activate them by switching a field from **Fixed** to **Expression** mode and wrapping your code in double curly braces `{{ }}`. Expressions support raw JavaScript, JMESPath for querying JSON, and the Luxon datetime library, plus n8n's own built-in data-transformation functions.
## How do you access and transform data with n8n Expressions?
The `$json` variable gives you access to the output of the immediately previous node. You can read any field with dot notation (`$json.customerName`) or bracket notation (`$json["email"]`). For nested objects and arrays, chain the path: `$json.order.products[0].name` drills into the first item of an array. Both approaches use JMESPath querying under the hood, so pick whichever style is more readable for a given situation. To pull data from a node that is not immediately previous, reference it by name using `$('Node Name')` and dot notation.
Built-in functions extend what raw JavaScript alone can do. Typing a dot after a string value surfaces methods like `.extractDomain()`, which pulls the domain from an email address without any manual split logic. The `$ifEmpty($json.email, 'Email not found')` function returns a fallback string when a field is blank, making data cleanup a one-liner. For dates, `$now` returns the current timestamp via the Luxon library, and chaining `.format('yyyy-MM-dd')` reformats it, while `.diff(DateTime.fromISO('2025-01-01'), 'days')` calculates elapsed days. n8n's documentation page for "Built-in functions and variables" lists all available methods by category: arrays, booleans, numbers, objects, and strings.
Expressions are single-line only. The transcript demonstrates this directly: pasting a multi-line JavaScript function inside `{{ }}` produces an invalid-syntax error, even when collapsed onto one line. Any logic requiring function definitions, loops, or multiple statements belongs in the Code node, covered in the next lesson.
## Key Takeaways
- **Expressions activate inside `{{ }}`** on any node field switched to Expression mode; everything inside runs as single-line JavaScript.
- **`$json` is the primary data accessor**: dot notation (`$json.email`) and bracket notation (`$json["email"]`) both work, and you can chain them to reach nested objects and array indexes.
- **Built-in functions** like `.extractDomain()`, `$ifEmpty()`, and Luxon date methods (`$now.format()`, `$now.diff()`) handle common transforms without custom code, and n8n's official docs list every available function by data type.
- **Expressions are single-line only.** Multi-line logic, function definitions, and loops require the Code node, which supports both JavaScript and Python.
- **Check built-in functions before writing custom code.** The n8n documentation flags whether each function is available in expressions, in the Code node, or in both, so you can pick the right tool before writing anything.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the difference between Expressions and the Code node in n8n?
Expressions run inside individual node fields and are limited to a single line of JavaScript wrapped in `{{ }}`. The Code node is a dedicated node that accepts multi-line JavaScript or Python, making it the right tool for function definitions, loops, or logic that cannot fit on one line. The transcript shows an expression returning an invalid-syntax error when multi-line code is pasted in, even when collapsed to a single line.
### How does `$json` work in n8n Expressions?
`$json` references the output of the immediately previous node. You access fields with dot notation (`$json.customerName`) or bracket notation (`$json["email"]`). For nested objects and arrays, chain the path: `$json.order.products[0].name` returns the name of the first product in the array. To access a node that is not immediately previous, n8n lets you reference it by name using `$('Node Name')` and dot notation.
### Which built-in functions does n8n provide for string and date transformation in Expressions?
n8n's built-in string functions include `.extractDomain()`, `.extractEmail()`, `.extractUrl()`, and `.hash()`. For dates, `$now` returns the current datetime via the Luxon library, and you chain `.format('yyyy-MM-dd')` to reformat it or `.diff(DateTime.fromISO('2025-01-01'), 'days')` to calculate elapsed days. The full list is in n8n's official documentation under "Built-in functions and variables", organized by data type.
### How do you handle a missing or empty field inside an n8n Expression?
`$ifEmpty()` handles blank fields inline. The syntax is `$ifEmpty($json.email, 'Email not found')`: if the email field is empty, the expression returns the fallback string instead of null. The transcript demonstrates this by clearing the email field entirely and confirming the node outputs 'Email not found' rather than an error or a null value downstream.
---
# How to use Code Node in n8n - Data Structure & Limitations | Python in n8n
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-code-node-in-n8n-data-structure-limitations/
> Learn n8n's Code node data structure, item limits, and Python syntax so you can write custom JavaScript or Python logic in your workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is the Code node in n8n and when do you need it?
The Code node lets you write multi-line JavaScript or Python directly inside an n8n workflow as a single pipeline step. Unlike expressions, which are limited to one line, the Code node handles complex data manipulation, filtering, and object creation. Use it when built-in nodes cannot express the logic you need, for example aggregating 291 merged order-detail rows into 100 unique order totals with a running sum.
## How to configure and use the Code node in n8n
The Code node exposes two parameters you must set before writing any logic. First, **Language**: JavaScript (stable) or Python (beta). In JavaScript, n8n built-in variables use a `$` prefix, for example `$input`, `$execution`, `$binary`. In Python the same variables use an underscore prefix instead, for example `_input`. Python support is in beta and carries known limitations.
Second, **Mode**: "Run once for all items" executes the code block one time and makes every incoming record available together via `$input.all()`. This is the right choice when you need cross-record logic, such as summing order totals across 291 rows. "Run once for each item" executes the code separately per record and exposes only the current item via `$input.item`, mirroring how other n8n nodes behave by default. Switching modes changes the access variable automatically in the editor stub.
Every Code node must return an array of objects where each item is wrapped under a `json` key: `[{ json: { field: value } }, ...]`. Even a single result must sit inside the outer array. Binary file outputs use a `binary` key with a mandatory `data` field plus recommended fields such as `mimeType`, `fileExtension`, and `fileName`. Breaking this structure causes the node to fail or report an error. In the worked example, the code built an `orderTotals` lookup dictionary by looping through `$input.all()`, reading `item.json.orderId` and `item.json.totalPrice`, then converted each key-value pair into `{ json: { orderId: id, orderTotal: Number(total).toFixed(2) } }` before returning the result array. The output count changed from 291 inputs to 100 unique-order outputs, which is valid as long as the array-of-json-objects structure is preserved.
The Code node carries two hard limitations. On cloud-hosted n8n, importing npm packages is blocked entirely. Self-hosted instances can use select built-in or whitelisted packages only. Regardless of hosting, the Code node cannot access the file system or make HTTP and API calls. Those tasks belong to dedicated nodes: the HTTP node for external requests and the Read File from Disk node for file access.
## Key Takeaways
- The Code node runs multi-line JavaScript or Python as a single n8n step, filling the gap where single-line expressions run out of capability.
- "Run once for all items" gives simultaneous access to every input record via `$input.all()`; "run once for each item" gives one record at a time via `$input.item`. Switching modes changes both the execution count and the access variable.
- JavaScript variables use the `$` prefix; equivalent Python variables use an underscore prefix. Python support is currently in beta with known gaps.
- Every Code node output must be an array of `{ json: { ... } }` objects. Returning a plain object, a raw value, or a non-array breaks the node. Output item count does not have to match input item count.
- The Code node cannot import arbitrary npm packages on cloud, access the file system, or make HTTP calls. Use the HTTP node and Read File from Disk node for those tasks.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What data structure must the Code node return in n8n?
The Code node requires an array of objects where each item is wrapped under a `json` key: `[{ json: { field: value } }, ...]`. Even a single output must sit inside the outer array. Binary file outputs add a `binary` key containing a mandatory `data` field plus optional fields like `mimeType`, `fileExtension`, and `fileName`. Returning any other structure, such as a plain object or a raw value, causes the node to fail with an error.
### What is the difference between 'Run once for all items' and 'Run once for each item' in the Code node?
"Run once for all items" executes the code block once and exposes every incoming record together via `$input.all()`, making it the right choice for aggregation and cross-record logic such as summing order totals. "Run once for each item" executes the code separately per record, exposing only the current item via `$input.item`, and mirrors the default behavior of other n8n nodes. Switching modes also changes the variable stub the editor pre-populates.
### Can the Code node in n8n import npm packages or call external APIs?
On cloud-hosted n8n, npm package imports are blocked entirely inside the Code node. Self-hosted instances can use select built-in or whitelisted packages only. The Code node also cannot make HTTP or API calls regardless of hosting model. Use the dedicated HTTP node for external API requests and the Read File from Disk node for file system access. Both nodes are covered in subsequent lessons of this course.
### Does Python work in the n8n Code node, and how does it differ from JavaScript?
Python is supported in the Code node but is currently in beta with known limitations. The primary syntax difference is that n8n built-in variables use an underscore prefix in Python, for example `_input.all()`, rather than the dollar-sign prefix used in JavaScript, for example `$input.all()`. Basic Python logic runs, but the beta status means some features may be incomplete or unavailable compared to the stable JavaScript mode.
---
# How to Use Aggregate Node in n8n | Combine & Summarize Data
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/
> Use the Aggregate node in n8n to combine multiple items into one, group fields, and summarize data across your entire workflow.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What does the Aggregate node do in n8n?
The Aggregate node collapses multiple input items into a single output item so downstream nodes receive one record instead of many. It offers two modes: aggregate individual fields (pulling specific values, like order IDs, into a list) or merge all item data into one combined item. A workflow processing 41 pending orders produces exactly one item from the Aggregate node rather than 41, cutting email and Slack notification floods to a single summary message.
## How to configure the Aggregate node to send one summary email instead of many
The Aggregate node inserts between your Switch node output and your action node. Disconnect the Send Email or Slack node from its current input, search the node palette for Aggregate, and drop it in the gap. In the node's configuration panel, choose Individual Fields mode, add the field you want to collect (for example, `order_id`), and rename the output field to something descriptive like `pending_order_ids`. Testing the step shows one output item containing a single list field holding all 41 order IDs, rather than 41 separate items.
In the downstream Send Email node, switch the body from a fixed value to an expression and drag the aggregated `pending_order_ids` field into the body. For the subject line, reference `$now` to append today's date automatically. Connect the Aggregate node's output to the email node and run the workflow: one email goes out listing every pending order ID, instead of 41 individual emails.
n8n's data model still wraps the Aggregate output in an outer list because every node receives a list of items. That outer list contains exactly one item, which itself holds the aggregated field as an inner list. This is expected behavior, not an error, and it is what prevents the downstream action node from iterating and firing once per original record.
## Key Takeaways
- The Aggregate node always outputs one item regardless of how many items entered it: 41 pending-order records collapse into a single item with one `pending_order_ids` list field.
- Individual Fields mode collects specific named field values across all input items into a list; the all-items mode collapses every field from every item into one combined record.
- Inserting the Aggregate node between a Switch branch and a Send Email or Slack node is the direct fix for notification overload: the action node fires once on one item instead of once per record.
- The aggregated list can still contain duplicate values (the transcript shows `OD00001` appearing multiple times), so the Remove Duplicates node is the recommended next step when unique values are required downstream.
- A practical homework extension: add a second Switch condition checking both `order_priority = high` and `order_status = pending or processing` so delivered, shipped, cancelled, and refunded orders never reach the operations-team notification branch.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
- [Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration](/courses/n8n/lessons/how-to-connect-google-forms-webhook-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the difference between the two modes in the n8n Aggregate node?
The Aggregate node's Individual Fields mode picks specific fields by name, such as order_id, and collects their values across all input items into one list. The all-items mode takes every field from every item and merges them into one combined record. Use Individual Fields when you only need selected values downstream, for example a list of pending order IDs to paste into a single customer-service email body.
### Why does the Aggregate node output still appear wrapped in a list in n8n?
The Aggregate node produces one item, but n8n requires every node's output to be a list of items. The outer array is always present; it simply contains exactly one item instead of many. That single item holds the aggregated field, for example pending_order_ids, which is itself an inner list of all the collected values from the original 41 records.
### How does the Aggregate node reduce Slack and email notification volume in a real workflow?
The Aggregate node sits between the Switch node output and the Send Email or Slack node. It collapses all matching records, such as 41 pending orders, into one item before the action node sees any data. The action node then executes exactly once, sending one message with every order ID in the body rather than triggering a separate send per record.
### What additional condition should be added to avoid notifying the operations team about delivered orders?
The Switch node branch that routes high-priority orders to the operations team currently checks only order_priority, not order_status. The instructor assigned adding a second condition so the branch fires only when order_priority equals high AND order_status is pending or processing. This prevents delivered, shipped, cancelled, and refunded orders from reaching the operations Slack notification even if they carry high priority.
---
# How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/
> Set up n8n Cloud step by step in 2025, from signup to first workflow, and see how it compares to self-hosting your own instance.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## What is n8n Cloud and how does it compare to self-hosting?
n8n Cloud is the managed, browser-based version of n8n that lets you register, log in, and start building automation workflows immediately, with no installation or server management required. The trade-off is a paid subscription after the 14-day free trial and reduced control over where your data and logic live. Self-hosting gives you full control and flexibility but requires managing your own infrastructure.
## How to register on n8n Cloud step by step
n8n Cloud registration takes just a few clicks starting at n8n.io. Click "Get started for free," fill in your name, a company email address, a password, and a unique account name. That account name becomes your permanent workspace URL, formatted as `.app.n8n.cloud`. No credit card is required to start the 14-day free trial.
After submitting the form, n8n runs a short onboarding survey covering team type, company size, coding experience, and how you heard about n8n. The following screen offers a team-invite step so collaborators can access the same workspace. You can skip this and add team members later from inside the workspace.
Once you complete onboarding, your n8n canvas opens immediately. The workspace URL you chose during registration appears at the top of the interface, confirming where your workflows are hosted. Clicking "Create workflow" opens a blank canvas where you can drag and drop nodes and start building right away, with no additional configuration needed.
## Key Takeaways
- n8n Cloud requires no installation: register at n8n.io, complete a short form, and your workspace is live within minutes under a custom `.app.n8n.cloud` URL.
- The 14-day free trial starts with no credit card required; paid plans become necessary once free-tier usage limits are exceeded.
- n8n Cloud's main drawbacks are subscription cost at higher usage levels and reduced control over where your data and logic reside.
- Self-hosting is the better fit for technical users who need full control over their infrastructure, data, and automation logic.
- After registration the canvas opens immediately, and the "Create workflow" button lets you drag and drop nodes without any additional setup.
## Related Lessons
- [Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js](/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/)
- [Lesson 6: How to Install n8n for free on local machine using Docker Desktop](/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/)
- [Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings](/courses/n8n/lessons/n8n-interface-walkthrough-2025/)
- [Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions](/courses/n8n/lessons/n8n-node-types-explained/)
- [Lesson 9: Build Your First n8n Workflow - Send Welcome Emails Automatically](/courses/n8n/lessons/build-your-first-n8n-workflow-send-welcome-emails-automatically/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Does n8n Cloud require a credit card to sign up?
n8n Cloud does not require a credit card at registration. The sign-up form collects only your name, a company email address, a password, and a unique account name. A full 14-day free trial starts immediately with no payment information needed.
### What format does an n8n Cloud workspace URL take?
The n8n Cloud workspace URL follows the pattern `.app.n8n.cloud`, where the account name is the unique identifier you choose during registration. This URL hosts your entire workspace and is displayed at the top of the n8n interface every time you log in.
### When should you self-host n8n instead of using n8n Cloud?
Self-hosting n8n makes sense when you need full control over your data and automation logic, have the technical skills to manage your own server, and want to avoid ongoing subscription costs. n8n Cloud suits beginners who want to start building immediately without any infrastructure setup or installation.
### Can you add team members to an n8n Cloud workspace after the initial setup?
n8n Cloud lets you invite team members at any point after registration. The onboarding flow presents a team-invite screen immediately after the survey, but you can skip it entirely and add collaborators later from within your workspace.
---
# How to Scale n8n Workflows with Enterprise Security & Version Control | Course Conclusion
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-scale-n8n-workflows-with-enterprise-security-version-control/
> See n8n's enterprise features: role-based security, version control, and the user-management CLI to scale workflows safely across teams.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 8. Enterprise Features & Conclusion.
Watch the video above for the full tutorial, or read the written guide below.
## What enterprise-grade features does n8n offer for security and workflow management?
The Execution Data node, Git-based version control, global variables, external secrets managers, and log streaming are n8n's five core enterprise features for scaling automation securely. Together they address the four challenges every medium-to-large deployment faces: filtering thousands of executions, preventing silent failures, protecting credentials, and keeping dev and production workflows in sync. Most features require a Pro or Enterprise plan.
## How do you configure n8n's enterprise security and version control features?
The Execution Data node saves custom key-value pairs directly into each execution log. You add the node to any workflow, define a key such as `trade_id` or `purchase_date`, map its value from your workflow data, then use the Executions tab filter to retrieve the exact run tied to a specific order or customer. Without it, you'd have to browse every execution log manually to find a failure. Filtering by custom saved data requires a Pro or Enterprise plan.
Git-based version control lives under Settings > Environment and connects your n8n instance to a Git repository so development and production workflows stay separate. When a dev workflow is ready, you push it to production. If something breaks, you roll back to a prior commit in seconds. Global variables, available on the Pro plan at $60 per month, store a value like `database_url` once and expose it across every workflow as `$vars.database_url`. Variables are immutable inside workflows: update the value in Settings > Variables and every referencing workflow picks up the change automatically, with no edits to individual nodes.
The External Secrets tab under Settings connects n8n to HashiCorp Vault, Azure Key Vault, or AWS Secrets Manager so API keys and credentials are retrieved dynamically at runtime and never appear in workflow exports or execution logs. Log Streaming, also in Settings, pushes execution events to a central monitoring system in real time so SRE and IT teams can trigger alerts without manually checking n8n's Executions tab. Both require an Enterprise plan. LDAP and SSO integration are available at the same tier for organizations that manage access centrally.
## Key Takeaways
- The Execution Data node saves searchable key-value pairs (trade IDs, order numbers, purchase dates) into execution logs; filtering those keys in the Executions tab requires a Pro or Enterprise plan.
- Git-based version control (Settings > Environment) keeps dev and production n8n instances separate and enables rollback to any prior workflow version; available on Enterprise plan only.
- Global variables (Pro plan, $60/month) store values such as `database_url` once and expose them as `$vars.variable_name` across all workflows; a single value change in Settings > Variables propagates everywhere instantly.
- External secrets managers (HashiCorp Vault, Azure Key Vault, AWS Secrets Manager) pull credentials dynamically at runtime so sensitive keys never appear in workflow definitions or logs; Enterprise plan required.
- Log Streaming exports execution events to a central monitoring dashboard in real time, removing the need for manual log reviews when workflows run thousands of daily executions.
## Related Lessons
- [Lesson 41: n8n API Calling, Collaboration, Workflow Sharing & Credential Management](/courses/n8n/lessons/n8n-api-calling-collaboration-workflow-sharing-credential-management/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does the Execution Data node do in n8n and when should I use it?
The Execution Data node saves custom key-value pairs, such as order IDs, customer numbers, or transaction dates, inside each execution log. Use it when your workflows run thousands of daily executions and you need to pinpoint the exact run tied to a specific business entity, for example when a customer reports a failed trade ID. Filtering by those saved keys in the Executions tab requires a Pro or Enterprise plan.
### How does n8n's Git-based version control separate dev and production environments?
n8n's Git-based version control, configured under Settings > Environment, connects your n8n instance to a Git repository so development, test, and production workflow instances stay separate. When a development workflow is ready, you promote it to production through the repo. If a change breaks production, you roll back to a previous commit in seconds. This feature is available on the Enterprise plan only.
### What is the difference between a local workflow variable and a global variable in n8n?
A local variable defined inside one workflow cannot be referenced by any other workflow, so teams end up duplicating the same database URL or endpoint string across 10 or 20 workflows. Global variables, available on the Pro plan, store a value once and make it accessible everywhere as `$vars.variable_name`. Changing that value in Settings > Variables propagates it to every workflow instantly, with no changes needed inside any individual workflow.
### How does n8n's External Secrets feature protect API keys and credentials?
The External Secrets tab under Settings connects n8n to services like HashiCorp Vault, Azure Key Vault, or AWS Secrets Manager. n8n retrieves credentials dynamically at runtime rather than storing them inside workflow definitions, so sensitive keys never appear in workflow exports or execution logs. This eliminates exposure risk during audits or when workflows are shared across teams. The feature requires an Enterprise plan.
---
# How to Install n8n for free on local machine using Docker Desktop
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/
> Install n8n for free on your local machine using Docker Desktop, then run through setup and launch your first working automation workflow.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## What is Docker-based n8n installation and why does it exist?
Docker-based n8n installation runs n8n inside an isolated container on your local machine, separating it from the host operating system to prevent compatibility conflicts. The Docker method gives you direct control over the database backend (SQLite by default, Postgres if you prefer), makes migrating to a new host straightforward, and produces a cleaner security boundary than a bare NPM install. It works on Mac and Windows via Docker Desktop; Linux users need Docker Engine and Docker Compose instead.
## How to install n8n on a local Mac or Windows machine using Docker Desktop
Docker Desktop is the required prerequisite. Download it from the official Docker documentation page, choosing the Apple Silicon or Intel build if you are on a Mac. Docker Desktop is free for personal use and for companies with fewer than 250 employees and less than $10 million USD in annual revenue; larger enterprises need a paid subscription. Drag the downloaded file into your Applications folder, open it, and click "Use recommended settings" to finish setup.
With Docker Desktop running, open a terminal and run the first command from the n8n Docker documentation to create a volume named `n8n_data`. You can confirm it exists by opening Docker Desktop and checking the Volumes section. Then paste the second command from the docs to pull the latest stable n8n image and start the container. n8n prints a URL, `localhost:5678`, when the container is ready.
Open `localhost:5678` in a browser. Even if you already installed n8n via NPM on the same machine, this container treats itself as a fresh installation because it is fully isolated. Fill in the owner account form, complete the onboarding survey, and optionally enter an email address to receive a free license key that unlocks workflow history, advanced debugging, execution search, and folder tagging. From Docker Desktop's Containers view you can monitor CPU and memory usage and stop or restart the container with one click at any time.
## Key Takeaways
- Docker Desktop n8n installation runs on Mac and Windows only; Linux requires Docker Engine plus Docker Compose and a separate docker-compose setup covered in a dedicated guide.
- The `n8n_data` volume created by the first terminal command persists your workflows and credentials outside the container, so your data survives restarts and updates.
- A Docker container is isolated from the host OS, so a Docker install and an NPM install can coexist on the same machine and each behaves as a completely independent instance.
- Docker gives you the option to run Postgres instead of the default SQLite database, a level of database control the standard NPM install does not offer.
- Self-hosting via Docker means you own security, scaling, and server configuration; the n8n cloud version handles all of that for you, making it the better choice if that responsibility feels too technical.
## Related Lessons
- [Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting](/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/)
- [Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js](/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/)
- [Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings](/courses/n8n/lessons/n8n-interface-walkthrough-2025/)
- [Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions](/courses/n8n/lessons/n8n-node-types-explained/)
- [Lesson 9: Build Your First n8n Workflow - Send Welcome Emails Automatically](/courses/n8n/lessons/build-your-first-n8n-workflow-send-welcome-emails-automatically/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Does Docker Desktop n8n installation work on Linux?
Docker Desktop is only available for Mac and Windows. Linux users must install Docker Engine and Docker Compose separately, then follow the docker-compose method documented in the n8n server-setup section. The n8n documentation lists this path under Server Setups alongside options for Heroku, Digital Ocean, AWS, Azure, and Google Cloud.
### Why does n8n via Docker ask me to create an owner account even though I already installed n8n via NPM on the same machine?
The Docker container is a fully isolated environment. n8n running inside the container has no access to the NPM installation's data or settings, so it treats itself as a brand-new instance and runs the complete first-time setup wizard, including the owner account form, onboarding survey, and optional license key step.
### What is the n8n_data Docker volume and why must you create it before starting the container?
The n8n_data volume is a Docker-managed storage location that holds your n8n workflows, credentials, and execution history outside the container itself. Creating it first means your data persists across container stops, restarts, and version updates. Skipping this step would cause n8n to lose all saved data every time the container is stopped.
### Is Docker Desktop free to use for running n8n locally?
Docker Desktop is free for personal use and for organizations with fewer than 250 employees and less than $10 million USD in annual revenue. Larger enterprises require a paid Docker subscription. For individual learners and small teams, the free tier covers everything needed to download, run, and manage a local n8n Docker container.
---
# How to Optimize Workflows in n8n - Faster & Scalable Automations
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-optimize-workflows-in-n8n-faster-scalable-automations/
> Speed up slow n8n workflows with practical optimization techniques that cut execution time and let you scale automations without breaking them.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is n8n workflow optimization and why does node count matter?
Workflow optimization in n8n cuts execution time and API overhead by removing redundant nodes, running independent branches in parallel, batching API calls, and collapsing repetitive loops with merge-and-aggregate patterns. In a 100-item customer feedback workflow, applying all four techniques reduced total node executions from 441 to 206, a roughly 50% drop, without changing what the workflow produces.
## How to cut n8n workflow execution by 50% using the Merge node, parallel branches, and batch APIs
Redundant node removal and parallel branching are the cheapest structural fixes. Every extra node adds execution overhead, so remove any node that adds a step without adding logic. For actions that share no dependency such as a Slack notification, a Notion entry, and an Airtable update, connect each one directly to the same upstream decision node instead of chaining them end to end. n8n processes branches left to right and top to bottom, so place the highest-priority branch leftmost. In the lesson's lead-qualification example, three downstream actions were chained sequentially; moving them into parallel branches cuts wall-clock time to whichever branch takes longest, not the sum of all three.
The Merge node eliminates per-item API fetches and is the most impactful single change in the lesson. The unoptimized feedback workflow called Airtable's get-customer endpoint once per item inside a Loop Over Items node, producing 100 individual API calls. The optimized version fetches all customer records in one Airtable call, then passes both datasets into a Merge node configured to match on the email field, producing a single joined dataset of 100 enriched records. Those 100 API calls collapse to one.
The Code node and batch APIs handle the remaining repetitive send actions. For 38 low-rated feedback entries, the unoptimized workflow fired 38 separate Slack alerts. The optimized version routes those entries through a Filter node (rating less than 3), then a Code node set to "run once for all items" that concatenates all records into one summary string, sending a single Slack message. Airtable's batch API, discussed but not fully implemented in the lesson, would compress 100 individual update calls into one bulk request, the highest-leverage remaining optimization in that workflow.
## Key Takeaways
- Removing redundant nodes directly reduces execution count: the 100-item feedback workflow dropped from 441 to 206 node executions by restructuring alone, with no logic changes.
- Parallel branches (Slack, Notion, Airtable side by side) replace sequential chains and cut wall-clock time to whichever branch takes longest, not the sum of all three.
- The Merge node matched on email replaced 100 per-item Airtable get-customer calls with one bulk fetch plus one join, eliminating that category of calls entirely.
- The Code node in "run once for all items" mode collapsed 38 individual Slack alerts into one summary message, reducing the Slack node's execution count from 38 to 1.
- Airtable's batch API and equivalent bulk endpoints in other tools compress N individual update calls into one request, the single highest-impact optimization when updating many records in a loop.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### How does the Merge node replace per-item API calls in n8n?
The Merge node joins two datasets on a shared field in a single pass. In the lesson's workflow, fetching all Airtable customer records at once and merging them with feedback records on the email field replaced 100 individual get-customer API calls that were firing inside a Loop Over Items node, eliminating that entire category of per-item requests.
### How should parallel branches be structured in an n8n workflow?
Parallel branches in n8n connect multiple independent nodes directly to the same upstream node rather than chaining them end to end. n8n executes branches left to right and top to bottom, so place the highest-priority branch leftmost. In the lesson, Slack, Notion, and Airtable update nodes each connect directly to the qualifying decision node instead of running sequentially after each other.
### What does the Code node's 'run once for all items' mode do in n8n?
The Code node's 'run once for all items' mode receives the full array of input items and executes its script exactly once across all of them. In the lesson, it concatenated 38 low-rated feedback entries into one summary string so a single Slack message replaced 38 individual alerts, cutting the Slack node's execution count from 38 to 1.
### When should you use Airtable's batch API instead of updating records one at a time in n8n?
Airtable's batch API sends multiple records in a single HTTP request, so updating 100 records costs 1 API call instead of 100. The lesson kept individual updates for side-by-side comparison, but the instructor noted that switching to the batch API would compress 100 Airtable update executions into one bulk request, the largest remaining speed gain available in that workflow.
---
# How to Pin Data in n8n or Edit Output for Faster AI Automation Development
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-pin-data-in-n8n-or-edit-output-for-faster-ai-automation-development/
> Pin data in n8n or edit a node's output directly, so you can test logic and build AI automations without rerunning workflows each time.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is data pinning in n8n, and how does it speed up AI workflow development?
Data pinning in n8n logs a node's output and replays it on every subsequent test run instead of re-executing the node. When a webhook triggers your workflow or an HTTP node calls an external API like AccuWeather's 50-calls-per-day free tier, you pin the response once and iterate on downstream steps as many times as you need without re-submitting forms, firing webhooks, or burning quota. Pinned data persists across saves and workspace reloads.
## How to pin data, edit node outputs, and copy past execution data in n8n
**Pinning data** starts at the node level. Open a webhook node, click "Listen for test event," submit your form once, then click the pin icon inside the node panel. A purple pin icon appears on the canvas confirming the payload is frozen. Every test run from that point replays the pinned data, not a live call, and the pin survives saves and reloads so you can return the next day without re-triggering the source. Five limitations apply: pinning only works in test runs (never live production), only on nodes with a single output, stores one pin per node (a second pin replaces the first), cannot pin binary output nodes, and has zero effect on production execution.
**The edit output feature** lets you change the JSON values inside a node's output to simulate scenarios the source data does not currently contain. In the course demo, the merge node combines Google Sheets customer feedback with Airtable customer records. Clicking the edit icon beside the pin icon opens the raw JSON, where individual field values can be changed directly. Raising three customer ratings from 1 or 2 up to 4 or 5 and saving caused the downstream filter node (which passes records rated below 3) to drop from 38 matching items to 35. Saving the edits automatically pins the modified payload to that node so all downstream steps use the new values.
**Copying past execution data** solves the problem of reproducing a bug without re-triggering the error condition. Navigate to the Executions section in your n8n workspace, open a failed run, find the input data on the node just before the error, and copy it. Return to the editor, open the node's edit output panel, paste the copied payload, and run. In the course demo, a missing email field had caused a "no email found" error. Pasting that exact erroneous input into the webhook node replicated the failure instantly and confirmed the stop-and-error node was handling it gracefully, all without submitting a new broken form.
## Key Takeaways
- The purple pin icon on a canvas node signals that node's output is frozen; all downstream test runs use the pinned payload instead of calling the external service.
- Pin data is test-only and does not affect production execution, so live workflows run normally against real data once deployed.
- The edit output feature pins modified JSON automatically on save, making changed field values, like an updated rating, immediately visible to filter, IF, and merge nodes downstream.
- Copying input from a failed execution via the Executions tab and pasting it into the editor's edit panel replicates bugs deterministically without re-triggering live API calls or form submissions.
- All three techniques, pinning, editing output, and execution replay, eliminate unnecessary LLM API calls during AI workflow development, which directly cuts cost and preserves rate limits on external services.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Does pinned data in n8n survive after you save and close a workflow?
Pinned data persists across saves and workspace reloads. When you reopen a workflow the next day, the purple pin icon remains on the node and the frozen payload is still available for test runs. You do not need to re-submit a form or call the external API again to continue building.
### What are the limitations of the pin data feature in n8n?
Pin data in n8n has five constraints: it only works during test runs (not live production execution), only applies to nodes with a single output, stores one pin per node (a new pin replaces the existing one), cannot be used on nodes that produce binary output, and has no effect once a workflow is running in production.
### How does the edit output feature differ from simply pinning data in n8n?
The edit output feature lets you manually change specific JSON field values inside a node's existing output to simulate edge cases, like raising a customer rating from 1 to 5, without altering the source system. Pin data freezes a real response as-is. Edit output is the right tool when you need the downstream filter or IF node to see different values than the live source currently holds.
### Why copy data from a past execution instead of re-running the workflow to reproduce a bug?
The Executions tab in n8n stores the exact input that reached each node during a failed run. Copying that input and pasting it into the editor's edit output panel replicates the precise error condition, including a missing email field or malformed payload, without triggering live API calls, submitting forms, or consuming rate-limited quota.
---
# How to fix AI Automation Workflows Fast in n8n | Error Handling & Debugging
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-fix-ai-automation-workflows-fast-in-n8n/
> Debug and fix broken AI automation workflows in n8n quickly using built-in error handling, retries, and node-level troubleshooting steps.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 4. Error Handling & Debugging.
Watch the video above for the full tutorial, or read the written guide below.
## What does n8n's Debug in Editor feature do?
Debug in Editor copies a failed production execution directly onto your n8n canvas in fully editable mode, so you can inspect and fix the exact data that caused the failure without re-triggering your webhook or reloading fresh data. You open the execution log, locate the failed run, and click "Debug in Editor" to load the erroneous payload into every node as live, editable input.
## How do you retry a failed execution in n8n?
The Retry Execution button, located next to Debug in Editor in the execution log, replays a failed run so no data is lost from one-off failures caused by temporary outages. Clicking it surfaces two options: "Retry with currently saved workflow from node with error" runs the failed payload through your latest workflow changes, while "Retry with original workflow from node with error" reruns the exact workflow that was live at the time of failure.
If a downstream service like AWS SES was temporarily unavailable, retrying with the original workflow reproduces the error. Retrying with the currently saved workflow, after you have applied a fix, picks up exactly where the run stopped and processes the original payload through your corrected nodes, ensuring no data is lost.
## How does Workflow Version History work in n8n?
Workflow Version History saves a snapshot every time you save a workflow, letting you restore any previous version from the history panel. You access it via the "Workflow History" button next to the Save button on the canvas. Each saved version is listed with a timestamp, and the action menu on each entry lets you restore, clone to a new workflow, open in a new tab, or download the version.
Restoring a version replaces the current workflow immediately. In the lesson demo, restoring an earlier version reverts both the misconfigured property reference (from `email` back to `user_email`) and the sender domain, confirming the rollback is complete. The Starter plan limits version history to one day; the $60 per month plan extends retention to five days.
## How do you prevent recurring errors from silently failing n8n workflows?
The IF node routes workflow execution based on a condition check, catching bad input before it reaches fragile nodes like an email sender. In the lesson demo, an IF node checks whether the incoming email field is non-empty before the AWS SES node runs. The true branch continues the workflow; the false branch connects to a Stop and Error node, which halts execution and raises an explicit error instead of letting the workflow silently succeed with invalid data.
Logging bad records to a Google Sheet on the false branch is one option, but the instructor flags that attaching a Stop and Error node is more elegant because it triggers n8n's error workflow system. That system handles recurring data-quality failures centrally, a topic covered in the next lesson of the course.
## Key Takeaways
- **Debug in Editor** loads a real failed execution onto an editable canvas so you fix the exact payload that broke the workflow, with no need to re-trigger the webhook or reload data.
- **Retry Execution** offers two modes: "current workflow" applies your latest fixes to the original payload, while "original workflow" reruns the flow exactly as it was, confirming whether a temporary outage or a configuration error caused the failure.
- **Workflow Version History** saves a snapshot on every save; the Starter plan retains one day of history, the $60 per month plan retains five days, and restoring a version immediately replaces the current workflow.
- **The IF node** guards fragile nodes by validating input data upstream, routing invalid records to a Stop and Error node rather than crashing mid-execution with a silent or ambiguous failure.
- **Stop and Error node** raises an explicit error on the false branch of your validation IF node, enabling n8n's error workflow system to handle recurring data-quality problems centrally rather than burying them in execution logs.
## Related Lessons
- [Lesson 21: Master Error Handling in n8n | Build Reliable n8n Workflows That Don't Break](/courses/n8n/lessons/master-error-handling-in-n8n/)
- [Lesson 32: Master AI Automation Workflows Debugging & Error Handling with Execution Logs](/courses/n8n/lessons/master-ai-automation-workflows-debugging-error-handling-with-execution-logs/)
- [Lesson 34: Error Workflows in n8n AI Automation | Stop & Error Node | Error Trigger Node](/courses/n8n/lessons/error-workflows-in-n8n-ai-automation/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the difference between 'Retry with current workflow' and 'Retry with original workflow' in n8n?
Retry Execution offers two modes. 'Retry with currently saved workflow' reruns the failed payload through your latest workflow changes, useful after you have applied a fix. 'Retry with original workflow' reruns the exact workflow that existed at the time of failure, which will reproduce the error if the root cause was a misconfiguration rather than a temporary outage. In the lesson demo, retrying with the original workflow fails again, while retrying with the corrected workflow succeeds.
### How do you access Debug in Editor in n8n?
Debug in Editor is available from the execution log. Open the Executions view from the n8n home screen, click the failed execution entry, and click the 'Debug in Editor' button in the top-right area of that view. n8n loads the entire workflow onto the canvas with all the data from that failed run in fully editable mode, so you can change node settings and rerun individual nodes against the original erroneous payload without retriggering the webhook.
### What are the Workflow Version History limits on n8n's Starter plan?
The Starter plan retains workflow version history for one day only. Every save creates a new snapshot, but only snapshots from the current day are accessible for restore, clone, open-in-new-tab, or download. The plan at $60 per month extends retention to five days. The history panel is opened via the 'Workflow History' button next to the Save button on the workflow canvas, and restoring any version immediately replaces the currently active workflow.
### Why should you add an IF node before a node like AWS SES in n8n?
The IF node guards against invalid input data reaching a node that will throw an error on bad values. In the lesson demo, an empty or malformed email field causes the AWS SES node to fail with a bad-request error. Adding an IF node that checks for a non-empty email field before the SES node routes invalid submissions to a Stop and Error node instead of crashing mid-execution, making the failure explicit, traceable, and handleable by n8n's error workflow system.
---
# How to connect Google Forms & Webhook Node in n8n | Google Forms Integration
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-connect-google-forms-webhook-node-in-n8n/
> Connect Google Forms to n8n using the Webhook node, so form submissions trigger your workflow automatically. Video walkthrough included.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What Is the Webhook Node and How Does It Differ from API Polling?
The Webhook Node in n8n acts as a real-time data listener that triggers your workflow the instant data arrives at its URL. Unlike API polling, where your system must repeatedly request updates on a fixed interval, the Webhook receives a push the moment an external event fires. This removes polling delays and wasted compute, making it ideal for infrequent but time-sensitive events like form submissions, CRM entries, or security incidents.
## How to Connect Google Forms to the n8n Webhook Node
Google Forms has no native webhook field in its settings. You bridge it to n8n by pasting a short Apps Script into the form's built-in code editor and registering an `onSubmit` trigger. The script intercepts each form submission and POSTs the response data to your n8n Webhook URL, connecting Google's closed form system to any external workflow.
Inside your Google Form editor, click the three-dot menu next to your profile icon and select "Apps Script." Paste the provided script into the editor, replace the placeholder URL with your n8n test URL (copied from the Webhook Node panel after switching the HTTP method from GET to POST), and save the project to Google Drive with a recognizable name like "User Registration Form."
In the Apps Script dashboard, add a new trigger: set the function to `onSubmit`, deployment to `Head`, event source to `From Form`, and event type to `On form submit`. Save. Google prompts you to authorize access, including permission to "connect to an external service." Click the "Advanced" link to pass the unverified-app warning, since you authored the script, then grant permissions. Back in n8n, click "Listen for test events" on the Webhook Node and submit a live form response. The node displays the received payload with field values nested under `body` in the JSON output.
## Key Takeaways
- The Webhook Node must use the POST method, not the default GET, when receiving form submissions. Change the HTTP method in the node panel before clicking "Listen for test events."
- Google Forms requires an Apps Script `onSubmit` trigger to forward submissions to an external URL. There is no native webhook configuration anywhere in Forms settings.
- The test URL and production URL are separate endpoints. Configure the Apps Script with the test URL during development, then swap to the production URL before activating your n8n workflow.
- The Webhook payload nests form field values under `body`. Use dot notation (`$json.body["Your Name"]`) to reference specific fields in downstream nodes like IF, Slack, or Amazon SES.
- The Apps Script authorization requires clicking "Advanced" to bypass the "Google hasn't verified this app" screen. This is expected behavior for any self-authored script that connects to an external service.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why does the n8n Webhook Node need to be in 'Listen for test events' mode before the form is submitted?
The Webhook Node only accepts incoming POST requests while it's actively listening. Without clicking 'Listen for test events,' the Apps Script trigger fires but the POST to the n8n test URL returns a 'request failed' error. The node must be in listening mode each time you submit a test form response during development.
### What HTTP method should the n8n Webhook Node use for Google Forms submissions?
The Webhook Node must be set to POST, not the default GET. Google Forms sends submission data as a POST request. If the node stays on GET, it won't accept the incoming payload from the Apps Script trigger, and the form data will never reach your workflow.
### What permissions does the Google Apps Script trigger need to send form data to n8n?
The Apps Script trigger requires two Google account permissions: 'View and manage your forms in Google Drive' and 'Connect to an external service.' These appear during the authorization step when you first save the trigger. You must click 'Advanced' on the unverified-app screen and proceed, since the script is self-authored and not a published third-party app.
### How does the IF node route Webhook data to Slack versus Amazon SES?
The IF node reads a specific form field value from the Webhook payload, such as the answer to 'Are you planning to attend an event?', referenced as `$json.body["field name"]`. When the value equals 'Yes,' the true branch fires a Slack message to the events channel. When it equals 'No,' the false branch triggers an Amazon SES email to the admin team.
---
# How to Create Mock Data in n8n to test AI Automations without Live APIs
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-create-mock-data-in-n8n-to-test-ai-automations-without-live-apis/
> Generate mock data in n8n so you can test AI automation workflows without calling live APIs, burning credits, or hitting rate limits.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is mock data and why does n8n need it for AI automation testing?
Mock data is fake, pre-defined input you inject into an n8n workflow so you can test every branch and edge case before connecting live APIs or production databases. It lets you avoid repeated external API calls (saving time and cost), simulate realistic scenarios like blank email fields, and work with predictable outputs during early development without risking accidental overwrites to live records.
## How do you create mock data for n8n workflows?
Mockaroo (mockaroo.com) is the recommended first method. The free plan generates up to 1,000 rows of schema-matched data with typed fields ranging from email and credit card to airport code and datetime ranges. A blank-percentage control on each field lets you deliberately inject missing data, so your IF node branches get tested against incomplete inputs. An AI field generator lets you type a topic, such as "stock trades" or "flight logs," and it assigns matching column types and formulas automatically. You download the result as JSON, copy it, and paste it into any n8n node using the Edit Output icon to pin the data for the rest of the workflow.
ChatGPT or any LLM works as a second method when you need data shaped around a specific workflow. Prompt it with your workflow's purpose, required field count, and edge cases such as blank email IDs, and ask explicitly for a JSON list of items. If you ask for JSON and the first response comes back as individual objects rather than an array, n8n will reject the paste with an "unexpected non-whitespace character" error. Paste that error back into ChatGPT and ask it to reformat the output as a JSON list of items before retrying the pin.
The Edit Fields node and the Code node handle custom in-workflow generation as a third approach. Use the Edit Fields node in JSON mode for single-record tests during very early workflow development. Use the Code node when you need a for loop or calculated fields, returning every record wrapped in the `{json: {...}}` structure n8n expects. A fourth option, the built-in Customer Data Store node, returns at most five records regardless of the limit you set, making it useful only for practicing node mechanics, not for bulk or edge-case validation.
## Key Takeaways
- **Mockaroo** generates up to 1,000 typed, randomizable rows for free and exports JSON you paste directly into an n8n node via Edit Output to pin it as workflow input.
- **Blank-percentage controls** in Mockaroo let you deliberately inject missing fields, such as empty emails, so your IF node gets tested against incomplete real-world inputs rather than a clean dataset.
- **ChatGPT mock data must be formatted as a JSON list of items**, not individual objects. If n8n rejects the paste, copy the error back into ChatGPT and ask it to fix the array wrapping before retrying.
- The **Edit Fields node** suits single-record early-stage tests; the **Code node** suits complex or programmatically generated datasets using a for loop with the `{json: {...}}` wrapper n8n requires.
- The **Customer Data Store node** is capped at five records regardless of the limit you configure, making it suitable only for learning individual node concepts, not real workflow stress-testing.
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does Mockaroo's blank-percentage control do for n8n workflow testing?
Mockaroo's blank-percentage control sets any field to return empty values for a chosen share of rows. In n8n, this means your IF node or email-validation branch gets tested against realistic missing-data scenarios, like 20% of email fields being blank, without you hand-crafting those edge cases. It is one of the fastest ways to verify that your workflow handles bad input gracefully before production.
### Why does ChatGPT-generated JSON fail when pasted into an n8n node's Edit Output?
ChatGPT sometimes returns mock data as separate JSON objects rather than a single JSON array, and n8n's Edit Output pin requires a list of items. The error message reads "unexpected non-whitespace character after JSON." To fix it, paste that error message back into ChatGPT and ask it to reformat the output as a JSON list of items. The corrected array will pin without errors and expose all records to downstream nodes.
### When should you use the Code node instead of Mockaroo to generate mock data in n8n?
The Code node is the right choice when your test data requires custom logic that no external generator can produce, such as a for loop that builds calculated fields or values derived from other fields in the same record. Wrap every record in the `{json: {...}}` structure n8n expects and return the full array. For standard datasets, Mockaroo or ChatGPT are faster and require no code.
### What is the Customer Data Store node's practical limit for n8n workflow testing?
The Customer Data Store node returns a maximum of five records regardless of the row limit you configure. It is useful for learning how a specific n8n node behaves in isolation, but it cannot replicate bulk or edge-case scenarios. For any real workflow validation involving hundreds or thousands of rows, use Mockaroo, a ChatGPT-generated JSON list, or the Code node instead.
---
# How to Auto-Save Gmail Attachments to Google Drive | n8n AI Automation Tutorial
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-to-auto-save-gmail-attachments-to-google-drive/
> Set up an n8n workflow that auto-saves Gmail attachments straight to Google Drive, with a full video walkthrough and steps.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 5. Hands-On Projects.
Watch the video above for the full tutorial, or read the written guide below.
## What Is the Gmail-to-Google Drive Attachment Workflow in n8n?
The Gmail Trigger node anchors an n8n automation that saves email attachments directly to a Google Drive folder and fires a Discord team notification. The four-node chain runs: Gmail Trigger polling the inbox every minute, a Filter node discarding emails with no binary data, a Google Drive upload node, and a Discord webhook node. Emails with multiple attachments need a fifth node, Split Out, to fan each binary field into its own item before the upload.
## How to Build the Gmail Attachment Auto-Save Workflow in n8n
The Gmail Trigger, Filter, Split Out, Google Drive, and Discord nodes chain together to route every email attachment into a designated Drive folder automatically. Configure the Gmail Trigger to download attachments, gate with a binary-exists Filter, fan multi-attachment emails through Split Out, use two dynamic expressions in the Google Drive node to resolve field names and filenames, and send a Discord webhook notification on each upload.
The Gmail Trigger node starts with the "On Message Received" event. Disable the "Simplify" toggle so the full email payload is available, then enable "Download Attachments" with the default prefix `attachment_`. That prefix is critical: n8n names every binary field `attachment_0`, `attachment_1`, and so on, and every downstream expression depends on that naming convention. Add a Filter node next with the condition set to expression `$binary`, type Object, condition Exists. This gate silently drops plain-text emails before they reach the upload node.
The Split Out node solves the multiple-attachment problem. A Gmail email with nine attachments arrives in n8n as one item carrying nine binary fields, not nine separate items. Set the Split Out field to `$binary` so it outputs nine individual items. In the Google Drive node (resource: File, operation: Upload), replace the hardcoded `attachment_0` in "Input Data Field Name" with the expression `{{$binary.keys().first()}}`. This dynamically returns the correct binary key for whichever item is currently being processed. For "File Name," use `{{$("Filter emails with attachments").item.json.subject}}_{{$binary.values().first().fileName}}` to combine the email subject with each attachment's original filename stored in the binary metadata. Select the target parent drive and destination folder to complete the upload configuration.
The Discord node completes the chain using a webhook credential, not a bot token. Reference the email subject from the Filter node in the message body. Because nine attachments produce nine separate Discord messages, place an Aggregate or Code node upstream of Discord to collapse them into a single team notification.
## Key Takeaways
- The Gmail Trigger requires "Download Attachments" enabled and the `attachment_` prefix set; without it, no binary data flows to any downstream node.
- The Filter node checks `$binary` Object Exists to catch any email carrying at least one attachment, regardless of the exact field name or total attachment count.
- The Split Out node set to `$binary` converts one multi-attachment email item into N separate items so the Google Drive node runs once per file instead of erroring after the first.
- `{{$binary.keys().first()}}` dynamically resolves each item's binary field name, replacing the hardcoded `attachment_0` that causes upload failures for every file beyond the first.
- `{{$binary.values().first().fileName}}` reads the original attachment filename from the binary metadata, enabling organized and searchable filenames in Google Drive rather than generic hardcoded strings.
## Related Lessons
- [Lesson 35: Lead Enrichment Capstone](/courses/n8n/lessons/lead-enrichment-capstone/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why does the Google Drive node fail when a Gmail email has more than one attachment?
The Google Drive node fails because "Input Data Field Name" defaults to the hardcoded string `attachment_0`. A multi-attachment email arrives in n8n as a single item with binary fields named `attachment_0` through `attachment_8`. The node uploads the first file, then errors on every subsequent item because their binary keys do not match `attachment_0`. The fix is a Split Out node (field: `$binary`) upstream plus the dynamic expression `{{$binary.keys().first()}}` in the field name setting.
### What does the Split Out node do when processing Gmail attachments in n8n?
The Split Out node converts one n8n item that carries multiple binary fields into individual items, one per binary field. Set "Field" to `$binary` so n8n reads the attachment object and outputs a separate item for each attachment. An email with nine attachments produces nine items, each holding one binary field, so the Google Drive node can upload each file in its own execution instead of failing after the first attachment_0 match.
### What expression retrieves the original filename from a Gmail attachment in n8n?
The expression `{{$binary.values().first().fileName}}` retrieves the original filename stored by the Gmail Trigger. `$binary.values()` returns an array of the binary field objects on the current item, `.first()` selects the first one, and `.fileName` reads the filename property. Combine it with the email subject for organized Drive storage: `{{$('Filter emails with attachments').item.json.subject}}_{{$binary.values().first().fileName}}`.
### Why does the Filter node check whether the `$binary` object exists rather than checking a specific field like `attachment_0`?
The Filter node checks `$binary` as an Object Exists because the binary field names change with attachment count, starting at `attachment_0` and incrementing. Checking the `$binary` object itself catches any email carrying at least one attachment regardless of how many files it includes. Checking a hardcoded field like `attachment_0` would only match that exact field and could silently pass or drop emails incorrectly once the Split Out node reorganizes the binary structure downstream.
---
# How Branching works in n8n Workflows | Smart Automations with Multiple Paths
URL: https://www.genaiunplugged.com/courses/n8n/lessons/how-branching-works-in-n8n-workflows/
> See how branching lets an n8n workflow split into multiple paths using IF and Switch nodes, so different data routes trigger different actions.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## What is the Switch node and how does it create multiple paths in an n8n workflow?
The Switch node routes each incoming item to a named output branch based on configurable matching rules, replacing a chain of stacked IF nodes with a single, readable configuration. While the IF node produces only two outputs, true or false, the Switch node supports four or more branches simultaneously. In this lesson it evaluates `order_status` and splits 100 orders into pending, processing, canceled, and refunded streams in one step.
## How to build a multi-branch order-routing workflow in n8n
The Manual Trigger node starts the workflow for testing, with a Schedule Trigger recommended for daily production runs at a fixed time. A Google Sheets node follows, configured with the "Get Rows" operation pointing to the mock orders spreadsheet, which returns all 100 records as a list of JSON objects. Every record shares seven properties: row number, order ID, first name, last name, customer email, order status, and order date. In n8n, even a single returned record is wrapped in a list because every node expects a list of items as input.
The Switch node connects directly after Google Sheets. Each routing rule compares `$json.order_status` against a fixed string value: "pending", "processing", "canceled", or "refunded". Dragging the field from the item properties panel into the value slot auto-converts it from fixed text to expression mode, where anything inside double curly braces is evaluated as JavaScript. Each rule maps to a renamed output branch, such as "pending orders" or "processing orders". Renaming outputs is a best practice: without it, the canvas labels branches only as output 0, 1, 2, and 3, forcing you to reopen the Switch node to understand what each branch does. Two additional options improve reliability: "Fallback output" handles items that match no rule (left blank to silently drop unmatched statuses like "shipped" or "delivered"), and "Ignore case" prevents routing failures when source data uses inconsistent capitalization.
Each branch connects to a specific action node based on business need. The pending-orders branch connects to an Amazon SES node that sends an alert email to the customer service team, with the subject built dynamically using `$json.order_id` as an expression. The processing-orders branch connects to a Slack node that posts to a dedicated high-priority channel so the operations team can expedite shipping without waiting for email. The canceled and refunded branches both connect into the same Amazon SES node and the same Slack node, because both statuses require identical downstream actions: a finance-team email and a Slack notification to the canceled-and-refunded channel. n8n allows multiple upstream branches to feed a single downstream node, so no duplication is needed.
## Key Takeaways
- The Switch node replaces stacked IF nodes when three or more distinct conditions exist, producing one named output branch per rule from a single configuration panel.
- Routing rules use `$json.` expressions, auto-generated by dragging a field from the item panel, to evaluate any property of the current item against a fixed value.
- Renaming each output branch directly inside the Switch node, for example "pending orders", prevents canvas confusion where unnamed branches default to "output 0", "output 1", etc.
- The "Ignore case" option makes string comparisons case-insensitive, preventing routing failures when order status values are entered with inconsistent capitalization in the source sheet.
- Multiple upstream branches can share a single downstream action node, so canceled orders and refunded orders can both trigger the same email node and Slack node without duplicating either.
## Related Lessons
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
- [Lesson 16: How to connect Google Forms & Webhook Node in n8n | Google Forms Integration](/courses/n8n/lessons/how-to-connect-google-forms-webhook-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### When should you use the Switch node instead of the IF node in n8n?
The Switch node handles three or more distinct conditions in a single node, producing a named output branch for each rule. The IF node supports only two outputs, true and false, so routing four order statuses like pending, processing, canceled, and refunded would require stacking multiple IF nodes. The Switch node keeps the canvas readable and the routing logic centralized in one place.
### How does the Switch node access item properties like order status in its routing rules?
The Switch node uses `$json.order_status` in expression mode to read the order status field from each incoming item. Dragging the property from the item properties panel into the value field automatically converts the input from fixed text to an expression editor. Anything inside double curly braces is interpreted as JavaScript, but no manual expression writing is required when you drag and drop the field.
### Can multiple Switch node branches feed into the same downstream action node in n8n?
Multiple upstream branches can connect into a single downstream node without any special configuration. In this lesson, both the canceled-orders branch and the refunded-orders branch connect to the same Amazon SES email node and the same Slack node. n8n processes the items from each incoming connection as separate runs on that shared node, executing it once per connected branch.
### What does the Switch node's fallback output do, and when should you configure it?
The Switch node's fallback output determines what happens to items that match none of the defined routing rules. In this lesson, orders with statuses like "shipped" or "delivered" match no rule and are silently dropped by leaving the fallback blank. Configure a fallback branch whenever unmatched items need logging, a separate notification, or any downstream handling instead of a silent discard.
---
# Build Your First Faceless YouTube Automation With n8n | TikTok - Instagram Reels Automation
URL: https://www.genaiunplugged.com/courses/n8n/lessons/build-your-first-faceless-youtube-automation-with-n8n/
> Build your first faceless YouTube automation with n8n, then repurpose the same workflow for TikTok and Instagram Reels content.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 7. Final Project.
Watch the video above for the full tutorial, or read the written guide below.
## What is the n8n Faceless YouTube Channel Automation workflow?
The n8n faceless YouTube automation workflow pulls a pending topic from a Google Sheet, generates a video script and scene captions via an OpenAI LLM node, creates context-aware image prompts, renders those into short clips, produces an AI voiceover, stitches everything using a Creatomate template, and publishes the final video to Instagram, YouTube, TikTok, or LinkedIn, all without writing a single line of code.
## How to build the 8-step faceless video pipeline in n8n
The Google Sheets node serves as the data entry point and first filter. You configure it with the operation "Get Rows," point it at your "Faceless YouTube Shorts" sheet, and set a filter where the Status column equals "pending." Enabling "Return Only First Matching Row" ensures the workflow processes exactly one video per run. The sheet stores columns for topic, tone, niche, persona, target platform (TikTok, Instagram, or YouTube Shorts), language, and CTA style (question, subscribe prompt, drop a comment, start a debate, or try-it-and-share), so every AI node downstream receives fully contextualized input before generating a single word.
The Basic LLM Chain node connects next and calls OpenAI to produce two outputs in one pass: a full video script and scene captions for on-screen overlays. A second AI node then generates dynamic image prompts grounded in the video's content. Those prompts feed image-generation and video-generation nodes that turn stills into short clips. A dedicated voiceover node creates the audio narration, and a merge step combines the clips, captions, and audio into a single package ready for final rendering.
Creatomate handles the video stitch in step eight. The node sends the merged assets to a predefined Creatomate template and renders a finished Reel or YouTube Shorts file. The workflow then publishes the video to Instagram and YouTube in sequence, archives the rendered file to Google Drive, and writes the status back to the Google Sheet as "done" along with the video URL, closing the loop on that topic row.
## Key Takeaways
- The Google Sheets node's "Return Only First Matching Row" option limits each workflow run to a single pending topic, preventing simultaneous video generation that could cause resource conflicts.
- The Google Sheet acts as the control panel: topic metadata including tone, niche, persona, platform, language, and CTA style flows directly into the OpenAI prompt, making the output platform-specific without any manual prompt editing.
- The Basic LLM Chain node is the right choice here because it supports structured output and lets you swap the underlying LLM without rewiring downstream connections.
- Creatomate abstracts the video composition step so n8n triggers a render via API call against a predefined template rather than running custom video-editing logic inside the workflow.
- The workflow's final status loop, writing "done" and a video URL back to the sheet, means the Google Sheet doubles as a production log you can audit without opening n8n.
## Related Lessons
- [Back to Full Course](/courses/n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does the 'Return Only First Matching Row' option do in the Google Sheets node?
The 'Return Only First Matching Row' option on the Google Sheets node restricts the workflow to fetching a single row where Status equals 'pending,' so the entire pipeline generates exactly one video per execution. Without it, every pending row would be returned and processed simultaneously, which would break downstream nodes expecting a single topic context.
### What columns does the Google Sheet need for the faceless video automation to work correctly?
The Google Sheet used in this workflow includes video number, topic, tone, niche, persona, target platform (TikTok, Instagram, or YouTube Shorts), language, CTA style, per-platform publish status (pending, published, or rejected), an overall status field (pending, working in progress, or done), and a video URL column that the workflow populates after archiving the rendered file to Google Drive.
### Why does the workflow use the Basic LLM Chain node instead of a simpler prompt node?
The Basic LLM Chain node supports structured output formatting and makes the underlying LLM swappable without rebuilding node connections. The workflow needs both a full video script and scene captions in a predictable structure that downstream nodes can parse reliably, which a simple one-shot prompt node does not guarantee.
### What role does Creatomate play in the n8n faceless video pipeline?
Creatomate receives the merged package of image-based video clips, AI voiceover audio, and scene captions from n8n and renders a finished short-form video using a predefined template. It handles video composition server-side so n8n only needs to make one API call with dynamic asset data, eliminating any need for ffmpeg or custom code inside the workflow.
---
# Build Your First n8n Workflow - Send Welcome Emails Automatically
URL: https://www.genaiunplugged.com/courses/n8n/lessons/build-your-first-n8n-workflow-send-welcome-emails-automatically/
> Follow a beginner n8n tutorial that builds your first workflow, automatically sending a welcome email to every new signup.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## What does a webhook-triggered welcome email workflow do in n8n?
The Webhook trigger node listens for incoming POST requests from an external form and fires the n8n workflow the moment a submission arrives. Connected to an email action node such as AWS SES, Gmail, or any SMTP provider, it sends a personalized welcome email automatically, replacing manual outreach. The workflow uses submitted form fields, including first name and email address, as dynamic expression variables inside the message body and recipient field.
## How to build a form-to-email automation in n8n
The Webhook node provides two URLs: a test URL for development and a production URL for live traffic. Set the HTTP method to POST because the workflow is receiving form data. Click "Listen for test event" to register the webhook and make it ready to accept requests. Google Forms don't support webhooks natively, so paste the test URL into a Google AppScript bound to the form, set the trigger event to "On form submit," and save the script. The AppScript fires a POST request to that URL every time someone submits the form. Switch the AppScript's `postUrl` variable to the production URL only after the workflow is fully tested and activated.
Add an AWS SES (or Gmail, Outlook, or Send Email SMTP) node after the Webhook. In the body field, drag the `first_name` field from the webhook's JSON input panel directly onto the template text, and n8n converts it to the expression `{{$json.body.first_name}}` automatically. Do the same for the To address using the `email` field from the same JSON body. Use a brand-domain sender address rather than a personal Gmail to protect deliverability. Rename the node to something descriptive like "Send Welcome Message" so the canvas stays readable.
The IF node extends the workflow to branch on customer type. Set two conditions joined by AND: email does not end with `gmail.com`, and email does not end with `hotmail.com`. Because the email data lives two nodes back on the Webhook, click the Webhook node in the input selector to access it inside the IF node configuration. When both conditions are true, the submission is treated as a corporate signup. Connect the true branch to a Google Sheets node set to "Append row" to log corporate customers automatically for sales or marketing follow-up.
## Key Takeaways
- The Webhook node's test URL and production URL are separate. Update the `postUrl` variable in your Google AppScript every time you switch between them, or live submissions will hit a dead endpoint.
- Google AppScript bridges Google Forms to n8n by catching the "On form submit" trigger event and sending a POST request to the webhook URL you configure in the script.
- Dragging a field from the input panel into any configuration field switches that field from fixed to expression mode and wraps the reference in `{{$json.body.fieldName}}` automatically, so no manual expression syntax is required.
- The IF node's "does not end with" string operation, chained with AND, identifies corporate emails by excluding known free domains. For production use, a regular expression covers more providers reliably.
- Use a professional sending service such as AWS SES or SendGrid with a brand domain for outbound welcome emails. Free provider addresses like Gmail frequently land in spam.
## Related Lessons
- [Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting](/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/)
- [Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js](/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/)
- [Lesson 6: How to Install n8n for free on local machine using Docker Desktop](/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/)
- [Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings](/courses/n8n/lessons/n8n-interface-walkthrough-2025/)
- [Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions](/courses/n8n/lessons/n8n-node-types-explained/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why does the Webhook node in n8n have a test URL and a production URL?
The Webhook node provides a test URL so you can build and verify the workflow without exposing it to real traffic. Clicking 'Listen for test event' activates the test URL temporarily for a single submission. Once the workflow behaves correctly end to end, you paste the production URL into your Google AppScript's postUrl variable and activate the workflow so it runs continuously without needing manual listening.
### How does a Google Form pass submitted data to an n8n webhook?
Google Forms don't support webhook integrations out of the box. A Google AppScript bound to the form intercepts the 'On form submit' trigger event, packages the field values from the response, and sends a POST request to the webhook URL stored in the script's postUrl variable. The Webhook node in n8n receives that POST request and exposes the field values as JSON under the body property.
### How do n8n expressions work when personalizing a welcome email?
Dragging a field from the input panel into a configuration field switches that field from fixed mode to expression mode. n8n wraps the reference in double curly braces, for example {{$json.body.first_name}}, and evaluates it as JavaScript when the workflow runs. The submitted value replaces the placeholder in the final email, so every recipient receives a message addressed to their actual name without any manual variable syntax.
### What does the IF node's true branch represent in this workflow?
The IF node's true branch activates when the submitted email address does not end with gmail.com AND does not end with hotmail.com. A submission that satisfies both conditions is classified as a corporate customer. That true branch connects to a Google Sheets 'Append row' node, which logs the corporate signup automatically so a sales or marketing team can follow up.
---
# Error Workflows in n8n AI Automation | Stop & Error Node | Error Trigger Node
URL: https://www.genaiunplugged.com/courses/n8n/lessons/error-workflows-in-n8n-ai-automation/
> Set up n8n Error Trigger and Stop & Error nodes to catch failures, send alerts, and build workflows that fail gracefully.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 4. Error Handling & Debugging.
Watch the video above for the full tutorial, or read the written guide below.
## What is an error workflow in n8n and what does it do?
An error workflow is a dedicated n8n workflow that automatically triggers whenever another workflow in your environment encounters a failure. It logs errors, sends alerts to the right people, and ensures no failure goes unnoticed. You build it once, attach it to as many workflows as you need via each workflow's settings panel, and it fires automatically whenever a covered workflow fails in production.
## How do you build and attach an error workflow in n8n?
The Error Trigger node is the first node you add to any error workflow. It requires zero configuration because it automatically receives a rich error object the moment a failure occurs elsewhere. That object includes the workflow name and ID, the execution ID and a direct URL to the execution log, the full error message and stack trace, and the name of the specific node where the failure happened. To get sample data for building the rest of the workflow without waiting for a real failure, click "Fetch test event" directly on the node.
Once the Error Trigger node is wired up, downstream nodes act on that data. A Gmail node set to "Send Message" is a fast first step: inject `workflow.name` into the subject line and build an HTML body that links directly to the execution URL so recipients can jump straight to the failing log. For team-wide visibility, a Slack node using Block Kit blocks lets you structure a richer message with the error details, the failing node name, and a "Debug here" button that points to the execution URL. To route alerts to the right owner rather than a generic inbox, add a Google Sheets lookup between the Error Trigger node and your notification nodes. A sheet that maps workflow names to owner emails and Slack user IDs lets the error workflow send a personalized direct message to the owner and a parallel alert to a shared team channel.
To attach the error workflow to any covered workflow, open that workflow's settings via the three-dot menu, find the "Error workflow" field, and select your error handling workflow by name. One critical constraint: the Error Trigger node only fires on active production workflows, not manual test runs. The covered workflow must be switched on before errors route through to your error workflow. You can go further by adding conditional routing on HTTP status codes, categorizing 5xx responses as low-priority retryable errors, 4xx responses as medium-priority data-fix errors, and 401/403 responses as high-priority authentication failures requiring immediate escalation.
## Key Takeaways
- The Error Trigger node auto-populates with execution ID, execution URL, error message, stack trace, and the name of the failing node. It has no configuration panel because the error object arrives automatically from the covered workflow.
- Attaching an error workflow requires opening the target workflow's three-dot settings menu and selecting the error workflow by name in the "Error workflow" field. One error workflow can cover many workflows simultaneously.
- The Error Trigger node fires only on active production workflows. Covered workflows must be enabled before errors will route to your error handling workflow.
- The Stop and Error node lets you raise intentional errors when validation or conditional logic fails, pass a custom error message or object downstream, and halt execution cleanly so bad data does not silently propagate through the rest of the workflow.
- Error workflows become progressively smarter: start with a single email alert, add owner-mapping via Google Sheets for personalized Slack messages, then layer HTTP-code-based severity routing and eventually an LLM node to classify and prioritize issues automatically.
## Related Lessons
- [Lesson 21: Master Error Handling in n8n | Build Reliable n8n Workflows That Don't Break](/courses/n8n/lessons/master-error-handling-in-n8n/)
- [Lesson 32: Master AI Automation Workflows Debugging & Error Handling with Execution Logs](/courses/n8n/lessons/master-ai-automation-workflows-debugging-error-handling-with-execution-logs/)
- [Lesson 33: How to fix AI Automation Workflows Fast in n8n | Error Handling & Debugging](/courses/n8n/lessons/how-to-fix-ai-automation-workflows-fast-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What data does the Error Trigger node provide when another workflow fails?
The Error Trigger node delivers the failed workflow's name and ID, the execution ID and a direct URL to the execution log, the full error message and stack trace, the HTTP status code when the failure is API-related, and the name of the specific node where execution stopped. In a real production failure, this data is more detailed than the mock event returned by 'Fetch test event.'
### How does the Stop and Error node differ from the Error Trigger node in n8n?
The Stop and Error node is an action node you place inside any workflow to intentionally halt execution and raise an error when a validation or conditional check fails. It lets you define a custom error message or object. The Error Trigger node is a trigger node that sits at the start of your dedicated error workflow and listens passively for failures in other workflows. The Stop and Error node creates the error; the Error Trigger node detects and responds to it.
### Why does the Error Trigger node not fire during manual test runs in n8n?
The Error Trigger node only responds to production executions, meaning the covered workflow must be switched to active before any failure in it will route to the error workflow. A manual test run inside the canvas editor does not count as a production execution, so errors raised during testing stay isolated and do not trigger the error handling workflow.
### How can you route error alerts to the specific owner of the failed workflow rather than a generic inbox?
Add a Google Sheets node immediately after the Error Trigger node and filter the sheet by workflow name, matching it against the name field in the error object. A sheet with columns for workflow name, owner name, owner email, and Slack user ID gives the downstream Slack and Gmail nodes everything they need to send a personalized direct message to the owner and a parallel alert to a shared team channel.
---
# [Free n8n] How to Install n8n on local machine using NPM Node.js
URL: https://www.genaiunplugged.com/courses/n8n/lessons/free-n8n-how-to-install-n8n-on-local-machine-using-npm-nodejs/
> Install n8n on your local machine using npm or npx, then run it locally on Node.js for free before deploying anywhere else.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
## How Do You Install n8n on Your Local Machine for Free?
You install n8n free on your own machine with npm, the Node.js package manager. n8n is open-source, so a local install runs with no execution limits and no monthly fee, unlike n8n Cloud. You need Node.js, version 18 or newer, installed first.
## How to Install n8n with npm and Node.js
Install Node.js from nodejs.org, then open a terminal and run `npm install n8n -g` to install n8n globally. Start it with `n8n start`, then open `http://localhost:5678` in your browser to load the editor. To update later, run `npm update -g n8n`. This local instance keeps all your workflows and credentials on your own machine.
## Key Takeaways
- Understanding the core concepts covered in this lesson
- Practical, hands-on experience you can apply immediately
- Tips from real-world n8n workflow implementations
## Related Lessons
- [Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting](/courses/n8n/lessons/how-to-set-up-n8n-cloud-in-2025-step-by-step/)
- [Lesson 6: How to Install n8n for free on local machine using Docker Desktop](/courses/n8n/lessons/how-to-install-n8n-for-free-on-local-machine-using-docker-desktop/)
- [Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings](/courses/n8n/lessons/n8n-interface-walkthrough-2025/)
- [Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions](/courses/n8n/lessons/n8n-node-types-explained/)
- [Lesson 9: Build Your First n8n Workflow - Send Welcome Emails Automatically](/courses/n8n/lessons/build-your-first-n8n-workflow-send-welcome-emails-automatically/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What will I learn in this lesson?
You install n8n free by running `npm install n8n -g` after installing Node.js 18 or newer, then starting it with `n8n start` and opening http://localhost:5678. This self-hosted local instance has no execution limits, unlike n8n Cloud.
### Do I need to watch the previous lessons first?
This lesson builds on earlier concepts. If you are new to n8n, start with Lesson 1 for the best learning experience.
### Can I get help if I get stuck?
Join the GenAI Unplugged community on Substack where Dheeraj answers questions and shares additional tips.
---
# Automate File Management with n8n: Master Binary Data Handling
URL: https://www.genaiunplugged.com/courses/n8n/lessons/automate-file-management-with-n8n-master-binary-data-handling/
> Handle n8n binary data end to end: automate file uploads, use binaryPropertyName and prepareBinaryData in your workflows.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 3. Deep Dive Concepts.
Watch the video above for the full tutorial, or read the written guide below.
## How Does n8n Handle Files and Binary Data?
n8n stores files as binary data in a separate binary property on each item, kept apart from the item's JSON. This lets workflows download, read, transform, and upload files like CSVs, PDFs, images, and spreadsheets while still passing structured JSON alongside them.
## How to Work With Files in n8n
Use Read/Write Files from Disk to load or save local files, and the HTTP Request node to download or upload them over the web. Convert between formats with Extract From File, which reads a CSV, PDF, or spreadsheet into JSON, and Convert To File, which builds a file from JSON to send onward. Always reference a file by its binary property name so the next node can find it.
## Key Takeaways
- Understanding the core concepts covered in this lesson
- Practical, hands-on experience you can apply immediately
- Tips from real-world n8n workflow implementations
## Related Lessons
- [Lesson 11: How Branching works in n8n Workflows | Smart Automations with Multiple Paths](/courses/n8n/lessons/how-branching-works-in-n8n-workflows/)
- [Lesson 12: How to Use Merge Node in n8n | Combine Data Like a Pro](/courses/n8n/lessons/how-to-use-merge-node-in-n8n/)
- [Lesson 13: How to Use Set Node in n8n | Edit Fields Node | Add, Edit, Clean Data](/courses/n8n/lessons/how-to-use-set-node-in-n8n/)
- [Lesson 14: How to Use Aggregate Node in n8n | Combine & Summarize Data](/courses/n8n/lessons/how-to-use-aggregate-node-in-n8n/)
- [Lesson 15: How to Use Remove Duplicates Node in n8n | Clean Your Data Fast](/courses/n8n/lessons/how-to-use-remove-duplicates-node-in-n8n/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What will I learn in this lesson?
n8n stores files as binary data in a separate binary property on each item, apart from the JSON. You will learn to read, write, download, and convert files using nodes like Read/Write Files, Extract From File, and Convert To File.
### Do I need to watch the previous lessons first?
This lesson builds on earlier concepts. If you are new to n8n, start with Lesson 1 for the best learning experience.
### Can I get help if I get stuck?
Join the GenAI Unplugged community on Substack where Dheeraj answers questions and shares additional tips.
---
# AI Powered Email Assistant: Automate Your Inbox with n8n & OpenAI
URL: https://www.genaiunplugged.com/courses/n8n/lessons/ai-powered-email-assistant-automate-your-inbox-with-n8n-openai/
> Build an AI-powered email assistant in n8n that reads incoming messages, drafts replies with OpenAI, and organizes your inbox automatically.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 6. AI-Powered Workflows.
Watch the video above for the full tutorial, or read the written guide below.
## What is an AI-powered email assistant in n8n?
The AI-powered email assistant workflow in n8n reads your Gmail inbox on a schedule, uses OpenAI's gpt-4o-mini to summarize each unread email and decide whether a reply is needed, then drafts a polite HTML reply when one is required. It saves that reply as a Gmail draft, sends a Telegram notification with Approve and Decline buttons, and dispatches the email automatically only after you tap Approve, with no code written.
## How to build an AI-powered email assistant in n8n
The Schedule Trigger node fires at 8 AM daily (hour set to 8, minute set to 0). Add a Manual Trigger alongside it for test runs. A Gmail "Get Many Messages" node fetches unread inbox messages with the Simplify toggle disabled, because leaving Simplify on returns only a short snippet rather than the full email body, thread ID, and sender address the downstream nodes need. Set the limit to 1 during development so you can step through emails one at a time, and filter by label "inbox" and read status "unread."
The OpenAI node targets gpt-4o-mini and takes two messages. The System message tells the model it is a helpful email assistant and instructs it to always draft replies in HTML format. The User message provides the email body and asks for a JSON response with three fields: `summary` (one sentence), `reply_needed` (the string "yes" or "no"), and `suggested_reply` (an HTML draft). Enabling "Output Content as JSON" in the OpenAI node strips surrounding prose automatically. An IF node then checks whether `reply_needed` equals "yes" (with the ignore-case option enabled to handle any capitalization the model returns) and routes only matching emails forward.
The Gmail "Create Draft" node sets the email type to HTML, populates the body from `suggested_reply`, prefixes the subject with "Re:", and passes the original message's Thread ID via the "Add Option" menu to attach the draft to the correct conversation thread. The To address comes from the `from` field of the fetched email. The Telegram node then sends the summary and draft to your personal bot chat with "Send and Wait for Response" enabled, response type set to Approval, and the "Approve and Disapprove" option selected, which renders two buttons in the app and pauses the workflow. When you tap Approve, the webhook returns `approved: true`. A Gmail "Get Draft" node retrieves the saved draft by its ID, and an HTTP POST node calls `https://gmail.googleapis.com/gmail/v1/users/me/drafts/send` with the draft ID in the body and your Gmail OAuth2 credential for authentication, dispatching the reply and clearing the draft from your inbox.
## Key Takeaways
- The Schedule Trigger node runs at 8 AM daily; swap it for a Gmail "On Email Arrival" trigger once the workflow is tested to process emails in real time rather than in a morning batch.
- The Gmail "Get Many Messages" node requires Simplify to be disabled; the default Simplify-on mode returns only a snippet and omits the thread ID and full body the workflow depends on.
- The OpenAI System prompt enforces HTML reply format, and the User prompt specifies the exact three-field JSON schema (`summary`, `reply_needed`, `suggested_reply`) so n8n parses the response without extra cleanup.
- Thread ID from the fetched email must be passed to the Gmail "Create Draft" node via "Add Option" to tie the AI reply to the original conversation thread.
- n8n has no native "Send Draft" operation on the Gmail node, so an HTTP POST to `https://gmail.googleapis.com/gmail/v1/users/me/drafts/send` with the draft ID and Gmail OAuth2 credential is the correct workaround.
## Related Lessons
- [Lesson 36: AI Automation with n8n: Supercharge Your Workflows with OpenAI](/courses/n8n/lessons/ai-automation-with-n8n-supercharge-your-workflows-with-openai/)
- [Lesson 38: AI Blog Writer](/courses/n8n/lessons/ai-blog-writer/)
- [Lesson 39: AI Resume Screening](/courses/n8n/lessons/ai-resume-screening/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why does the Gmail 'Get Many Messages' node return only a short preview by default?
The Gmail node's Simplify toggle is on by default, which trims the response to a snippet. Disabling Simplify returns the full email body, thread ID, sender address, and all headers that the OpenAI summarization node and the Gmail 'Create Draft' node all require to function correctly.
### What exact JSON schema does the OpenAI node return for each email in this workflow?
The gpt-4o-mini model returns a three-field JSON object: `summary` (a one-sentence description of the email), `reply_needed` (the string "yes" or "no"), and `suggested_reply` (a full HTML-formatted draft reply). Enabling 'Output Content as JSON' in the OpenAI node removes any surrounding prose so n8n can parse the fields directly.
### How does the Telegram 'Send and Wait for Response' feature pause and resume the workflow?
The Telegram node sends the email summary and suggested reply to your personal bot chat, then halts workflow execution and listens on a webhook. Choosing the Approval response type with 'Approve and Disapprove' renders two in-app buttons. Tapping Approve sends a webhook payload where `approved` equals true, which resumes the workflow and triggers the draft-send steps.
### Why is an HTTP node used to send the Gmail draft instead of a Gmail node?
The n8n Gmail node has no native 'Send Draft' operation. The correct workaround is an HTTP POST node that calls `https://gmail.googleapis.com/gmail/v1/users/me/drafts/send` with the draft ID in the request body and the Gmail OAuth2 credential set under predefined credentials, which dispatches the reply and removes the draft from the inbox.
---
# AI Blog Writer
URL: https://www.genaiunplugged.com/courses/n8n/lessons/ai-blog-writer/
> Build an n8n workflow that generates full blog posts with AI, taking a topic from research through outline to a finished, publish-ready draft.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 6. AI-Powered Workflows.
Watch the video above for the full tutorial, or read the written guide below.
## What is the AI Blog Writer workflow in n8n?
The AI Blog Writer workflow in n8n connects a Google Sheet of content topics to OpenAI, producing an SEO-optimized blog post first, then using that post as input to generate Twitter, LinkedIn, Facebook, and YouTube script content. A status column in the source sheet tracks which topics are pending, and a separate AI Prompts sheet holds all platform-specific system and user prompts, keeping the workflow dynamic without hardcoded text.
## How to build the AI Blog Writer workflow in n8n
The Google Sheets trigger fires on row added and runs every hour, preventing the workflow from publishing too fast. A second Google Sheets node fetches only the first row where the status column equals "pending," returning one topic at a time with its audience, tone, word count, domain/niche, and status fields. A manual trigger node pairs with this fetch step so you can test without waiting for a new sheet row.
The AI Prompts sheet stores five rows, one per platform: WordPress, Twitter, LinkedIn, Facebook, and YouTube. Each row holds a system prompt and a user prompt with double-curly-brace placeholders such as `{{topic}}`, `{{word_count}}`, `{{tone}}`, and `{{domain_niche}}`. A code node, generated by n8n's built-in Ask AI tab from a plain-English instruction, loops over all five prompt rows and replaces every placeholder with the matching value from the fetched topic row. Adding a new platform like TikTok only requires a new row in the AI Prompts sheet, not a new node in the canvas.
An IF node checks whether the content platform equals "WordPress" and routes that branch to an OpenAI node configured with the dynamic system and user prompts. The model returns a full HTML blog post wrapped in triple-backtick fences, so a Set Fields node strips those fences with a `replaceAll` expression before passing clean HTML to the WordPress node, which saves the post as a draft. The false branch from the IF node handles all social platforms, where each prompt receives the completed blog post as input rather than the raw topic title, keeping blog and social content consistent.
## Key Takeaways
- The AI Prompts Google Sheet stores system and user prompts for all five platforms (WordPress, Twitter, LinkedIn, Facebook, YouTube), making the workflow extensible without adding or rewiring nodes.
- Double-curly-brace placeholders like `{{topic}}` and `{{word_count}}` in prompt text get replaced at runtime by a code node generated via n8n's Ask AI tab from a plain-English description, so no manual coding is required.
- The IF node branches on content platform equals "WordPress" so the blog post is generated first; every social media prompt then uses that completed blog post as its input, not the original topic title.
- The WordPress node saves posts in draft mode, giving you an editing checkpoint before anything goes live, because AI output needs human review for hallucinations and tone mismatches before publishing.
- The status column in the topics sheet controls which rows the workflow processes, letting you queue content for multiple blogs or niches in a single sheet by adding columns like blog name.
## Related Lessons
- [Lesson 36: AI Automation with n8n: Supercharge Your Workflows with OpenAI](/courses/n8n/lessons/ai-automation-with-n8n-supercharge-your-workflows-with-openai/)
- [Lesson 37: AI Powered Email Assistant: Automate Your Inbox with n8n & OpenAI](/courses/n8n/lessons/ai-powered-email-assistant-automate-your-inbox-with-n8n-openai/)
- [Lesson 39: AI Resume Screening](/courses/n8n/lessons/ai-resume-screening/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### Why does the n8n AI Blog Writer store prompts in Google Sheets instead of hardcoding them in nodes?
The AI Prompts sheet decouples prompt logic from workflow structure. Each platform gets its own row with a system prompt and user prompt, so adding TikTok, for example, means adding one row to the sheet. The code node loops over all rows automatically, and the canvas needs no new nodes or rewiring.
### What does the code node in the AI Blog Writer workflow actually do?
The code node replaces double-curly-brace placeholders in both the system prompt and user prompt with real values from the fetched topic row. For example, `{{topic}}` becomes "Top 5 AI Tools for Solopreneurs" and `{{word_count}}` becomes 1200. n8n's Ask AI tab inside the code node generates this replacement logic from a plain-English instruction, so you don't write any code manually.
### Why does the IF node branch on WordPress before generating social media posts?
The IF node ensures the full blog post exists before any social content is created. Twitter, LinkedIn, Facebook, and YouTube prompts all receive the completed blog post as their input, not just the topic title. This keeps blog and social content connected and avoids the disconnected feel that comes from generating both independently from the same raw topic.
### How does the workflow clean up the OpenAI blog post output before sending it to WordPress?
The OpenAI node wraps its HTML output in triple-backtick fences with an 'html' label. A Set Fields node uses a `replaceAll` expression to strip both the opening fence and the closing fence, leaving pure HTML. The WordPress node then receives that clean HTML and saves it as a draft post ready for manual review.
---
# AI Resume Screening
URL: https://www.genaiunplugged.com/courses/n8n/lessons/ai-resume-screening/
> Build an n8n workflow that screens resumes with AI, with a full video walkthrough and code examples from the n8n Zero to Hero course.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 6. AI-Powered Workflows.
Watch the video above for the full tutorial, or read the written guide below.
## What is the AI Resume Screening workflow in n8n?
The AI Resume Screening workflow in n8n automates the end-to-end recruiter cycle: an n8n Form collects applicant details and a PDF resume, a parallel branch uploads the file to Google Drive while the main branch parses it with the Extract from File node, then two Information Extractor AI nodes pull structured personal and professional data from the raw text. A scoring step routes each candidate to a shortlist, a maybe sheet, or an archive.
## How to build the AI Resume Screening workflow in n8n
The n8n Form node acts as the job application trigger. Add text fields for first name and last name, an email-type field, and a file upload field restricted to `.pdf`. Add a hidden field named "job code" with a static value such as `001` to tag which role the submission belongs to. The hidden field is invisible to applicants but flows into the workflow output, letting one workflow handle multiple job postings without duplication. Copy the form's production URL and embed it in your job posting so candidates apply directly through it.
The Form node feeds two parallel branches simultaneously: a Google Drive Upload node that saves the resume to a designated "resumes" folder, and an Extract from File node that converts the binary PDF into a plain-text JSON field named `text`. In the Google Drive node, build the file name dynamically by concatenating the job code, first name, and last name from the form output. In the Extract from File node, set the operation to "Extract from PDF" and point the input binary field at the resume upload field. Both branches run in parallel so file storage never delays evaluation.
Two Information Extractor cluster nodes transform the unstructured `text` field into structured JSON. The first node uses a JSON schema to extract personal information: full name, telephone, city, email, and LinkedIn URL, each with a plain-English description property. The second node uses the "from attribute descriptions" schema type to extract professional information: educational qualification, job history, skills, experience breakdown by role, most recent job title, and total years of experience, each attribute carrying a format instruction such as "summarize in 100 words" or "make a bulleted list." Attach one OpenAI Chat Model sub-node (GPT-4o mini) and share it across both cluster nodes. Add a system prompt to each node instructing the model to return "NA" for any attribute it cannot locate in the text.
## Key Takeaways
- The n8n Form node's hidden field carries a job code (for example, `001`) that is invisible to applicants and lets one workflow distinguish between multiple open roles without duplicating downstream nodes.
- The Extract from File node converts an uploaded PDF resume to a plain-text `text` field in one step, requiring no external API call or third-party parser.
- The Information Extractor node is an advanced AI cluster node that requires an attached language model and supports three schema modes: attribute descriptions (UI-driven, no JSON required), a JSON example, or a raw JSON schema with typed properties and descriptions.
- Splitting extraction into a personal-info node and a professional-info node feeds the LLM smaller, focused prompts per call and produces more accurate structured output than one large combined prompt.
- One OpenAI Chat Model sub-node attaches to multiple Information Extractor cluster nodes in the same workflow, avoiding credential duplication and keeping model configuration in a single place.
## Related Lessons
- [Lesson 36: AI Automation with n8n: Supercharge Your Workflows with OpenAI](/courses/n8n/lessons/ai-automation-with-n8n-supercharge-your-workflows-with-openai/)
- [Lesson 37: AI Powered Email Assistant: Automate Your Inbox with n8n & OpenAI](/courses/n8n/lessons/ai-powered-email-assistant-automate-your-inbox-with-n8n-openai/)
- [Lesson 38: AI Blog Writer](/courses/n8n/lessons/ai-blog-writer/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What does the Extract from File node return when processing a PDF resume in n8n?
The Extract from File node returns a JSON object containing a `text` property that holds the entire PDF content as a single unstructured string. All resume pages merge into one text blob. Downstream Information Extractor nodes then parse this raw text into typed fields using a schema defined directly in the node configuration.
### What is the difference between the Information Extractor node and a standard OpenAI node in n8n?
The Information Extractor node is a cluster node that enforces structured JSON output by accepting a schema with typed properties and plain-English descriptions for each field. A standard OpenAI node takes a free-form prompt and returns narrative text. The Information Extractor guarantees field-level output and lets one attached OpenAI Chat Model sub-node be shared across multiple instances in the same workflow.
### Why does the AI Resume Screening workflow use two Information Extractor nodes instead of one?
Two Information Extractor nodes keep personal data (name, phone, email, LinkedIn) and professional data (job history, skills, experience, education) in separate, focused prompts. Smaller scoped prompts give the LLM a clearer extraction target per call and produce more accurate structured output than a single large prompt attempting to cover every resume field at once.
### How does the scoring and routing logic work in the AI Resume Screening workflow?
The workflow assigns a numeric AI score to each resume and routes candidates through an IF node: a score above 7 shortlists the candidate, a score between 5 and 7 places the application in a maybe category, and a score below 5 archives it. Every submission, regardless of score, logs all extracted fields to a Google Sheets job applicants tracker that captures final score, AI status, AI assessment, skills, job history, and contact details.
---
# AI Automation with n8n: Supercharge Your Workflows with OpenAI
URL: https://www.genaiunplugged.com/courses/n8n/lessons/ai-automation-with-n8n-supercharge-your-workflows-with-openai/
> Connect OpenAI to n8n workflows to automate content creation, data processing, and decisions with step by step examples.
## Overview
This lesson is part of the **n8n AI Automation - Zero to Hero** course, Section: 6. AI-Powered Workflows.
Watch the video above for the full tutorial, or read the written guide below.
## What is AI-powered automation in n8n?
AI-powered automation in n8n extends rule-based workflows by adding reasoning, decision-making, and content generation. Traditional workflows move data and fire actions on fixed rules, like sending an email when a CRM lead appears. AI-powered workflows go further: they read incoming emails, classify them, predict whether a reply is needed, generate a draft response, and save it to drafts, all without a human in the loop.
## How do you integrate OpenAI into an n8n workflow?
The OpenAI node in n8n provides built-in connectivity to the OpenAI platform without requiring the HTTP node. To connect it, generate an API key at platform.openai.com under API Keys, add credits to your account (the instructor adds $5 to start), then paste the key into the n8n OpenAI node's credential screen. n8n tests the connection immediately and stores the credential in your personal workspace, keeping it private from other users on the same cloud instance.
The Message a Model action inside the OpenAI node sends a prompt to any available GPT model and returns a text response. The role selector lets you choose between a "user" message for your actual question and a "system" message that sets the model's behavior or persona before the user prompt arrives. For example, you can instruct the model to behave as a customer service agent before asking it to draft a reply. The instructor recommends GPT-4o mini as the default for most n8n AI tasks because it is faster and more affordable, reserving GPT-4.1 or GPT-4o only for large data volumes or complex reasoning chains.
In the lesson demo, a single user-role prompt, "Generate a friendly email message response to this message: I need help with my order that I placed 10 days ago," produced a complete customer-service reply with subject line, body, and a request for the order number, formatted with newline characters ready for an HTML email node downstream. The model recognized that no order details were provided and asked for them, demonstrating active reasoning rather than a fixed rule.
## Key Takeaways
- The n8n OpenAI node covers text, image, audio, file, and assistant actions in one place, removing the need for a custom HTTP request to reach OpenAI APIs.
- GPT-4o mini is the recommended default model: fast, affordable, and sufficient for most reasoning and generation tasks in n8n workflows.
- OpenAI API credentials are scoped to your personal n8n workspace and are not visible to other users on the same cloud instance.
- The "system" role prompt shapes model behavior across the entire workflow by setting a persona or domain expertise, such as a customer service agent, before the actual user query arrives.
- AI-powered n8n workflows differ from traditional ones because they reason, generate content, and make decisions rather than following a fixed sequence of rules.
## Related Lessons
- [Lesson 37: AI Powered Email Assistant: Automate Your Inbox with n8n & OpenAI](/courses/n8n/lessons/ai-powered-email-assistant-automate-your-inbox-with-n8n-openai/)
- [Lesson 38: AI Blog Writer](/courses/n8n/lessons/ai-blog-writer/)
- [Lesson 39: AI Resume Screening](/courses/n8n/lessons/ai-resume-screening/)
## Next Steps
Continue your n8n journey with the full [n8n AI Automation - Zero to Hero](/courses/n8n/) course.
## Frequently Asked Questions
### What is the difference between traditional and AI-powered automation in n8n?
Traditional n8n automation follows predefined rules to move data and trigger actions, for example sending an email when a CRM lead is created. AI-powered automation adds reasoning and content generation: the workflow reads emails, classifies them, decides whether a reply is needed, drafts that reply, and saves it, all without a human in the loop.
### Which OpenAI model does the course recommend for n8n AI workflows?
GPT-4o mini is the recommended default for n8n AI automation because it is faster and more affordable than GPT-4.1 or GPT-4o. The instructor reserves the larger models only for tasks that involve large volumes of data or complex multi-step reasoning.
### How do you create OpenAI credentials in the n8n OpenAI node?
The OpenAI node in n8n requires a single API key, generated at platform.openai.com after creating an account and adding credits. Paste the key into the "Create new credential" screen inside the node and n8n tests the connection immediately. The credential is stored in your personal workspace and is not shared with other users.
### What actions does the n8n OpenAI node support beyond basic text generation?
The OpenAI node in n8n supports creating, listing, updating, and messaging assistants; messaging a model directly; classifying text for policy violations; analyzing and generating images; generating audio; transcribing and translating recordings; and managing files, all without writing a custom HTTP request.
---
# What is MCP - Model Context Protocol?
URL: https://www.genaiunplugged.com/courses/mcp/lessons/what-is-mcp-model-context-protocol/
> Introduction to MCP fundamentals and architecture
MCP (Model Context Protocol) is an open standard, created by Anthropic and released in November 2024, that lets AI applications such as Claude Desktop and Cursor connect to external tools, files, and data sources through one shared interface instead of custom code for each connection. It works through a Host, Client, and Server.
## What you will be able to do
- Explain what MCP is and why it replaces custom, one-off integrations between AI apps and tools.
- Describe what the Host, Client, and Server each do when an AI model requests a tool.
- Identify MCP's three building blocks: tools (actions), resources (data), and prompts (templates).
- Tell someone how MCP differs from a regular API when they ask.
- Work out why MCP changes integration effort from M x N connections to M + N.
## Before you start
- No coding background required, MCP is meant for anyone who wants AI connected to other services, not just developers.
- Access to an MCP-capable AI application, such as Claude Desktop or Cursor, since many already support MCP out of the box.
- Basic familiarity with how you currently interact with an AI assistant, such as a chat window, IDE, or voice app.
## Reference
| Piece | Category | What it does | Example from the article |
|---|---|---|---|
| Host | Architecture | Where you interact with the AI model | Chat window, IDE like Cursor, voice app |
| Client | Architecture | Translator inside the Host that converts the model's request into MCP language and talks to the Server | Turns "I need to check the weather" into an MCP request |
| Server | Architecture | Toolbox holding the real tools, waits for any MCP-speaking app to ask for them | One server holding get_weather, get_forecast, get_air_quality |
| Tools | Primitive | Actions that perform or change something | Download a file, run code, send an email |
| Resources | Primitive | Data the AI model can read but not modify | Company handbook, spreadsheet, weather data |
| Prompts | Primitive | Instruction sets or templates that help start a task | A "Code Review Mode" prompt that reminds the model what to check |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Worrying the AI model could run a dangerous command through MCP | Good MCP applications ask your permission first before running anything risky, you stay in control of execution |
| Assuming MCP is just another name for an API | An API is one specific connection between two systems, MCP is a shared protocol so you build one MCP connection instead of a separate API integration per tool |
| Assuming MCP is only for developers | MCP is for anyone who wants AI to connect with other services, many AI applications already support pre-built MCP servers with no code required |
| Not knowing where the actual tools live | Tools live on MCP Servers, which can run on your own machine or be hosted online |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 1 on Substack →
## More in this section
- [Lesson 2: Why MCP Was Created?](/courses/mcp/lessons/why-mcp-was-created/)
- [Lesson 3: How MCP Actually Works: Hosts, Clients, and Servers](/courses/mcp/lessons/how-mcp-actually-works-hosts-clients-and-servers/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# Why MCP Was Created?
URL: https://www.genaiunplugged.com/courses/mcp/lessons/why-mcp-was-created/
> Problem MCP solves and its creation story
Model Context Protocol (MCP) is an open standard Anthropic released in November 2024 that lets AI applications and tools communicate through one shared language instead of custom, one-off connectors. It solves the M times N integration problem: with 5 AI apps and 10 tools, 50 custom integrations drop to 15 shared connections.
## What you will be able to do
- Explain the M times N integration problem and why it made connecting AI apps to tools expensive before MCP existed.
- Calculate how many custom integrations a given number of AI apps and tools requires, with and without MCP.
- Identify who built MCP, when Anthropic released it, and which existing protocol (LSP) it was modeled on.
- List the four specific ways integrations broke before MCP: too many signals to learn, breakage on updates, vendor lock-in, and missing safety checks.
- Describe how MCP's client and server model turns adding a new AI app or tool into a single new connection instead of a full new set of connections.
## Before you start
- Have read or skimmed Lesson 1, "What Is MCP? Model Context Protocol Explained Simply," since this lesson builds on that definition.
- Understand at a basic level that AI applications connect to external tools or data sources (files, APIs, calculators) to do useful work.
- No coding or setup required for this lesson; it is conceptual and prepares you for Lesson 3 on MCP architecture (hosts, clients, servers).
## Reference
| AI apps (M) | Tools (N) | Custom integrations without MCP (M x N) | Connections with MCP (M + N) |
|---|---|---|---|
| 3 | 3 | 9 | 6 |
| 3 | 4 | 12 | 7 |
| 4 | 4 | 16 | 8 |
| 5 | 10 | 50 | 15 |
| Key fact | Detail |
|---|---|
| Created by | Anthropic engineers including David Soria Parra and Justin Spahr-Summers |
| Inspired by | Language Server Protocol (LSP), which solved the same M x N problem for code editors and language analyzers |
| Internal development began | Mid-2024 |
| Released as open standard | November 25, 2024 |
| Community adoption | Over 1,400 public MCP servers built, growing faster than Zapier's integration catalog did in its first five years |
## Common errors and fixes
| Problem before MCP | What it caused | How MCP fixes it |
|---|---|---|
| Every tool used a different custom setup ("signal") | Developers had to learn and build a new connection for every app-tool pair | One shared protocol that every AI app and tool speaks |
| A tool's API or interface changed | Every AI app connected to that tool broke and needed a manual fix | Change the connection once; it syncs everywhere through the standard |
| Vendors built proprietary, locked-in connectors | Switching AI providers meant rebuilding all integrations from scratch | An open standard that any AI app or tool can join |
| Tools could run actions with no guardrails | Developers spent time building safety checks instead of improving AI systems | Tools must declare what they can do; nothing runs without approval |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 2 on Substack →
## More in this section
- [Lesson 1: What is MCP - Model Context Protocol?](/courses/mcp/lessons/what-is-mcp-model-context-protocol/)
- [Lesson 3: How MCP Actually Works: Hosts, Clients, and Servers](/courses/mcp/lessons/how-mcp-actually-works-hosts-clients-and-servers/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# Multi-Agent AI Collaboration Tutorial
URL: https://www.genaiunplugged.com/courses/mcp/lessons/multi-agent-ai-collaboration-tutorial/
> MCP Full Course Lesson 6 - Multi-agent collaboration patterns
Multi-Agent AI Collaboration with MCP is a lesson in the GenAI Unplugged MCP Masterclass that shows how to run two Claude Desktop conversations, a Researcher agent and a Writer agent, connected to the same MCP server so one saves research findings and the other reads them to write a polished draft.
## What you will be able to do
- Build an MCP server named collaboration-hub with three tools: save_research, read_research, and save_draft
- Run two separate Claude Desktop conversations as a Researcher agent and a Writer agent that share work through one MCP server
- Decide when a task calls for a single agent versus multiple specialized agents, using the decision framework from the lesson
- Update your Claude Desktop config to add a new MCP server alongside an existing one, using your Python path and server.py path
- Verify your MCP SDK installation with check_setup.py before writing the server code
## Before you start
- Completed the previous lesson's MCP server build, or have run pip install mcp to get the SDK
- Python 3 installed, with the ability to create and activate a virtual environment
- Claude Desktop installed and signed in (from claude.ai/download), used as the MCP host
- A code editor such as VS Code, Cursor, or PyCharm
## Reference
| Step / Tool | Purpose | Details |
|---|---|---|
| check_setup.py | Verify MCP SDK install | Imports mcp.server.Server, stdio_server, Tool, TextContent; run with python check_setup.py |
| pip install mcp | Install the MCP SDK | Skip this step if you already installed it in the previous lesson |
| save_research tool | Save research findings | Writes content to research_findings.txt and confirms it saved |
| read_research tool | Read saved research | Reads research_findings.txt; reports an error if the file does not exist yet |
| save_draft tool | Save the final document | Writes content to final_draft.txt and confirms it saved |
| server.py | Defines the MCP server | Server named collaboration-hub; registers the three tools via handle_list_tools and handle_call_tool |
| Claude Desktop config | Connect Claude to the new server | Settings, Developer tab, Edit Config; add collaboration-hub alongside the existing note-reader server using your Python path and server.py path |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| MCP SDK import fails when running check_setup.py | The script prints the ImportError and tells you to run pip install mcp |
| read_research is called before any research has been saved | The tool returns: No research findings found. The Researcher agent needs to save research first using the save_research tool |
| save_research or save_draft is called with no content | The handler returns: Error: No content provided to save |
| A file read or write fails for another reason | The handler catches the exception and returns a message like Error saving research: (the exception text), or Error reading research: (the exception text) |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 6 on Substack →
## More in this section
- [Lesson 4: The Three Superpowers of MCP - Tools, Resources, and Prompts](/courses/mcp/lessons/the-three-superpowers-of-mcp-tools-resources-and-prompts/)
- [Lesson 5: Build an MCP Server in 30 Minutes](/courses/mcp/lessons/build-an-mcp-server-in-30-minutes/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# The Three Superpowers of MCP - Tools, Resources, and Prompts
URL: https://www.genaiunplugged.com/courses/mcp/lessons/the-three-superpowers-of-mcp-tools-resources-and-prompts/
> See how MCP tools, resources, and prompts differ, what each is for, and how to use all three when building an MCP server.
MCP servers expose three primitives: tools, resources, and prompts. Tools are actions the AI model decides to invoke, such as send_email or fetch_sales_data, and they require user permission. Resources are read-only data the application supplies, like documents or database results. Prompts are reusable instruction templates the user activates to shape AI behavior.
## What you will be able to do
- Identify whether a task needs a tool, a resource, or a prompt using the model-controlled, application-controlled, and user-controlled distinction.
- Decide when a workflow step needs explicit user permission (tools) versus when it can run automatically (resources).
- Read a tool's JSON Schema definition to see what parameters it accepts, which are required, and what types they expect.
- Design a multi-step workflow that chains a resource fetch, a prompt template, and a tool call into one flow.
- Explain to a teammate why an MCP prompt behaves differently from a hardcoded system prompt.
## Before you start
- Understanding of the MCP Host, Client, Server architecture covered in the previous lesson.
- Basic familiarity with JSON Schema concepts such as parameters, required fields, and types.
- An MCP-compatible AI application to test tools, resources, and prompts against once you build a server.
## Reference
| Primitive | Who controls it | Can modify data | Permission required | Example | Use it when |
|---|---|---|---|---|---|
| Tool | The AI model decides when to invoke it | Yes | Yes, the host asks the user before running it | send_email(), fetch_sales_data(), create_meeting() | The task has a real-world side effect or needs real-time data |
| Resource | The application or user selects it | No, strictly read-only | Generally not, safe to access automatically | Policy documents, database query results, file contents | The AI needs context or background information to answer accurately |
| Prompt | The user activates it by choosing a mode | No, guides behavior only | No | "Code Review Mode", "Summarization Template" | You want consistent AI behavior repeated across sessions |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| You try to have the AI modify data through a Resource | Resources are read-only by design and cannot make changes. Use a Tool for any action that writes, sends, or deletes something |
| A Tool runs without any confirmation step | Since tools can send emails, delete files, or post to social media, the host should always ask "Allow it?" before running one, keeping the user in control |
| MCP prompts get treated the same as hardcoded system prompts | System prompts are baked into the application, so changing them means updating the app. MCP prompts live on the server, so updating one instantly benefits every connected AI application |
| A tool is defined without a clear JSON Schema | Without a schema describing the inputs, required fields, and types, the AI model has no reliable way to know how to call the tool correctly |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 4 on Substack →
## More in this section
- [Lesson 5: Build an MCP Server in 30 Minutes](/courses/mcp/lessons/build-an-mcp-server-in-30-minutes/)
- [Lesson 6: Multi-Agent AI Collaboration Tutorial](/courses/mcp/lessons/multi-agent-ai-collaboration-tutorial/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# Give Your AI Agents Memory
URL: https://www.genaiunplugged.com/courses/mcp/lessons/give-your-ai-agents-memory/
> MCP Full Course Lesson 7 - MCP shared memory for agents
This lesson covers adding persistent memory to MCP-based AI agents using three tools, save_memory, read_memory, and search_memory, backed by a shared JSON file. It lets a Researcher and Writer agent pair store insights, recall past learnings, and build on previous work across sessions instead of starting from zero each time.
## What you will be able to do
- Build three MCP memory tools: save_memory, read_memory, and search_memory
- Set up a shared JSON file (shared_memory.json) that stores timestamped memory entries both agents can read and append to
- Have agents check memory before starting a task and save new learnings after finishing it
- Share memory across multiple agents so a Researcher and a Writer learn from each other's notes
- Explain the difference between a context window and persistent memory when designing agent systems
## Before you start
- A working multi-agent MCP system with a Researcher and Writer agent sharing an MCP server, built in the previous lesson
- Basic understanding of how MCP tools are defined and called by agents
- A place to store a shared file that both agents can read from and write to
## Reference
| Tool/Element | Input | Purpose | When to use |
|---|---|---|---|
| save_memory | Memory content (text describing what was learned) | Saves content to shared_memory.json with a timestamp | After completing a task, to store new insights |
| read_memory | None | Returns all saved memories | Before starting a new task, to check past learnings |
| search_memory | Search term (e.g. "writing style") | Returns memories matching that term | When an agent needs focused context on one topic instead of everything |
| shared_memory.json | N/A | Single file storing all memory entries; both agents read from and append to it | Acts as the shared filing cabinet for the whole agent team |
| Memory record | timestamp, agent, content | JSON structure of each saved entry | Written automatically every time save_memory is called |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Assuming a large context window means the AI remembers past sessions | The context window only covers the current conversation; build a separate memory layer for anything that needs to survive between sessions |
| Agents re-research topics and repeat past mistakes every session | Call read_memory before starting work so agents build on what was already learned |
| Agents finish a task without recording what they learned | Call save_memory after completing significant work so learnings compound over time |
| Reading the entire memory file overwhelms the agent with unrelated information | Use search_memory with a specific term to get focused results instead of reading everything |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 7 on Substack →
## More in this section
- [Lesson 8: Building AI Agents That Learn From Experience](/courses/mcp/lessons/building-ai-agents-that-learn-from-experience/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# How MCP Actually Works: Hosts, Clients, and Servers
URL: https://www.genaiunplugged.com/courses/mcp/lessons/how-mcp-actually-works-hosts-clients-and-servers/
> MCP architecture and component interaction
MCP (Model Context Protocol) architecture splits into three parts: the Host (the app you use, like Claude Desktop or Cursor), the Client (lives inside the Host, translates AI model requests into MCP protocol messages), and the Server (runs the actual tools and returns structured JSON results). This lesson explains how a single request flows through all three.
## What you will be able to do
- Trace a user request as it moves through Host, AI model, Client, and Server in an MCP-based application.
- Explain the difference between an MCP host, an MCP client, and an MCP server in plain terms.
- Identify which transport (STDIO or HTTP+SSE) fits a given MCP server setup, local versus remote.
- Distinguish MCP from a REST API when explaining the protocol to someone else.
- Recognize the JSON-RPC 2.0 message format underlying every MCP request and response.
## Before you start
- Have read the first two lessons in this course: what MCP is, and why it was created (the M x N integration problem).
- Be familiar with using a chat-based AI application such as Claude Desktop, ChatGPT, or Cursor.
- No coding required for this lesson, it is conceptual.
## Reference
| Component | Role | Lives where | Example |
|---|---|---|---|
| Host | Receives your message, sends it to the AI model, keeps conversation history, shows results, contains the Client | The application you interact with directly | Claude Desktop, Cursor, a voice interface |
| AI model | Reads the request and decides what tool or resource is needed | Inside the Host | Decides "I need the summarize_file tool" |
| Client | Translates the AI model's tool request into MCP protocol language, sends it to the right Server, passes the reply back | Inside the Host | Built-in MCP client, not something you interact with directly |
| Server | Runs the actual tool, resource, or prompt and returns structured data (usually JSON) | Local (on your computer) or remote (in the cloud) | Tools like get_weather, summarize_text, delete_email |
| STDIO transport | Local transport: Host launches the server as a child process, messages pass through stdin/stdout, no network needed | Local servers | File readers, code analyzers, local databases |
| HTTP + SSE transport | Remote transport: Client sends HTTP requests, Server streams responses back via Server-Sent Events | Remote servers | Remote APIs, shared team servers, cloud services |
| JSON-RPC 2.0 | Message format used by both transports: every request has a method name, parameters, and an ID; every response carries a result or an error | Both STDIO and HTTP+SSE | The standardized envelope for all MCP messages |
## Common errors and fixes
| What goes wrong (common mix-up) | The fix (what's actually true) |
|---|---|
| Assuming the Host runs the tools itself | The Host only manages the interface and conversation; the Server is what actually runs the tool |
| Confusing the Client with the AI model | The Client only translates requests into MCP protocol language and routes them; the AI model is the one that decides which tool is needed |
| Treating MCP like a single point-to-point REST API connection | MCP is a standardized protocol, not one connection: one MCP Client can talk to hundreds of different Servers using the same language |
| Expecting to interact with the Client or Server directly | You never talk to the Client or Server yourself, just like you never shout your order at the kitchen; the Host is the only thing you interact with |
| Assuming every MCP server uses the same transport | Local servers use STDIO (stdin/stdout, no network); remote servers use HTTP+SSE (works across networks); the choice depends on where the server runs |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 3 on Substack →
## More in this section
- [Lesson 1: What is MCP - Model Context Protocol?](/courses/mcp/lessons/what-is-mcp-model-context-protocol/)
- [Lesson 2: Why MCP Was Created?](/courses/mcp/lessons/why-mcp-was-created/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# Building AI Agents That Learn From Experience
URL: https://www.genaiunplugged.com/courses/mcp/lessons/building-ai-agents-that-learn-from-experience/
> MCP Full Course Lesson 8 - AI agent memory and learning systems
Continuous learning for MCP AI agents is the layer that turns stored memories into changed behavior: agents review structured outcome data, calculate success rates per approach, and update behavior rules automatically. It uses in-context learning through memory and reflection, not model retraining or fine-tuning, so any solopreneur can build self-improving agents today.
## What you will be able to do
- Store structured outcome data after each task with store_outcome (task type, approach, time taken, success rating, problems encountered)
- Run analyze_patterns on the last 10-20 tasks to compare success rates between different approaches
- Retrieve current behavioral recommendations with get_learning_insights before starting a new task
- Set explicit rules with update_behavior_rules so agents apply what they learned without manual reminders
- Share learning insights across multiple agents so a new agent inherits what the others already learned
## Before you start
- An MCP server with the memory system from the previous lesson already working (agents that can store and recall memories)
- One or more AI agents performing repeatable tasks, such as a Researcher, Writer, or Editor agent
- Basic familiarity with adding new tool calls to an MCP server
- A batch of completed tasks with varied approaches to generate data for pattern analysis (the lesson's experiment uses 5 to start)
## Reference
| Item | What it does | Example |
|---|---|---|
| store_outcome | Saves structured outcome data: task type, approach used, time taken, success rating, problems encountered | {"task_type": "research", "approach": "developer_blogs", "time_minutes": 15, "success_rating": 9, "problems": "none"} |
| analyze_patterns | Reviews the last 10-20 outcomes and compares success rates by approach | "developer_blogs approach has 90% success rate, academic_papers has 40% success rate" |
| get_learning_insights | Returns current behavioral recommendations based on the pattern analysis | "Based on 15 recent tasks, prioritize developer blogs for research" |
| update_behavior_rules | Stores explicit rules that guide future behavior | "For research tasks: start with developer blogs, use academic papers only for technical validation" |
| Success threshold | A task counts as a success in the calculation if its success_rating is 7 or higher | used inside the analyze_patterns success-rate math |
| Clear-winner threshold | One approach must beat another by more than 30 percentage points before the system recommends a change | if blog_success > paper_success + 0.3 |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Memories get stored but never analyzed, so the same mistakes repeat (like the runner whose knee keeps hurting despite a perfect training journal) | Add the analysis step: periodically review outcomes with analyze_patterns instead of only recording them |
| Outcome data gets saved as free text instead of structured fields | Use store_outcome to save structured fields (task type, approach, time taken, success rating, problems) so patterns can actually be compared |
| Periodic analysis gets skipped | Run analyze_patterns after every 5 to 10 tasks so performance does not plateau after initial setup |
| Each agent learns in isolation | Share insights across agents with get_learning_insights so a new agent, like an Editor, inherits what the Researcher and Writer already learned instead of starting from zero |
| Testing approaches without variation | When running the pattern-tracking experiment, vary the approach used (different source types, different search strategies) across tasks so there is enough contrast to detect a winner |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 8 on Substack →
## More in this section
- [Lesson 7: Give Your AI Agents Memory](/courses/mcp/lessons/give-your-ai-agents-memory/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# Build an MCP Server in 30 Minutes
URL: https://www.genaiunplugged.com/courses/mcp/lessons/build-an-mcp-server-in-30-minutes/
> Step-by-step tutorial on creating your first MCP server
Build an MCP Server in 30 Minutes is a lesson from the MCP Masterclass course that walks through building a Python MCP server with one tool, read_note, and connecting it to Claude Desktop so Claude can read local files. It uses the same server structure found in every MCP server, from simple file readers to database connectors.
## What you will be able to do
- Set up a Python virtual environment and install the official MCP SDK with pip install mcp.
- Write an MCP server in Python that defines a tool using @server.list_tools() and @server.call_tool().
- Configure Claude Desktop's claude_desktop_config.json with the correct Python and script paths so it can find your server.
- Verify a server connection in Claude Desktop's Search and tools menu before testing it.
- Ask Claude to call your custom tool inside a real conversation and see it read a local file.
## Before you start
- Python 3.8 or newer installed (check with python3 --version).
- A code editor such as VS Code, Cursor, or PyCharm.
- Claude Desktop installed and signed in with a free or paid Claude account.
- About 30 minutes and basic comfort copying code and running terminal commands.
## Reference
| Step | Command / Setting | Purpose |
|---|---|---|
| Create virtual env (macOS/Linux) | `python3 -m venv .venv` then `source .venv/bin/activate` | Isolates project dependencies |
| Create virtual env (Windows) | `py -m venv .venv` then `.venv\Scripts\activate` | Isolates project dependencies |
| Install SDK | `pip install mcp` | Installs the official Python MCP SDK |
| Verify install | `python check_setup.py` | Confirms the MCP imports load without error |
| Find Python path | `which python` (macOS/Linux) or `where python` (Windows) | Gets the path to put in the config `command` field |
| Open config | Claude Desktop > profile icon > Settings > Developer tab > Edit Config | Opens `claude_desktop_config.json` |
| Config keys | `command` (full path to venv python), `args` (full path to server.py) | Tells Claude Desktop how to launch your server |
| Confirm connection | Message box > bottom-right Search and tools icon | Shows `note-reader` and its `read_note` tool if connected |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| `pip` command not found | Reinstall Python from python.org and check "Add Python to PATH" during install |
| `check_setup.py` prints an ImportError | Run `pip install mcp` again while the virtual environment is active |
| Windows config path uses single backslashes | JSON needs double backslashes (`\\`) in Windows paths inside `claude_desktop_config.json` |
| `read_note` tool returns "File not found in the server directory" | Make sure the file sits directly in the project folder and the filename you send matches it exactly |
| Claude Desktop doesn't show the `note-reader` tool after editing the config | Completely quit and restart Claude Desktop, and confirm both the Python path and server.py path in the config are correct |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **MCP Masterclass: Connect AI to Everything**.
Read Lesson 5 on Substack →
## More in this section
- [Lesson 4: The Three Superpowers of MCP - Tools, Resources, and Prompts](/courses/mcp/lessons/the-three-superpowers-of-mcp-tools-resources-and-prompts/)
- [Lesson 6: Multi-Agent AI Collaboration Tutorial](/courses/mcp/lessons/multi-agent-ai-collaboration-tutorial/)
## Continue the course
Browse all lessons in the [MCP Masterclass: Connect AI to Everything](/courses/mcp/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/what-is-mcp-model-context-protocol) to get new lessons in your inbox.
---
# The AI Writing System That 3x'd My Content Output
URL: https://www.genaiunplugged.com/courses/claude-systems/lessons/the-ai-writing-system-that-3xd-my-content-output/
> 3x content production with consistent quality - Real content workflow implementation
This lesson sets up a Claude Projects system for content creation: a brand voice document built from your own writing samples, five copy-paste prompts for newsletters, LinkedIn posts, Twitter threads, blog outlines and email sequences, plus a 3-pass draft-and-polish workflow that cuts writing time from about 60 minutes to 20 minutes per piece.
## What you will be able to do
- Build a brand voice document in Claude Projects by uploading 3-5 samples of your best writing and running the extraction prompt.
- Generate an 800-1000 word newsletter draft, complete with three subject line options, from a rough topic and bullet points.
- Turn a newsletter excerpt into a 150-200 word LinkedIn post formatted with line breaks and an engagement question.
- Break a concept into a numbered Twitter thread with each tweet under 280 characters.
- Run the 3-pass process (brain dump, draft, polish) to take a piece from idea to finished copy in 15-20 minutes instead of 60.
## Before you start
- A Claude Projects account (claude.ai) with access to the Projects feature.
- 3-5 pieces of your existing writing (newsletter issues, LinkedIn posts, blog articles, or emails) saved as text files or Google Docs to upload.
- Comfort copying prompt templates and filling in the bracketed sections.
## Reference
| Template | Use when | Target length / count | Key requirement |
|---|---|---|---|
| Newsletter Draft Generator | Every time you write your weekly newsletter | 800-1000 words | Output includes 3 subject line options |
| LinkedIn Post Creator | Repurposing newsletter content or writing a standalone post | 150-200 words | Hook under 10 words, no emoji bullets, ends with an engagement question |
| Twitter Thread Builder | A concept needs step-by-step explanation or a story | 5-7, 8-10, or 12-15 tweets | Each tweet under 280 characters, numbered (1/7, 2/7, etc.) |
| Blog Post Outliner | Before writing any blog post over 1500 words | 1500, 2500, or 3500 words | Outline includes suggested word counts per section |
| Email Sequence Writer | Building welcome, launch, or re-engagement sequences | 3, 5, or 7 emails | 150-250 words per email, subject lines under 50 characters |
| Polish & Punch-up | Final pass after a draft is generated (Pass 3) | Aim to cut draft by 10% | Shows before/after for each changed section |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Draft sounds too formal or generic | Check that the brand voice document is saved in Project Knowledge, and add to the prompt: reference my brand voice more heavily, this sounds too corporate |
| Claude keeps forgetting details between chats | You're probably working in the main Claude chat instead of your Project chat. Switch to the Project so it can reference saved knowledge |
| Skipping the brand voice document setup step | Every piece comes out generic. Spend the 10 minutes upfront to upload writing samples and generate the voice guide before creating any content |
| Typing a one-line generic prompt like "write me a LinkedIn post about productivity" | Use the structured templates instead, which combine format requirements with a reference to the saved brand voice document |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Systems Masterclass**.
Read Lesson 3 on Substack →
## Continue the course
Browse all lessons in the [Claude Systems Masterclass](/courses/claude-systems/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/subscribe) to get new lessons in your inbox.
---
# My AI Research Assistant That Saves 5 Hours Per Client
URL: https://www.genaiunplugged.com/courses/claude-systems/lessons/my-ai-research-assistant-that-saves-5-hours-per-client/
> 5 hrs saved per client on research - Multi-document analysis and competitor intelligence
Client Research Assistant is a Claude Projects setup that lets a solo consultant upload competitor sites, industry reports, and client briefs once, then ask questions across all of them in one workspace. Custom instructions format every output the same way, cutting client research from about 5 hours to roughly 30 minutes.
## What you will be able to do
- Set up a Claude Project with custom instructions that format competitor analysis, market research, and dashboard outputs consistently.
- Upload competitor websites (saved as PDFs), industry reports, and client briefs so Claude can reference them across sessions without re-explaining context.
- Run three copy-paste prompts to generate a competitor positioning table, a market trends synthesis, and a client-ready HTML dashboard.
- Name research files with a consistent convention so Claude can cite exact sources by filename in its analysis.
- Fix common problems such as blank uploaded PDFs, generic outputs, and unstyled dashboard artifacts.
## Before you start
- A Claude Pro subscription ($20 per month) to use more than one Project; the free tier gets only one project.
- Research materials ready to gather: competitor websites, industry reports, and client briefs, in PDF, TXT, CSV, or DOCX format (under 30MB or 8000x8000 pixels for images, 200K token limit per project).
- Optional: the Claude Chrome Extension or the Project's Web Search Tool if you want Claude to pull competitor sites directly instead of manually saving pages as PDF.
## Reference
| Component | Setting / Prompt | Purpose |
|---|---|---|
| Project name | "Client Research Assistant" | Created via Projects > New Project on claude.ai |
| Project description | "Multi-document research workspace for client onboarding, competitor analysis, and market research." | Memory aid only, does not affect Claude's responses |
| File types accepted | PDF, TXT, CSV, DOCX and more | Up to 200K tokens per project; files under 30MB or 8000x8000 pixels for images |
| Naming convention | competitor-[company]-[page-type].pdf / report-[topic]-[year].pdf / client-[company]-brief.pdf | Lets Claude cite exact source files in its analysis |
| Prompt 1: Competitor Analysis | Use after uploading 3-5 competitor sites | Outputs positioning summary table, strengths/weaknesses, market gaps, differentiation strategy |
| Prompt 2: Market Research Synthesis | Use after uploading industry reports or trend data | Outputs executive summary, key trends with data, ranked opportunities, recommended actions |
| Prompt 3: Research Dashboard Generation | Use after analysis is complete | Generates a color-coded HTML artifact for client presentations |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Claude says it can't find information in uploaded files | Reference the exact filename shown in the Project sidebar, e.g. "According to competitor-acme-homepage.pdf" instead of "the Acme file" |
| Outputs are too generic or vague | Add specific context to the prompt, e.g. "compare pricing models, target audiences, and value propositions" instead of "analyze competitors" |
| Uploaded website PDF appears blank | Use a browser extension like "Print Friendly" to strip navigation and ads before saving as PDF, or copy the page text into a .txt file and upload that instead |
| Dashboard HTML doesn't look professional | Ask Claude for a revision directly, e.g. "make the styling more professional with a blue color scheme and larger headers," and it will regenerate the artifact |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Systems Masterclass**.
Read Lesson 5 on Substack →
## Continue the course
Browse all lessons in the [Claude Systems Masterclass](/courses/claude-systems/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/subscribe) to get new lessons in your inbox.
---
# How to Give Claude Your Brand Voice (And Sound Like You Every Time)
URL: https://www.genaiunplugged.com/courses/claude-systems/lessons/how-to-give-claude-your-brand-voice/
> Give Claude your brand voice with style guides, examples, and constraints in Claude Projects, so its output finally sounds like you.
Brand voice training in Claude Projects teaches Claude to write in one person's exact tone, sentence rhythm, and vocabulary instead of generic internet writing. It uses a voice analysis prompt, uploaded writing samples in Project Knowledge, and Custom Instructions that Claude references automatically in every chat, cutting editing time on AI drafts by 60-70%.
## What you will be able to do
- Analyze 3 to 5 of your own writing samples with a structured prompt to produce a written voice profile covering sentence structure, vocabulary, structure, and quirks
- Upload those same samples to a Claude Project's Project Knowledge so Claude references them in every conversation without re-pasting them
- Write Custom Instructions that encode tone, sentence length, perspective, formality, and words to never use, applied automatically to every chat in the Project
- Reuse a voice-consistent content prompt template to draft LinkedIn posts, newsletter sections, or emails that point Claude back to the saved voice profile and samples
- Diagnose output that still sounds formal or generic and correct it with a refinement prompt that references specific samples in Project Knowledge
## Before you start
- A Claude account with access to Claude Projects
- 3 to 5 pieces of your own best writing (a LinkedIn post, newsletter section, email, or YouTube script/podcast outline)
- Comfort pasting a prompt into Claude and editing a template with your own details
- Basic understanding of what a system prompt or custom instructions do, since Custom Instructions work the same way
## Reference
| Step | Action | Where it happens |
|---|---|---|
| 1 | Gather 3-5 of your best writing samples (LinkedIn post, newsletter section, email, video script) | Your own files |
| 1 | Run the Voice Analysis Prompt against those samples to get a structured voice profile | New chat inside a Claude Project |
| 2 | Create a Project and name it "[Your Name] Brand Voice" | claude.ai > Projects > New Project |
| 2 | Upload or paste the same samples as separate, clearly named files | Project Knowledge > Add content |
| 3 | Paste the Custom Instructions template and fill it in with your voice analysis | Project settings > Custom instructions |
| 4 | Use the Voice-Consistent Content Prompt template for each new piece, filling in content type, topic, structure, and length | Any chat inside the trained Project |
| Troubleshooting | Run a refinement prompt naming what's wrong (too formal/generic/corporate) and pointing to specific samples | Same Project chat |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| AI output sounds generic, professional, and forgettable | Claude defaults to the statistical average of internet writing until it is trained; upload samples and set Custom Instructions so it has a specific voice to follow |
| Custom Instructions list style rules but no real samples are uploaded | Output stays vague because rules without examples aren't concrete enough; add the 3-5 writing samples to Project Knowledge |
| Writing samples are uploaded but no Custom Instructions are set | Output is inconsistent because examples without explicit rules don't lock in a pattern; write out the Custom Instructions template |
| Only banned words/constraints are defined, without rules or examples | Output turns into generic "safe" writing; constraints need to work together with style rules and writing examples, not alone |
| Output from a trained Project still reads too formal, generic, or corporate | Run a refinement prompt in the same Project telling Claude what's off (formal/generic/corporate) and pointing it back to specific samples in Project Knowledge |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Systems Masterclass**.
Read Lesson 2 on Substack →
## More in this section
- [Lesson 1: Claude Projects 101: Your First Custom AI Assistant](/courses/claude-systems/lessons/claude-projects-101-your-first-custom-ai-assistant/)
## Continue the course
Browse all lessons in the [Claude Systems Masterclass](/courses/claude-systems/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/subscribe) to get new lessons in your inbox.
---
# Claude Projects 101: Your First Custom AI Assistant
URL: https://www.genaiunplugged.com/courses/claude-systems/lessons/claude-projects-101-your-first-custom-ai-assistant/
> Learn how to set up your first Claude Project with persistent context and system prompts. Build a working AI assistant that actually knows your business.
Claude Projects is a persistent workspace inside Claude.ai (included with Claude Pro at $20/month, one project available on the free plan) where you upload business documents and write a custom system prompt once. Every new conversation in that project then reads your files and instructions automatically, so Claude already knows your brand voice, services, and audience without re-explaining.
## What you will be able to do
- Create a named Claude Project workspace scoped to one specific use case, like content creation or client onboarding, instead of a generic catch-all.
- Upload 2-3 business documents (brand voice guide, service descriptions, frameworks, audience notes) so Claude reads them before every response.
- Write a custom system prompt with CONTEXT, TONE, OUTPUT FORMAT, and WHAT TO AVOID sections that define Claude's role in that Project.
- Test the assistant with prompts that check whether it cites your uploaded documents and stays on-brand without being reminded.
- Diagnose and fix common failures, such as Claude ignoring your documents or drifting off-brand, using the troubleshooting fixes in this lesson.
## Before you start
- A Claude Pro subscription ($20/month) for full Projects access, or the free plan, which allows one Project.
- 2-3 existing business documents ready to upload (brand voice guide, service descriptions, frameworks, audience research, or an intake questionnaire) in TXT, PDF, DOC, DOCX, or Markdown format.
- Awareness of the 200K token per-project limit (roughly 150,000 words) so you choose documents you reference constantly rather than uploading everything.
## Reference
| Step | Action | Detail |
|---|---|---|
| 1. Create workspace | Click "Projects" in the left sidebar, then "+ New Project" | Name it for the specific use case (e.g. "Content Creation Assistant"), not "My Project" |
| 2. Upload context | Click "Add content" in the Project header | Upload 2-3 key documents; 200K token limit per Project (about 150,000 words); supported formats: TXT, PDF, DOC, DOCX, Markdown |
| 3. Write system prompt | Click the settings gear, then "Set custom instructions" | Structure it around four sections: CONTEXT, TONE, OUTPUT FORMAT, WHAT TO AVOID |
| 4. Test | Start "New Chat" inside the Project | Ask a business-specific question without naming your uploaded documents; check if Claude cites them on its own |
| Pricing | Claude Pro plan | $20/month, Projects included; free plan allows one Project |
## Common errors and fixes
| Problem | Fix |
|---|---|
| Claude ignores your uploaded documents | Add an explicit line to the system prompt: always review uploaded documents before responding, and cite which document was used and quote the relevant section |
| Responses don't match your brand voice | Rewrite the brand voice guide to be more specific, for example "write like explaining to a smart friend over coffee, use contractions, keep sentences short, no corporate jargon" instead of vague terms like "friendly and professional" |
| Claude forgets context mid conversation | The lesson attributes this to likely hitting the Project's context window limit, which is also why it recommends keeping uploads to 2-3 focused documents within the 200K token limit rather than uploading everything |
| Test conversation feels generic or off-brand overall | Edit the system prompt to be more specific about what you want, then rerun the test prompts and check for document citations and consistent tone |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Systems Masterclass**.
Read Lesson 1 on Substack →
## More in this section
- [Lesson 2: How to Give Claude Your Brand Voice (And Sound Like You Every Time)](/courses/claude-systems/lessons/how-to-give-claude-your-brand-voice/)
## Continue the course
Browse all lessons in the [Claude Systems Masterclass](/courses/claude-systems/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/subscribe) to get new lessons in your inbox.
---
# The Claude Code Extension Stack: Commands, Skills, Hooks, and Agents Explained
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/the-claude-code-extension-stack-commands-skills-hooks-and-agents-explained/
> Compares Claude Code extension types: CLAUDE.md, commands, skills, hooks, agents, then builds a memory system and 3 custom commands.
The Claude Code Extension Stack is a 4-layer system (CLAUDE.md, Skills, Hooks, Agents) that gives Claude Code persistent memory and automated behavior across sessions. This lesson explains what each layer does, when to use it, and walks through building a CLAUDE.md file and two starter skills in about 20 minutes.
## What you will be able to do
- Write a CLAUDE.md file using the 5 essential sections: critical rules, project overview, how to work here, what Claude gets wrong, and deeper docs.
- Place CLAUDE.md at the correct level, project (.claude/CLAUDE.md), user (~/.claude/CLAUDE.md), or auto memory (~/.claude/MEMORY.md), so project rules override personal ones correctly.
- Build a user-invocable skill (SKILL.md with YAML frontmatter) like /quick-audit that runs on demand.
- Set disable-model-invocation and user_invocable in a skill's frontmatter to control whether you, Claude, or both can trigger it.
- Trim an oversized CLAUDE.md with progressive disclosure, moving task-specific content into separate docs files so Claude stops ignoring buried rules.
## Before you start
- Claude Code installed and a project folder open to work in.
- Basic comfort reading and writing markdown and YAML frontmatter.
- Having completed Lesson 1 (AI Content Multiplication System) helps since this lesson extends that project, though it is not strictly required.
## Reference
| Item | Location | Purpose |
|---|---|---|
| /init | Run in project root | Scans the project and generates a starter CLAUDE.md in about 30 seconds |
| .claude/CLAUDE.md | Level 1: project memory | Read every session opened in this project directory; knows architecture, conventions, key files |
| ~/.claude/CLAUDE.md | Level 2: user memory | Applies across all projects; personal preferences, name, business context |
| ~/.claude/MEMORY.md | Level 3: auto memory | The only memory file Claude Code writes to itself, storing lessons across sessions |
| .claude/skills/ (project) or ~/.claude/skills/ (global) | Skill location | Canonical folder for skills; legacy .claude/commands/ still works |
| description (frontmatter field) | SKILL.md | Explains the skill to users and tells Claude when to auto-invoke it |
| user_invocable: true/false | SKILL.md frontmatter | Controls whether the skill shows in the / menu (default: true) |
| disable-model-invocation: true/false | SKILL.md frontmatter | Controls whether Claude can auto-invoke the skill (default: false, meaning Claude can invoke) |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Claude keeps skipping a rule you set (e.g. read files before editing) | The rule is buried in a long CLAUDE.md full of irrelevant content; cut the file to under 200 lines of universally relevant rules |
| CLAUDE.md is stuffed with everything (linting rules, task workflows, code snippets, full docs) | Every irrelevant instruction degrades Claude's attention to the rules that matter; move linting to hooks, workflows to separate docs files, and replace code snippets with file:line pointers |
| Claude auto-invokes a skill that has side effects, like distributing a draft before it is ready | Set disable-model-invocation: true on that skill so only you can trigger it |
| Claude opens a new session with zero memory of the project and you re-explain everything | Create a CLAUDE.md file so project context persists automatically without repeating yourself |
| A background-knowledge skill (e.g. legacy API patterns) clutters the / menu as a manual command | Set user_invocable: false so only Claude can invoke it as context, not you as a command |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 2 on Substack →
## More in this section
- [Lesson 1: From 3x to 10x: The Content Multiplication Engine](/courses/claude-code/lessons/from-3x-to-10x-the-content-multiplication-engine/)
- [Lesson 3: I Connected Claude Code to 5 Tools and Added Automation Hooks, Here is What Changed](/courses/claude-code/lessons/i-connected-claude-code-to-5-tools-and-added-automation-hooks-here-is-what-chang/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.
---
# I Connected Claude Code to 5 Tools and Added Automation Hooks — Here is What Changed
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/i-connected-claude-code-to-5-tools-and-added-automation-hooks-here-is-what-chang/
> Connect Claude Code to Perplexity, Firecrawl, and Notion via MCP servers, then build 3 automation hooks that enforce standards automatically.
This lesson covers connecting Claude Code to external tools using MCP servers (Model Context Protocol) and adding automation hooks. It shows how to set up Perplexity for web search, Firecrawl for web scraping, and Notion for reading a content calendar, plus command hooks that auto-format files, block dangerous commands, and check content quality.
## What you will be able to do
- Connect Claude Code to Perplexity, Firecrawl, and Notion through MCP servers so it can search the web, scrape pages, and read a content calendar.
- Configure an MCP server with the claude mcp add command, including API keys and environment variables.
- Write command hooks that run shell scripts automatically at PreToolUse, PostToolUse, and Stop events.
- Block dangerous bash commands such as rm -rf and git push --force before they run, using exit code 2.
- Auto-format edited files with Prettier and flag forbidden brand-voice phrases in draft markdown files.
## Before you start
- jq installed, for parsing the JSON input hook scripts receive (brew install jq on macOS, sudo apt-get install jq on Linux).
- Node.js and npm installed, for the npx commands used in MCP server setup.
- prettier installed globally or in the project, for the format-on-save hook.
- API keys for Perplexity, Firecrawl, and Notion, plus a Notion integration shared with your content calendar database.
## Reference
| Component | Command / Config | What it does |
|---|---|---|
| Perplexity MCP | `claude mcp add perplexity --env PERPLEXITY_API_KEY=your-key-here -- npx -y @perplexity-ai/mcp-server` | Adds search and reason tools for live web data |
| Firecrawl MCP | `claude mcp add firecrawl --url https://mcp.firecrawl.dev/your-api-key/v2/mcp` | Adds firecrawl_scrape, firecrawl_search, firecrawl_map tools |
| Notion MCP | `claude mcp add --transport http notion https://mcp.notion.com/mcp` | Lets Claude Code read and check status of content calendar entries |
| Verify servers | `/mcp` | Lists connected MCP servers and their available tools |
| PreToolUse hook | Fires before any tool runs; exit code 2 blocks the action | Used to stop dangerous bash commands before they execute |
| PostToolUse hook | Fires after any tool completes | Used to run Prettier automatically after Edit or Write |
| Stop hook | Fires when Claude finishes responding | Used for cleanup or reporting tasks |
| Exit codes | 0 = proceed, 2 = block, any other code = warning only | How a hook script communicates its result back to Claude Code |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| "command not found: jq" when a hook fires | Install jq: brew install jq (macOS) or sudo apt-get install jq (Linux) |
| A CLAUDE.md rule like "always format with Prettier" gets skipped sometimes (in testing, followed 7 of 10 sessions) | Use a PostToolUse hook instead; hooks run every time, CLAUDE.md rules are only suggestions |
| The format-on-save hook runs but the file is not formatted | Install prettier in the project or globally (npm install --save-dev prettier or npm install -g prettier); without it the hook skips formatting silently |
| Claude Code attempts a destructive command such as git push --force or rm -rf | The block-dangerous.sh PreToolUse hook matches the pattern and exits with code 2, blocking the command and telling Claude Code why |
| Claude Code cannot see the Notion content calendar after adding the MCP server | Share the Notion database with the integration you created at notion.so/my-integrations; creating the API key alone is not enough |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 3 on Substack →
## More in this section
- [Lesson 1: From 3x to 10x: The Content Multiplication Engine](/courses/claude-code/lessons/from-3x-to-10x-the-content-multiplication-engine/)
- [Lesson 2: The Claude Code Extension Stack: Commands, Skills, Hooks, and Agents Explained](/courses/claude-code/lessons/the-claude-code-extension-stack-commands-skills-hooks-and-agents-explained/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.
---
# I Built a 3-Agent Research Team in Claude Code (They Run in Parallel While I Write)
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/i-built-a-3-agent-research-team-in-claude-code/
> Build a 3-agent research team, researcher, writer, reviewer, that works in parallel with separate context windows inside Claude Code.
Claude Code agents let you split one overloaded conversation into specialists, a researcher, a writer, and a reviewer, each with its own context window, tools, and instructions. This lesson covers the agent file format (frontmatter plus markdown body) and how to run agents sequentially or in parallel for content production.
## What you will be able to do
- Create custom agent files in .claude/agents/ with YAML frontmatter and a markdown instructions body
- Restrict an agent's tools, for example disallowedTools: Write, Edit, so a reviewer can find issues without silently fixing them
- Chain agents in a sequential pipeline where the researcher's brief feeds the writer and the writer's draft feeds the reviewer
- Run several agent instances in parallel to cut research time roughly in half
- Write specific, checklist-style instructions instead of vague ones so an agent's output is actionable, not just a vibe check
## Before you start
- Claude Code installed, with basic comfort writing prompts and reading YAML frontmatter
- MCP servers already connected, such as Perplexity and Firecrawl, if the researcher agent should reach the web (covered in an earlier lesson)
- A brand voice guide or content rules file the writer and reviewer agents can read, such as a brand-config.json or playbook doc
- A drafts/ folder or similar location where the writer agent can save output for the reviewer to check
## Reference
| Field | What it controls | Example from the lesson |
|---|---|---|
| name | Agent identifier; the filename becomes the agent name | researcher |
| description | How Claude Code decides when to auto-spawn this agent; written like a job posting | "Deep web research on any topic. Searches the web, reads competitor articles, produces research briefs." |
| tools | Which tools the agent is allowed to use | WebSearch, WebFetch, Read, Glob, Grep |
| disallowedTools | Tools explicitly blocked, used to enforce a role | Write, Edit (blocked on the reviewer so it can't silently fix issues) |
| model | Which model the agent runs on | sonnet |
| memory | Whether the agent keeps what it learns between sessions | project |
| maxTurns | Cap on tool round-trips per run, stops a curious agent from chasing tangents | 20 |
| skills | Skill files preloaded into the agent's context at startup | seo-check |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Reviewer agent scores every draft 9/10 and flags zero critical issues | The instructions said "check brand voice" instead of listing every forbidden phrase and every structure rule with pass or fail criteria; write an exhaustive, specific checklist |
| Reviewer given Write and Edit access quietly fixes problems instead of reporting them, so the same mistake keeps recurring in later drafts | Set disallowedTools: Write, Edit on the reviewer so it can only surface issues with a location and suggestion |
| One long conversation handles research, writing, and review together and forgets the early research by the time it reaches quality checks | Split the work across separate agents, each with its own context window, instead of one generalist conversation |
| A researcher agent burns 80+ tool calls chasing one tangent | Set maxTurns to cap the number of tool round-trips per run |
| Writer agent wanders off the research brief into its own web searches | Give the writer agent no web tools, only Read, Write, Edit, Glob, Grep, so it stays tied to the brief and brand guide |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 4 on Substack →
## More in this section
- [Lesson 5: Claude Code Runs My Content Business While I Create, Here is the Full System](/courses/claude-code/lessons/claude-code-runs-my-content-business-while-i-create-here-is-the-full-system/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.
---
# From 3x to 10x: The Content Multiplication Engine
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/from-3x-to-10x-the-content-multiplication-engine/
> 3x content production with consistent quality - Real content workflow implementation. Focus: Claude Code batch automation.
The Content Multiplication Engine is a command-line system built with Claude Code that turns one source article into 10+ platform-specific pieces: 5 LinkedIn posts, 10 tweets, 3 newsletter sections, and 2 YouTube scripts. Running one command generates everything and organizes it into a content calendar in under 10 minutes.
## What you will be able to do
- Run one command (node generate.js source-article.md) to turn a single article into 5 LinkedIn posts, 10 tweets, 3 newsletter sections, and 2 video scripts
- Set up the whole system in about 30 minutes by describing your workflow to Claude Code in plain English, without writing code yourself
- Match your own writing style in every generated piece by feeding Claude Code a brand-voice.md file containing your past LinkedIn posts, newsletter sections, and tweets
- Get a content calendar (calendar/content-calendar.csv) listing publishing date, platform, content type, file location, and status for every generated piece
- Reuse the system weekly or monthly, producing a full batch in about 5 minutes once it's built
## Before you start
- A Claude account (claude.ai) and an Anthropic API key from console.anthropic.com (starts with "sk-ant-")
- Terminal access (Mac Terminal, Windows PowerShell, or Linux terminal) with Node.js installed
- A source article, blog post, or transcript saved as a Markdown file
- Optional but recommended: 3-5 of your own LinkedIn posts, 2-3 newsletter paragraphs, and 10-15 tweets to paste into brand-voice.md so generated content matches your voice
## Reference
| Step | Command / Setting | Detail |
|---|---|---|
| Install Claude Code | `npm install -g @anthropic-ai/claude-code` | One-time global install |
| Get API key | console.anthropic.com > API Keys > Create Key | Key starts with "sk-ant-" |
| Set API key (Mac/Linux) | `export ANTHROPIC_API_KEY="your-api-key-here"` | Must be set before running Claude Code |
| Set API key (Windows) | `$env:ANTHROPIC_API_KEY="your-api-key-here"` | PowerShell equivalent |
| Verify install | `claude --version` | Confirms Claude Code is working |
| Start Claude Code | `claude` (inside project folder) | Opens the prompt where you describe what to build |
| Generate a batch | `node generate.js source/article-001.md` | Produces 5 LinkedIn posts, 10 tweets, 3 newsletter sections, 2 video scripts, plus a content calendar |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 1 on Substack →
## More in this section
- [Lesson 2: The Claude Code Extension Stack: Commands, Skills, Hooks, and Agents Explained](/courses/claude-code/lessons/the-claude-code-extension-stack-commands-skills-hooks-and-agents-explained/)
- [Lesson 3: I Connected Claude Code to 5 Tools and Added Automation Hooks, Here is What Changed](/courses/claude-code/lessons/i-connected-claude-code-to-5-tools-and-added-automation-hooks-here-is-what-chang/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.
---
# Claude Code Channels: Turn Your Terminal Into a Messaging Hub (Telegram, Discord, Webhooks)
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/claude-code-channels-turn-your-terminal-into-a-messaging-hub/
> Set up Claude Code Channels for Telegram and Discord, push webhooks and alerts into your terminal, with security tips and custom channel code included.
Claude Code Channels are MCP servers that push outside events, chat messages, webhooks, alerts, into a running Claude Code session so it can reply through the same channel. Available from version 2.1.80, they connect Telegram, Discord, or any webhook-enabled service to your terminal, turning a single-player session into a two-way messaging hub.
## What you will be able to do
- Install and run the fakechat plugin to confirm channels work on your machine before touching a real platform
- Set up a Telegram bot, pair your own account to it, and lock it down with an allowlist policy
- Set up a Discord bot through its OAuth flow, pair it, and lock it down with an allowlist policy
- Run Telegram and Discord channels at the same time in one Claude Code session, with replies routed to the correct platform automatically
- Write a custom webhook channel server in TypeScript with the MCP SDK so CI, GitHub, or monitoring events reach Claude as they happen
## Before you start
- Claude Code v2.1.80 or later, confirmed by running claude --version
- claude.ai authentication (Console and API key auth do not support channels); Pro/Max users add the --channels flag, Team/Enterprise users need an admin to set channelsEnabled: true
- Bun runtime installed (curl -fsSL https://bun.sh/install | bash) and available in your shell PATH
- For custom channels: familiarity with the @modelcontextprotocol/sdk package and a bot token from BotFather (Telegram) or the Discord Developer Portal
## Reference
| Task | Command |
|---|---|
| Install fakechat plugin | /plugin install fakechat@claude-plugins-official |
| Start Claude Code with fakechat | claude --channels plugin:fakechat@claude-plugins-official |
| Configure Telegram bot token | /telegram:configure |
| Lock Telegram to your account | /telegram:access policy allowlist |
| Configure Discord bot token | /discord:configure |
| Lock Discord to your account | /discord:access policy allowlist |
| Run Telegram and Discord together | claude --channels plugin:telegram@claude-plugins-official plugin:discord@claude-plugins-official |
| Load a custom channel (dev preview) | claude --dangerously-load-development-channels server:webhook-channel |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| "fakechat MCP failed" with a red X after install | Bun isn't in PATH yet; run exec /bin/zsh and source ~/.zshrc (or open a new terminal), then restart Claude Code with the --channels command |
| fakechat test won't load in the browser | Port 8787 is already in use by a leftover process; run lsof -i :8787 to check, then lsof -ti :8787 \| xargs kill and restart |
| Discord bot can't read message text | "Message Content Intent" under Privileged Gateway Intents was left off when creating the bot; it's easy to miss and must be enabled |
| Anyone can message your Claude Code session | Without an allowlist policy, anyone who finds your bot's username can send it messages; run /telegram:access policy allowlist or /discord:access policy allowlist |
| Custom channel metadata attribute goes missing | Meta keys must be identifiers (letters, digits, underscores only); keys with hyphens are silently dropped from the tag |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 7 on Substack →
## More in this section
- [Lesson 6: Advanced Claude Code: Plugins, SDK, and Building Tools Others Can Use](/courses/claude-code/lessons/advanced-claude-code-plugins-sdk-and-building-tools-others-can-use/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.
---
# Claude Code Runs My Content Business While I Create — Here is the Full System
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/claude-code-runs-my-content-business-while-i-create-here-is-the-full-system/
> See the full Claude Code content pipeline with real monthly costs, actual time savings, and an honest list of what not to automate.
This lesson connects four previously separate Claude Code pieces, CLAUDE.md, skills, agents, and MCP servers, plus hooks and headless mode, into one integrated content pipeline. It covers four skills (/research, /draft, /review, /repurpose), four agents, three hooks, and three headless automation patterns that take a topic from research through drafting, review, and platform-specific repurposing.
## What you will be able to do
- Wire CLAUDE.md, skills, agents, MCP servers, hooks, and headless mode into one content pipeline instead of four disconnected pieces.
- Build four slash-command skills (/research, /draft, /review, /repurpose) that pass arguments through $ARGUMENTS and route to dedicated agents.
- Run the pipeline outside the terminal with claude -p, triggered by cron, an n8n webhook, or a GitHub Action.
- Generate platform-specific copy (a LinkedIn post, an X thread, three Substack Notes) from one draft, stopping short of pushing it live.
- Apply a slug-derivation convention and an immutability rule so each skill finds the correct upstream file every time, even weeks later.
## Before you start
- Claude Code set up and used interactively, ideally having built or reviewed Lessons 1 to 4 (content multiplier, CLAUDE.md/skills/hooks stack, MCP servers, the 3-agent team), since this lesson wires those pieces together rather than building them from scratch.
- MCP servers configured for Perplexity and Firecrawl, with Notion optional, since the researcher agent depends on them for live data.
- A project CLAUDE.md file that defines file conventions, brand voice rules, and slug derivation logic.
- Basic familiarity with cron, n8n, or GitHub Actions if you want to use the headless automation patterns.
## Reference
| Skill / setting | What it does | Key detail |
|---|---|---|
| /research $TOPIC | Researcher agent gathers live data via MCP | Writes drafts/{slug}-research.md |
| /draft $TOPIC | Writer agent drafts from the research brief | Looks up drafts/{slug}-research.md using the same slug |
| /review | Reviewer agent scores the draft and flags fixes | permissionMode: plan, disallowedTools: Edit |
| /repurpose $PATH | Multiplier agent creates platform-specific copy | Writes distribution/{slug}/*.md, does not post or schedule |
| acceptEdits permission mode | Auto-approves file edits, still asks for bash commands | Used for trusted pipeline runs |
| plan permission mode | Read-only, cannot edit anything | Pinned into the reviewer agent's frontmatter |
| block-dangerous.sh hook | Fires on PreToolUse for Bash | Blocks rm -rf and git push --force, regardless of permission mode |
| quality-check.sh hook | Fires on PostToolUse | Flags forbidden phrases only on drafts/*-draft.md files over 1,000 words |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| quality-check hook fires on every intermediate save, the writer edits to fix the flagged phrase, which triggers the hook again (feedback loop). | Restrict the hook to PostToolUse on drafts/*-draft.md files longer than 1,000 words only, the dual guard described in Layer 5. |
| /draft cannot find the right research file, or silently picks the wrong one. | Define slug derivation (lowercase, hyphenate spaces, strip non-alphanumeric, truncate to 60 chars) in CLAUDE.md so /draft always looks for drafts/{slug}-research.md. |
| Editing a *-research.md or *-draft.md file after the next stage has already run against it breaks reproducibility across sessions and team members. | Treat those files as immutable. Re-run the upstream skill instead of hand-editing the file. |
| The reviewer agent could rewrite the draft it is supposed to be scoring. | Pin permissionMode: plan and disallowedTools: Edit in the reviewer's agent frontmatter, enforced by the system prompt regardless of what the prompt says. |
| Assuming acceptEdits or auto-mode permission settings are enough to stop a dangerous command. | Hooks like block-dangerous.sh fire on every Bash PreToolUse regardless of permission mode, so rm -rf and git push --force stay blocked even in acceptEdits. |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 5 on Substack →
## More in this section
- [Lesson 4: I Built a 3-Agent Research Team in Claude Code (They Run in Parallel While I Write)](/courses/claude-code/lessons/i-built-a-3-agent-research-team-in-claude-code/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.
---
# Advanced Claude Code: Plugins, SDK, and Building Tools Others Can Use
URL: https://www.genaiunplugged.com/courses/claude-code/lessons/advanced-claude-code-plugins-sdk-and-building-tools-others-can-use/
> Package your Claude Code setup as a distributable plugin, run it in CI/CD, and learn the SDK and security model for building tools others use.
A Claude Code plugin bundles agents, skills, hooks, and MCP servers into one installable package built around a .claude-plugin/plugin.json manifest. This lesson packages an existing Claude Code setup into a plugin, fixes the three most common breakages (manifest location, hardcoded hook paths, skill namespacing), and covers the three ways to install a plugin.
## What you will be able to do
- Package an existing Claude Code setup (agents, skills, hooks, .mcp.json) into a plugin folder with a valid .claude-plugin/plugin.json manifest
- Write portable hook commands using ${CLAUDE_PLUGIN_ROOT} instead of a hardcoded absolute path so hooks work on any machine
- Test a plugin locally with claude --plugin-dir and iterate using /reload-plugins before publishing it
- Install a plugin from the official marketplace, a GitHub repo, or a local directory using the correct plugin marketplace add / plugin install commands
- Namespace skill references correctly (for example /content-ops:research) so they do not collide with another plugin's same-named skill
## Before you start
- A working Claude Code setup with agents, skills, and hooks already built (the lesson uses the Lesson 5 content-pipeline-scaffold as its example)
- Claude Code CLI installed and able to run claude --plugin-dir and the /plugin commands
- Comfort editing JSON, for plugin.json and hooks.json
- A GitHub repository (or self-hosted git) if you plan to distribute the plugin via that path rather than a local directory
## Reference
| Item | Detail |
|---|---|
| Manifest path | `.claude-plugin/plugin.json`, only this file goes in the hidden folder; only `name` is required |
| Hook config | `hooks/hooks.json` needs an outer `"hooks"` wrapper; plain `.claude/settings.json` hook configs do not use this wrapper |
| Portable path variable | `${CLAUDE_PLUGIN_ROOT}` resolves to the plugin's install directory; contents written here are wiped on the next version update |
| Persistent data variable | `${CLAUDE_PLUGIN_DATA}` resolves to `~/.claude/plugins/data/{plugin-id}/`, and survives version updates |
| Local test command | `claude --plugin-dir ./content-ops` loads the plugin in-place without a marketplace |
| Reload during dev | `/reload-plugins` picks up edited agent, skill, or hook files without restarting Claude Code |
| Marketplace install | `/plugin marketplace add owner/repo-name` registers the marketplace, then `/plugin install @` installs it; pin a version with `@v1.2.0` |
| Skill auto-invoke control | Add `disable-model-invocation: true` to a skill's frontmatter so it only runs when the user types it explicitly |
## Common errors and fixes
| What goes wrong | The fix |
|---|---|
| Manifest placed outside `.claude-plugin/`, or other component folders placed inside it | Only `plugin.json` belongs in `.claude-plugin/`; `agents/`, `skills/`, `hooks/`, and `.mcp.json` live at the plugin root and are auto-discovered |
| Hook command uses a hardcoded absolute path like `/Users/you/.claude/hooks/format-on-save.sh` | Replace it with `${CLAUDE_PLUGIN_ROOT}/hooks/format-on-save.sh` so it resolves on any machine the plugin installs on |
| `hooks.json` is written without the outer `"hooks"` wrapper | Plugin hook configs require the wrapper; omitting it makes hooks silently fail to register |
| `version` field is left out of `plugin.json` while distributing via git | Every commit becomes a new version and triggers an update prompt for installed users; set an explicit `version` and bump it intentionally |
| Skill referenced as `/research` inside plugin docs or in another skill body | Use the namespaced form `/content-ops:research`, since the un-namespaced name collides with other plugins' skills of the same name |
## Read the full walkthrough
The complete lesson, with screenshots and any downloads, is published on Substack as part of **Claude Code Masterclass: Build AI Systems Without Writing Code**.
Read Lesson 6 on Substack →
## More in this section
- [Lesson 7: Claude Code Channels: Turn Your Terminal Into a Messaging Hub (Telegram, Discord, Webhooks)](/courses/claude-code/lessons/claude-code-channels-turn-your-terminal-into-a-messaging-hub/)
## Continue the course
Browse all lessons in the [Claude Code Masterclass: Build AI Systems Without Writing Code](/courses/claude-code/) course, or subscribe to the [GenAI Unplugged newsletter](https://genaiunplugged.substack.com/p/ai-content-multiplication-system) to get new lessons in your inbox.