n8n Tutorial

  • Loading...

n8n tutorial - Lesson 25: Build Your First AI Agent in n8n: ReAct Pattern Explained

n8n tutorial - Lesson 25: Build Your First AI Agent in n8n: ReAct Pattern Explained

Hi everyone, in this n8n AI agent tutorial, you'll build your first working AI agent using the ReAct pattern — complete with multiple tools, memory, and an orchestrator that triggers sub-workflows. This is part of the n8n Workflow Automation Tutorial series, and it's the session where things shift from simple automation to agents that can reason and act on their own.

How to do:

Step 1 — Understand the ReAct Pattern and Agent Architecture

Before building anything, you need to know what makes an agent different from a regular n8n workflow — the ReAct loop is the core of it.
  1. The ReAct pattern stands for Thought → Action → Observation, repeated in a loop until the agent reaches a final answer.
  2. An n8n AI agent has exactly three components:
    • Agent node — the brain that decides what to do
    • Tools — actions the agent can call (HTTP requests, spreadsheets, Telegram, etc.)
    • Memory — stores conversation context across turns
  3. Know the difference between the three execution models:
    • Regular workflow — fixed, hard-coded flow; great for simple, predictable tasks
    • Chain — LLM calls in sequence, but no tool-calling or dynamic decisions
    • Agent — decides which tool to call, in what order, and handles unexpected situations using natural language

Note — A regular Schedule + Google Sheets + Telegram workflow can send automated reports — but it only follows the exact path you hard-coded. An agent handles variable flows: if a step fails or a new condition appears, it reasons through it instead of breaking.

Step 2 — Create the Workflow and Add the Chat Trigger

Create a new workflow named T7-B1-First-Agent and set up the entry point.
  1. In n8n, click New Workflow and name it T7-B1-First-Agent.
  2. Add a Chat Trigger node as the starting node — this lets you send messages to the agent directly from the n8n chat interface during testing.
  3. This workflow runs in Manual/Chat mode, so you do not need to set it to Active.

Step 3 — Add the AI Agent Node and Configure the Model

The AI Agent node is the core of this n8n AI agent tutorial — wire it to the Chat Trigger and set the language model.
  1. Add an AI Agent node and connect it to the Chat Trigger output.
  2. Inside the Agent node, set the model to Claude Haiku 4.5 as the default — it's fast and cost-efficient for most tool-calling tasks.
  3. Upgrade to Claude Sonnet 4.6 on demand when a task requires stronger reasoning (complex multi-step orchestration, ambiguous instructions).

Tip — Starting with Haiku keeps costs low during development and testing. Only swap to Sonnet when you notice the agent making wrong tool choices or failing to chain steps correctly.

Step 4 — Attach Simple Memory

Memory lets the agent remember context across messages in the same conversation — without it, every message is treated as a fresh start.
  1. Inside the AI Agent node, find the Memory sub-section and add a memory module.
  2. Select Simple Memory (this is the current name in newer n8n versions — older guides may call it "Window Buffer Memory", but the functionality is identical).
  3. To verify memory works, test this sequence:
    • Send: "What is 500 USD in VND?"
    • Then send: "Double that amount."
    • The agent should resolve "that amount" as 500 USD from context and return the doubled result.

Note — The name change from "Window Buffer Memory" to "Simple Memory" is a known n8n UI update. If you follow an older n8n tutorial and can't find the node, look for Simple Memory in the memory selector instead.

Step 5 — Add Tool 1: Calculator

The Calculator tool is built into n8n and requires zero configuration — it's the easiest way to confirm your agent can call tools.
  1. In the AI Agent node, go to the Tools section and click Add Tool.
  2. Select Calculator from the list — no credentials or additional settings needed.
  3. Test it by asking: "What is 1234 multiplied by 56?" — the agent should invoke the Calculator tool and return the correct answer.

Step 6 — Add Tool 2: HTTP Request for Exchange Rates

This tool gives the agent the ability to fetch live exchange rate data from a free public API — no authentication required.
  1. Add a new tool and select HTTP Request.
  2. Set the tool name to get_exchange_rate.
  3. Configure the request:
    • Method: GET
    • URL: https://api.exchangerate-api.com/v4/latest/USD
    • Authentication: None (this is a public, free endpoint)
  4. Write a clear tool description so the agent knows when to use it — for example: "Get the latest USD exchange rates against all major currencies."

Tip — The tool description is not cosmetic — the agent reads it to decide whether to call this tool for a given user request. Write it as a one-sentence summary of what the tool returns and when it's relevant.

Step 7 — Add Tool 3: Google Sheets for Pending Blog Topics

This tool connects the agent to a real Google Sheet to retrieve blog topics that are queued for writing.
  1. Add a new tool and select Google Sheets.
  2. Set the tool name to get_pending_topics.
  3. Configure it to read from the sheet named T4-B5-Blog-Topics.
  4. Set a filter so it only returns rows where the status column equals pending.
  5. Connect your existing Google Sheets credential — reuse whatever credential you set up in earlier sessions of this n8n workflow automation series.

Step 8 — Add Tool 4: Telegram for Sending Reports

This tool lets the agent send a summary message to a Telegram chat after completing a task — the key here is using $fromAI() correctly.
  1. Add a new tool and select Telegram, action: Send Message.
  2. Set the tool name to send_telegram_report.
  3. Configure the Chat ID field with your Telegram chat ID (static value — does not change).
  4. For the Text field, do NOT leave it blank — n8n marks this field as required and will throw a validation error. Set it to:
    $fromAI('message', 'The message to send')

Note — The $fromAI('param', 'description') syntax tells n8n to let the agent decide what value to fill in at runtime. Use it for any field whose value depends on what the agent is doing — message text, topic names, row numbers, etc. Without it, n8n either errors out (required fields) or always sends the same static text.

Step 9 — Test Multi-Tool Calling and Memory Together

Run a real test that forces the agent to call more than one tool in a single response — this confirms the ReAct loop is working end-to-end.
  1. Open the Chat panel and send: "What are the pending blog topics, and what is 500 USD in VND?"
  2. Watch the execution — the agent should call both get_pending_topics and get_exchange_rate in the same run, either in parallel or sequentially.
  3. Follow up with: "Double the USD amount." — the agent should remember 500 USD from the previous message and return 1000 USD without you repeating it.

Tip — If the agent only calls one tool when you expected two, rephrase the request to make both needs explicit. The agent uses your prompt and the tool descriptions together to decide what to call — vague prompts produce vague tool choices.

Step 10 — Add the Orchestrator Tool: Call n8n Workflow Tool

This is where the agent becomes an orchestrator — it can trigger an entire sub-workflow as if it were just another tool.
  1. Add a new tool and select Call n8n Workflow Tool (older guides may call this "Execute Sub-workflow" — the correct name in the Agent node's tool menu is Call n8n Workflow Tool).
  2. Set the tool name to generate_blog_content.
  3. Point it at the existing sub-workflow T6-Content-Child-Blog (built in a previous session of this n8n tutorial series).
  4. For any input fields the sub-workflow expects (topic, row number, etc.), set the values using $fromAI('field_name', 'description') so the agent decides what to pass at runtime.
  5. Write a tool description like: "Generate and publish a blog post for a given pending topic. Pass the topic name and row number from the Google Sheet."

Step 11 — Test the Full Orchestration Flow

Send a single natural language command and watch the agent read the sheet, trigger the content factory, publish to Blogger, and report back.
  1. In the Chat panel, send something like: "Pick the first pending topic from the sheet and publish a blog post for it."
  2. The agent should execute this sequence automatically:
    • Call get_pending_topics → read the Google Sheet
    • Call generate_blog_content → trigger T6-Content-Child-Blog
    • Sub-workflow generates content and posts to Blogger
    • Call send_telegram_report → send you the Post ID and published link
  3. Check the final Telegram message — it should contain the full result: Post ID and a live link to the published post.

Production tip — The agent decides when to call the orchestrator tool and what data to pass — you don't hard-code that logic anywhere. This is the fundamental difference between agent-based automation and a regular n8n workflow: the flow isn't predetermined, it's reasoned at runtime.

Step 12 — Understand the Human-in-the-Loop Limitation

During this session, Telegram Send and Wait was tested as a way to pause the agent and wait for human approval before continuing.
  1. Add a Telegram: Send and Wait node to your workflow and attempt to use it as an approval gate.
  2. You will find it does not work on localhost:5678 — Telegram's callback cannot reach a local n8n instance, so the workflow hangs indefinitely waiting for a response that never arrives.
  3. This is a known localhost limitation:
    • Human-in-the-Loop via Telegram requires n8n to have a public URL
    • Solutions: use ngrok to expose localhost, or deploy n8n to a VPS
  4. For now, remove the Send and Wait node and note it for a future session when n8n is deployed with a public URL.

Note — This is a real production consideration, not just a tutorial limitation. Any n8n workflow that needs webhook callbacks — including Human-in-the-Loop approvals — must run on a publicly accessible URL. Local development environments will always block these flows.

Key Lessons from This Session

  1. ReAct = Thought → Action → Observation loop. The agent repeats this cycle until it has a final answer — it doesn't execute a fixed path like a regular workflow.
  2. An n8n AI agent has three components: Agent node, Tools, and Memory. Remove any one of these and you have a chain or a regular workflow, not an agent.
  3. Use $fromAI('param', 'description') for any field the agent must decide at runtime. Required fields left blank will cause a validation error; static values defeat the purpose of using an agent.
  4. Tool descriptions are instructions, not labels. The agent reads them to decide which tool to invoke — write them as clear, one-sentence functional summaries.
  5. "Call n8n Workflow Tool" is the correct node name for triggering sub-workflows from an agent. The older name "Execute Sub-workflow" no longer appears in the Agent tool menu.
  6. "Simple Memory" is the current name for what older guides call "Window Buffer Memory." The functionality is identical — only the UI label changed.
  7. Human-in-the-Loop via Telegram requires a public URL. Localhost cannot receive Telegram callbacks; use ngrok or a VPS deployment for this feature.
  8. An agent beats a regular workflow when the flow cannot be predetermined. For simple, fixed-path tasks, a regular n8n workflow automation is still the better choice.

Conclusion:

In this n8n AI agent tutorial, you built a full ReAct-pattern agent with four tools, working memory, and an orchestrator that triggers a sub-workflow from a single natural language command — going from understanding the theory to watching it publish a real blog post and report back on Telegram. The key shift is moving from hard-coded workflow logic to an agent that reasons, decides, and acts dynamically. In the next session of this n8n workflow automation tutorial series, you'll go further with advanced agent patterns: an internal chatbot that queries live data, a scheduled autonomous agent, or custom tools built with code.

If you have any questions, feel free to leave a comment below. Thank you!

Tags: n8n AI agent tutorial, n8n tutorial, n8n workflow automation, ReAct pattern n8n, n8n tools setup, AI agent orchestrator, n8n beginner guide, n8n automation tips

Maybe you are interested!

7 Ways AI Can Streamline Your Linux System Administration

7 Ways AI Can Streamline Your Linux System Administration

AI isn't a silver bullet for every problem. In fields demanding creativity, humans remain irreplaceable. But when it comes to technical grunt work like Linux system administration? AI becomes an exceptionally useful sidekick.

Here's what's important to understand: AI won't replace system administrators. Instead, it accelerates the learning curve for Linux newcomers while helping seasoned admins plow through workloads faster. The result is more time spent on strategy, less on repetitive tasks.

Below are seven scenarios where AI genuinely shines in Linux system management.

1. Generate Bash Scripts Quickly and Correctly

Bash scripting isn't mandatory for casual Linux users. But if you've ever managed a Linux server or need to automate tasks like backups, it becomes almost essential.

For beginners, writing scripts from scratch feels daunting. This is where AI steps in.

Simply describe what you need:

"Create a Bash script that backs up my ~/Documents folder to an external drive mounted at /backups daily, keeping only the 5 most recent backups."

AI generates a complete, ready-to-review script. After confirming it works correctly, configure cron to run it automatically. Unsure about cron syntax? AI walks you through it step-by-step.

The catch: periodically verify those backups actually contain what you need. Automation without verification is just false security.

2. Parse Log Files Without the Headache

Log files are your window into system behavior and the root cause of errors. Most Linux logs live in:

/var/log

The problem? Log messages aren't always crystal clear.

Say you keep seeing:

cause font doesn't have a family name

Search engines often fail to help here. But paste it into AI and get a proper explanation: it's a font handling issue where certain fonts lack the family name attribute. Not critical, usually safe to ignore.

Better yet, AI suggests silencing these messages by creating a blacklist in:

/etc/rsyslog.d/

with this line:

:msg, contains, "cause font doesn't have a family name" stop

then restart the service:

sudo systemctl restart rsyslog

This kind of guidance saves substantial time when drowning in log noise.

3. Decode journalctl Output

If your system runs systemd, you'll almost certainly encounter:

journalctl

This tool captures logs from system services. The challenge? Its output can be cryptic, especially for uncommon errors.

Here's the trick: don't just dump entire logs and ask "what's wrong?" Add context.

Instead try:

"Explain this journalctl output from openssh-server..."

then paste the log.

Mentioning the specific service makes AI's analysis far more accurate and actionable.

4. Build iptables Rules Without the Syntax Headache

iptables powers most Linux firewalls. It's also notorious for its bewildering syntax.

Memorizing endless flag combinations? Skip it. Just describe what you want:

"Write an iptables rule allowing SSH connections on port 2022 through eth0."

AI translates that into proper iptables syntax instantly. Way faster than hunting through documentation.

5. Monitor and Manage System Processes Intelligently

Linux offers countless process monitoring tools—from pretty GUIs to command-line utilities like:

ps

Not familiar with them? Ask AI simple questions:

"How do I find which process is hogging CPU or RAM, and how do I stop it?"

AI explains:

  • How to identify resource-hungry processes
  • What each metric means
  • Safe termination methods
  • When to use kill, killall, or pkill

This beats blindly copying commands from random websites and actually teaches you Linux.

6. Handle User Accounts and Permissions Effortlessly

User management and access control are core Linux admin responsibilities. If your AI system has execution privileges, you can simply request actions in plain English:

"Lock Mary's account for one week."

After sudo confirmation, AI runs something like:

sudo chage -E $(date -d "+7 days" +%Y-%m-%d) Mary

File and folder permissions? Same deal. Instead of memorizing chmod, chown, and setfacl commands:

"Give the editors group full permissions on the /data directory."

You describe the goal, AI handles the syntax.

7. Run Virtual Machines More Efficiently

Not everyone works with VMs regularly, but running an internal server as a virtual machine—say, Nextcloud in VirtualBox as a Google Workspace replacement—is genuinely practical.

The snag: you probably don't want the VirtualBox window and guest OS constantly visible on your screen.

Launch it headless instead. Just ask:

"How do I run my Nextcloud VirtualBox VM in headless mode?"

AI responds with:

VBoxManage startvm "Nextcloud" --type headless

Your VM runs invisibly in the background, consuming zero GPU resources for rendering a window.

The Bottom Line

AI won't replace fundamental Linux knowledge, but it transforms administration from a grinding chore into something genuinely efficient.

From crafting Bash scripts and untangling logs to building firewall rules, tracking processes, and managing accounts—AI serves as a reliable technical assistant across the board.

The real trick is treating it as a tool, not a crutch. Always review commands before executing them on production systems. Especially critical when dealing with permissions, networking, or sensitive data. AI is powerful, but human oversight remains non-negotiable.


Description: Discover how AI assistants boost Linux admin efficiency—from bash scripting to log analysis, firewall rules, and user management.

Related Articles

How to Use DesignArena for Comparing AI Models

How to Use DesignArena for Comparing AI Models

DesignArena.ai is a relatively new platform that specializes in comparing and evaluating the quality of AI content generation models. Whether you're working with video, image, or 3D design tools, the platform lets you run the same prompt across multiple AI systems simultaneously, then vote on which output looks the best. What's interesting here is you get to bypass the typical workflow of signing up for each tool separately.

DesignArena.ai serves as a convenient hub for testing a single prompt across numerous AI systems without the registration hassle. The platform helps you explore different styles and track which AI models are currently outperforming others in specific tasks. Below is a step-by-step guide to using DesignArena for comparing AI-generated designs.

How to Compare AI Models Using DesignArena

Step 1:

Head over to DesignArena's website and create an account to get started:

https://www.designarena.ai/

Once you're in, you'll see numerous options for generating different types of content and designs. Click on the content type you want to create — for instance, we'll select image generation here.

Chọn nội dung cần tạo trên DesignArena

Step 2:

In the prompt input box at the top, type your command and select a size for your generated image, or leave it on Auto. Then submit to generate. If you're uncertain about your prompt wording, click the prompt enhancement icon for suggestions.

Câu lệnh tạo ảnh trên DesignArena

Step 3:

The image generation process kicks off immediately. DesignArena will produce four different images in varying styles — all generated from your single text command.

Tạo ảnh theo câu lệnh trên DesignArena

Now comes the fun part: vote for your favorite among the four options.

Chọn ảnh thích trên DesignArena

Step 4:

You'll now see the ranking of all generated images and which AI model created each one. For your preferred image, a download option appears. This is where you can grab the final result.

Tải ảnh trên DesignArena

You can also refine your image by entering an edit prompt if you want to tweak the result further.

Chỉnh sửa lại ảnh tạo trên DesignArena


Description: Learn how to test multiple AI models side-by-side with DesignArena and discover which one produces the best results.

Related Articles

n8n tutorial - Lesson 24: Quality Gate Pattern in n8n: AI Review Before Publishing

n8n tutorial - Lesson 24: Quality Gate Pattern in n8n: AI Review Before Publishing

Hi everyone, in this post we're building a Quality Gate inside an n8n Content Factory workflow — an AI-powered review layer that blocks low-quality content before it ever gets published. This is a core pattern in n8n quality control automation and one of the most practical additions you can make to any content pipeline.

How to do:

Step 1 — Design the AI Review Checklist (Blog + YouTube)

Before adding any nodes, define exactly what the AI will check and what counts as a passing score.
  1. For the Blog review, define 5 criteria: word_count, has_headings, has_keyword, no_placeholder, title_length.
  2. For the YouTube review, define 5 criteria: title_length, description_length, has_tags, has_timestamps, no_empty_field.
  3. Set the pass threshold at ≥ 4 out of 5 criteria met.
  4. Require the AI to return a structured JSON object with three fields: pass, score, and notes.

Tip — Locking down the output schema before building the nodes saves debugging time later. The pass field will drive your IF node, score goes to the rejected log, and notes tells you exactly why a piece failed.

Step 2 — Insert AI Review Nodes into Each Child Workflow

Add an AI review node to both the Blog and YouTube child workflows, placing each one at the right point in the chain.
  1. In T6-Content-Child-Blog, insert an AI Review Blog node between the Format HTML node and the POST Draft Blogger node.
  2. In T6-Content-Child-YouTube, insert an AI Review YouTube node at the equivalent position — after content is fully formatted.
  3. In the User message of AI Review YouTube, wrap array fields with JSON.stringify():
    • Tags: JSON.stringify($('YouTube SEO').item.json.output.tags)
    • Timestamps: JSON.stringify($('YouTube SEO').item.json.output.timestamps)

Note — If you pass an array directly into a User message expression without JSON.stringify(), n8n renders it as [object Object] and the AI cannot read the data. Always stringify arrays before injecting them into prompt strings.

Step 3 — Add Structured Output Parsers

Attach a Structured Output Parser to each AI review node so the response always comes back as clean, typed JSON.
  1. For AI Review Blog: use the Schema (JSON string) method in the parser.
  2. For AI Review YouTube: use the Generate From JSON Example method in the parser.
  3. Provide an example JSON like {"pass": true, "score": 4, "notes": "missing keyword"} so n8n infers the correct types.

Note — These two parser methods produce different output types for the pass field. The Schema method returns "true" as a string; the Generate From JSON Example method returns true as a boolean. You must configure the IF node to match the correct type for each workflow.

Step 4 — Add IF Nodes to Route Pass vs. Fail

Insert an IF node after each review node to split the workflow into a passing branch and a failing branch.
  1. In T6-Content-Child-Blog, add an IF node named Check Pass.
  2. Set its condition on $json.pass:
    • Because the Blog parser returns a string, set the condition to String → equals → "true" — not Boolean.
  3. In T6-Content-Child-YouTube, add an IF node named Check Pass YT.
  4. Set its condition to Boolean → is true because the YouTube parser returns a real boolean.
  5. Connect the True branch of each IF node to the existing publish nodes (POST Draft Blogger, Create Google Doc).
  6. Connect the False branch of each IF node to a Google Sheets Append node targeting the Sheet T6-Rejected.

Tip — Mixing up string "true" and boolean true in IF conditions is one of the most common silent bugs in n8n. If your IF node always routes to the False branch despite the AI passing content, this type mismatch is the first thing to check.

Step 5 — Fix Cross-Node References After IF Node Insertion

After inserting the IF node, all downstream nodes lose their direct $json context — this is a critical gotcha in this n8n tutorial.
  1. Understand what changed: after the IF node, $json inside downstream nodes refers to the IF node's output (only the review result), not the original formatted content.
  2. In POST Draft Blogger, replace any $json.xxx references with explicit cross-node refs, for example:
    • $('Format HTML').item.json.title
    • $('Format HTML').item.json.html_content
  3. Apply the same fix to Create Google Doc — reference the correct upstream node by name for every field it needs.
  4. For the YouTube child workflow, confirm that Create Google Doc is placed after the IF node, not before it. An earlier misplacement caused it to run regardless of review outcome.

Note — Cross-node references like $('NodeName').item.json.field are the reliable way to reach data from any earlier node in the chain. Make this your default approach whenever the data path passes through a branching node like IF, Switch, or Merge.

Step 6 — Fix HTML Content in POST Draft Blogger Body

Passing HTML as a raw JSON string in the request body breaks when the content contains special characters.
  1. Identify the problem: html_content contains double quotes and newlines, which corrupt the raw JSON string body.
  2. Switch the POST Draft Blogger node's body mode from Raw JSON string to Body Parameters (key-value pairs).
  3. Map each field (title, content, labels, etc.) as a separate key-value entry — n8n handles escaping automatically in this mode.

Tip — Whenever you're sending HTML or any user-generated text in an HTTP request body, key-value / Body Parameters mode is safer than raw JSON strings. n8n escapes the values for you, eliminating an entire class of encoding bugs.

Step 7 — Set Up the T6-Rejected Sheet Log

Route failed content to a dedicated Google Sheet so you can review and fix it later.
  1. Create a new Google Sheet named T6-Rejected.
  2. Define these columns: timestamp, topic, score, notes.
  3. In the False branch of each IF node, connect a Google Sheets → Append Row node targeting this sheet.
  4. Map the fields:
    • timestamp: {{ $now }}
    • topic: cross-node ref to the topic field from the trigger
    • score: $json.score
    • notes: $json.notes

Step 8 — Pass row_number into Child Workflows and Fix Mark Done

Matching sheet rows by topic string is fragile; switching to row_number makes the Mark Done update reliable.
  1. Open the child workflow's trigger node (When Executed by Another Workflow) and add a new input field: row_number (type: Number).
  2. In the parent workflow (T6-Content-Factory-Dispatch), open the Call Child Blog Workflow node and click Refresh Input List to see the new field.
  3. Map the parent's row_number value into the new field.
  4. In the Mark Done node, change the row-matching logic from topic string to row_number (number match).

Tip — String-based row matching fails silently when there's a whitespace difference or encoding mismatch between the sheet and the workflow variable — you get "No output data returned" with no clear error. Number-based matching with row_number is deterministic and always safe.

Step 9 — Test End-to-End: Pass and Fail Paths

Run a full test covering both branches to confirm the quality gate works correctly.
  1. Trigger the dispatch workflow with a topic that will produce high-quality content (score ≥ 4).
  2. Verify the True branch executes: Blogger draft is posted, Google Doc is created, Sheet status is updated to done.
  3. Temporarily lower the pass threshold or submit a topic with missing fields to force a fail.
  4. Verify the False branch executes: a new row appears in T6-Rejected with correct timestamp, topic, score, and notes.
  5. Confirm Mark Done updates the correct row (matched by row_number, not topic string).

Key Lessons from This Session

  1. Cross-node refs break after IF nodes. Once your data path passes through a branching node, $json no longer points to earlier content — always use $('NodeName').item.json.field explicitly.
  2. HTML in raw JSON bodies causes silent corruption. Switch to Body Parameters (key-value) mode and let n8n handle escaping automatically.
  3. Structured Output Parser type depends on the method used. Schema JSON string → returns pass as a string; Generate From JSON Example → returns pass as a boolean. Your IF condition must match the actual type.
  4. Child workflow inputs require declaration in the trigger first. The parent cannot pass a new field like row_number until the child's trigger node declares it, followed by a Refresh Input List in the parent.
  5. Use row_number, not topic strings, for sheet row matching. String matching fails silently on whitespace or encoding differences; number matching is deterministic.
  6. Always JSON.stringify arrays in prompt expressions. Arrays passed raw into User message expressions render as [object Object], making them unreadable to the AI model.

Conclusion:

In this n8n workflow automation tutorial, we added a full AI-powered quality gate to a Content Factory — covering checklist design, structured output parsing, IF-based routing, rejected content logging, and reliable row matching. These patterns make your automation genuinely production-ready by catching bad content before it ever reaches a live channel. Next session we move into Week 7 and start building our first AI Agent in n8n.

If you have any questions, feel free to leave a comment below. Thank you!

Tags: n8n quality control automation, n8n tutorial, n8n workflow automation, AI review workflow, content factory n8n, structured output parser n8n, quality gate pattern, n8n IF node

Maybe you are interested!

Building Android Apps Directly in Google AI Studio: No Coding Required

Anyone can start building projects, web apps, and mobile applications using Vibe Coding—software development has never been more accessible. Here's the thing: plenty of people have tested and evaluated software extensively, but many lack hands-on experience actually building it. Yet with Google AI Studio, you can create your first functional Android app in less than 30 minutes flat. What's interesting here is that you don't need Android Studio, APK compilation knowledge, or even basic coding skills.

Google AI Studio now supports building Android applications directly in your web browser—you can skip the traditional Android Studio workflow entirely and go straight to deploying APKs. Transform a basic web application concept into a standalone APK that installs locally on all your Android phones and tablets.

Google AI Studio Makes Android Development Genuinely Simple

Programming experience is optional—you won't need to download IDEs like Android Studio

If you've already spent time with AI chatbots like Gemini, you already understand how to use Google AI Studio. Gemini powers this entire experience, bringing the same natural language comprehension you'd find in the dedicated app. Here's how to get started: open AI Studio in your browser (Chrome works best) and click New app from the sidebar. Then select Build an Android app under the Tools section. This tells AI Studio to use Kotlin and the Android SDK to generate a native Android application based on your prompt.

Your prompt can be as simple or detailed as you want. Need inspiration? Click the I'm feeling lucky button to generate a random sample prompt for an Android project—then hit Build to send it to Gemini. Better yet, use these examples as a springboard for a custom prompt that describes exactly what you want your new Android app to do.

One developer loved a web app they'd built months earlier and wanted to recreate it as a native Android application using AI Studio's new capabilities. They crafted this prompt and hit Build:

Build a vinyl discovery app that uses a Discogs web crawler to display album cards for every entry in my collection. Each album card should have a title, artist, album artwork, and any key release notes. Add a shuffle function that selects a random album from my library. Finally, ensure the UI is responsive and optimized for tablet and mobile viewing. Prioritize light mode design.

The initial request wasn't perfect—their first few attempts at creating the Android app didn't go smoothly. The original prompt leaned too heavily on paid APIs requiring keys to access. Since this was a personal project, they needed to eliminate paid services entirely. They refined the prompt to use Gemini and Google AI Studio's built-in web scraping tools to fetch data without API keys. After that adjustment, everything worked as expected.

You might avoid the same API complications, but you'll definitely hit a few snags during the development process. The good news? There are straightforward solutions. Google AI Studio supports conversational prompting. You can preview your Android app as it's being built, test the design, and verify features before deploying to your device. Follow-up prompts tell Gemini and AI Studio exactly what to fix, add, or refine. Sometimes you'll need to start fresh with a completely new prompt to resolve persistent issues.

Another approach: ask Gemini to write the perfect prompt for you. This is called meta prompting—requesting one AI model (Gemini) to create a detailed, optimized prompt for another AI tool (Google AI Studio).

Skip Programming Knowledge and Web Hosting Fees

Compiling an app into an installable APK file is genuinely transformative


Google AI Studio on Motorola Razr Fold

Building web apps with Vibe Coding tools is straightforward, but creating native Android apps traditionally requires significantly more effort. People gravitate toward Vibe Coded applications for personal projects because Google AI Studio packages them neatly into native Android APK files without needing Android Studio at all. The real concern is that this approach makes apps less dependent on cloud servers while eliminating expensive hosting fees. For private applications you're not planning to distribute publicly, installing a Vibe Coded APK from AI Studio beats any cloud-based solution.

However, AI Studio has one limitation—it won't provide a downloadable APK file for distribution. Google's dedicated Android development environment (which handles this feature) is more complex, but it does allow you to download APKs and share them wirelessly across Android devices for quick installation. Instead, Google AI Studio relies on Android Debug Bridge (ADB) and USB debugging to install apps directly on your Android phone or tablet.

To enable USB debugging, open your Settings app and tap About phone. Find your build number or version number in the list and tap it seven times. This activates Developer options, which you'll need for USB debugging. Navigate to Settings → System → Developer options → USB debugging and toggle it on. Then head back to your AI Studio project on your computer.

Note: You need Chrome to install apps on Android devices from Google AI Studio using USB debugging.

From there, click the Install button in the top-right corner of the app preview window in AI Studio. Connect your phone via USB and tap Install via USB. Within seconds, the app installs and launches automatically on your Android device. Seriously, that's it.


Discogs Shuffle app created with Google AI Studio

After roughly 30 minutes building in AI Studio and a few minutes of debugging, you've got a custom Android app. AI Studio does take considerable time to process, but most of that happens in the background without requiring manual intervention. Submit a prompt, let AI Studio work, then return later to refine with another prompt or test and install the finished application.

The experience isn't flawless—experienced developers or those willing to learn might prefer more traditional IDEs—but it absolutely produces a working Android app. The best part about using Vibe Coding tools like Google AI Studio? Creating an Android application that actually solves your specific needs.

Related Articles

Building Interactive Sequencing Activities on Educaplay with AI

Educaplay's Line Up feature is a game-changer for building interactive learning activities powered by artificial intelligence. It lets you design ordering games in minutes—where students drag and drop cards to arrange them in the correct sequence. Just enter your topic or lesson content, and the AI generates complete card sets automatically. What's interesting here is how much friction it removes from the activity creation process.

The standout advantage of Line Up AI is the massive time savings. Instead of manually writing every question and answer pair, AI handles content generation in seconds. You still have full control to add more topics afterward if needed. Here's how to build your first interactive sequencing game on Educaplay.

How to Create an Interactive Ordering Game on Educaplay

Step 1:

Head to the Educaplay resource editor below and set up your account.

https://www.educaplay.com/resource-editor/

Once you're in, select the Line Up application to start building your game.

You'll see two content creation options: build manually or use AI.

For manual creation, you'll enter all card content yourself and organize each one according to your chosen criteria.

Step 2:

For the AI-powered approach, configure your content settings as shown below.

Enter your topic, then hit Generate to let the system build your ordering cards automatically.

Step 3:

Wait a moment while the system creates your sequencing activity, then click Start to begin playing.

The interactive interface appears as shown. Drag and drop each card following the on-screen instructions. Once you've arranged everything, hit the check button to verify your ordering is correct.

You can add new topics anytime, and Educaplay will automatically generate fresh card sets for sequencing exercises.

Step 4:

Go to My Games in the left sidebar to view all your created activities. Click the three-dot menu next to your Line Up game and select Edit.

From here, you can add additional topics to expand your game and offer more sequencing challenges.

Step 5:

Ready to share? Click the share icon and you'll get a shareable game link to distribute to students.

  • Access the interactive sequencing activity on Educaplay

Related Articles

n8n tutorial - Lesson 23: Production-Ready n8n Workflows: Hardening and Scheduling

n8n tutorial - Lesson 23: Production-Ready n8n Workflows: Hardening and Scheduling

Hi everyone, in this post we're covering how to harden a multi-workflow n8n automation into a true n8n production workflow — adding error handling, scheduling, and live alerting. This is Session 23 of the n8n Workflow Automation Tutorial series, and it's where your Content Factory stops being a manual prototype and starts running reliably on its own.

How to do:

Step 1 — Verify Initial Workflow States

Before making any changes, confirm the starting state of all four workflows to avoid activating them in the wrong order.
  1. Open your n8n dashboard and check that T6-Content-Factory-Dispatch, T6-Content-Child-Blog, and T6-Content-Child-YouTube are all Inactive.
  2. Confirm that T6-B1-Error-Handler is already Active. This is the baseline — the error handler must be live before you test anything.

Note — If any child workflow is Active before you configure its error settings, deactivate it now. You want a clean slate before touching the node settings.

Step 2 — Set "On Error = Continue (using error output)" on Execute Sub-workflow Nodes

This setting prevents a child workflow failure from silently killing the entire parent run — it routes the error into a visible output instead.
  1. Open T6-Content-Factory-Dispatch (the parent workflow) in the editor.
  2. Click the Execute Sub-workflow node that calls T6-Content-Child-Blog.
  3. Go to Settings inside that node and find the On Error dropdown. Set it to Continue (using error output).
  4. Repeat the same three actions for the Execute Sub-workflow node that calls T6-Content-Child-YouTube.
  5. Save the parent workflow after both nodes are configured.

Tip — After selecting Continue (using error output), you will notice a new red output pin appears on the Execute Sub-workflow node. This is expected behavior — it is the error branch. You do not need to connect it to anything right now; it simply means errors will no longer crash the execution silently.

Step 3 — Replace Manual Trigger with a Schedule Trigger

Swapping out the Manual Trigger for a Schedule Trigger is what makes this an automated n8n production workflow instead of a tool you run by hand.
  1. Inside T6-Content-Factory-Dispatch, click the existing Manual Trigger node and delete it.
  2. Add a new Schedule Trigger node from the node panel.
  3. Configure it with the following values:
    • Trigger Interval: Days
    • Hour: 8
    • Minute: 0
  4. Connect the output of Schedule Trigger to the first node in your existing flow (the same connection the Manual Trigger had).
  5. Save the workflow.

Step 4 — Attach the Error Workflow to All Three Workflows

Assigning T6-B1-Error-Handler as the error workflow for each of the three workflows ensures that any unhandled failure fires a Telegram alert automatically.
  1. Open T6-Content-Factory-Dispatch and go to Workflow Settings (the gear icon or top menu).
  2. Find the Error Workflow field and select T6-B1-Error-Handler from the dropdown. Save.
  3. Open T6-Content-Child-Blog, go to Workflow Settings, set Error Workflow to T6-B1-Error-Handler. Save.
  4. Open T6-Content-Child-YouTube, go to Workflow Settings, set Error Workflow to T6-B1-Error-Handler. Save.

Note — The Error Workflow field only accepts workflows that are already Active. Since you verified T6-B1-Error-Handler is Active in Step 1, it will appear in the dropdown without issues.

Step 5 — Activate All Three Workflows in the Correct Order

n8n enforces a strict activation order: child workflows must be Active before the parent, or you will get a not published error when activating the parent.
  1. Activate T6-Content-Child-Blog first — toggle it to Active and confirm the status turns green.
  2. Activate T6-Content-Child-YouTube second — same process.
  3. Activate T6-Content-Factory-Dispatch last — only after both children are confirmed Active.

Production tip — Always follow the child-before-parent activation order whenever you deactivate and reactivate these workflows later. Forgetting this is the most common reason for the not published error in multi-workflow n8n setups.

Step 6 — Run a Clean Production Test

Test the live production execution path (not the UI test button) to confirm everything runs without errors.
  1. Inside T6-Content-Factory-Dispatch (which is now Active), click Execute once to trigger a production-mode run.
  2. Go to the Executions tab and confirm all runs show a Success status.
  3. Check your Telegram channel — if there are no workflow errors, no alert message should arrive. Silence here is correct behavior.

Tip — The UI test button (the flask/beaker icon) does not trigger the Error Workflow even if an error occurs. Only executions running from an Active workflow trigger the Error Handler. Always use Execute once from an Active workflow when you want to test production error alerting.

Step 7 — Inject a Fake Error to Verify Telegram Alerting

Deliberately breaking one child workflow confirms that your error alerting pipeline actually works end-to-end.
  1. Open T6-Content-Child-Blog and locate the HTTP Request node that calls your content endpoint.
  2. Change its URL to an intentionally wrong value (for example, add _broken to the end of the URL).
  3. Save T6-Content-Child-Blog — it remains Active with the bad URL.
  4. Go back to T6-Content-Factory-Dispatch and click Execute once again.
  5. Check Telegram — you should receive an error alert from T6-B1-Error-Handler within seconds. ✅
  6. Go back to T6-Content-Child-Blog, restore the correct URL, and save.
  7. Run Execute once one more time — confirm executions are clean and no Telegram alert fires.

Step 8 — Deactivate the Parent Workflow Until Needed

After the session, deactivate T6-Content-Factory-Dispatch to prevent it from running automatically at 8:00 AM until you are ready.
  1. Toggle T6-Content-Factory-Dispatch to Inactive on the dashboard.
  2. Leave T6-Content-Child-Blog, T6-Content-Child-YouTube, and T6-B1-Error-Handler as Active.
  3. When you want the schedule to run again, toggle the parent back to Active with one click — no other changes needed.

Note — Keeping the children Active while the parent is Inactive costs nothing and means reactivation later is instant. This is a clean pattern for managing n8n workflow automation schedules you want to pause temporarily.

Key Lessons from This Session

  1. Child workflows must be activated before the parent. n8n throws a not published error if the parent is activated while any child is still Inactive. Order: child Blog → child YouTube → parent Dispatch.
  2. The UI test button does not trigger the Error Workflow. You must run from an Active workflow using Execute once to test real error alerting behavior.
  3. "Continue (using error output)" adds a red output pin — this is normal. The pin is the error branch; you do not need to wire it up immediately, but it makes errors visible instead of swallowing them.
  4. Silence on Telegram after a clean run is the correct behavior. If no errors occur, no alert should fire — confirm this during your clean test run.
  5. Deactivating only the parent is enough to pause the schedule. Children and the error handler can stay Active, making re-enabling the whole system a one-click action.

Conclusion:

In this session of the n8n tutorial series, we transformed a manually-run Content Factory into a hardened n8n production workflow with scheduled execution, multi-level error handling, and live Telegram alerting. The end result is a system where failures surface immediately, the schedule is easy to pause and resume, and every layer — parent and children — is protected by the same error handler. Next up, we'll look at adding a quality gate using an AI review checklist before content gets posted, or extending the pattern with a new Email child workflow.

If you have any questions, feel free to leave a comment below. Thank you!

Tags: n8n production workflow, n8n tutorial, n8n workflow automation, n8n schedule trigger, n8n error handling, n8n execute sub-workflow, n8n content factory, workflow automation tutorial

Maybe you are interested!

Generate Student Assessment Rubrics Instantly with AI on Canva

Creating rubrics from scratch is tedious. That's where Canva's AI Rubric Maker comes in—a smart tool that generates assessment criteria templates in seconds. Instead of manually building evaluation frameworks, teachers can now leverage AI to produce structured grading rubrics based on specific criteria like content quality, technical skills, completion level, and creativity. A rubric itself is a scoring matrix used to grade assignments, projects, presentations, and other student work using predefined standards.

What makes this tool particularly useful is how it combines AI generation with Canva's design capabilities. The AI Rubric Maker generates an initial framework based on your input, then Canva lets you polish it into a visually appealing, printable format ready to share with students before they begin work. This transparency helps students understand exactly what's expected, while giving teachers a consistent evaluation framework. Here's how to set it up.

Step-by-Step Guide: Building Assessment Rubrics on Canva

Step 1: Access the AI Rubric Maker

Open Canva and tap the three-dot menu icon, then select Apps from the dropdown menu.

Type rubric into the search bar. Select the AI Rubric Maker result that appears.

Click on the AI Rubric Maker app to launch it.

You'll see an option to start with a new design or use an existing template. Choose your preference and continue.

Step 2: Configure Your Rubric Parameters

A new panel appears on the left side with input fields for your rubric settings. First, select Vietnamese as your language (or choose your preferred language for output).

Now fill in the remaining fields. For example, if you're grading student presentations, you'd add:

Learning Standards/Objectives:

Students will demonstrate the ability to construct and deliver clear presentations with accurate content, appropriate visual aids, and effective communication skills before an audience.

Task Description:

Students prepare a presentation on an assigned topic. The presentation must include an introduction, main content, conclusion, and relevant images or examples. Students should demonstrate presentation skills, explain concepts clearly, and answer questions from the teacher and peers.

When you're done entering information, click Generate.

Step 3: Add to Your Design

Wait a moment while the AI generates your evaluation criteria based on what you entered. Once the rubric appears, click Add to Design.

Your AI-generated assessment rubric is now embedded in your Canva design.

AI-generated rubric on Canva

What's important here is the next part: review and edit the generated content to ensure it aligns with your curriculum and your students' skill level. The AI gives you a solid starting point, but your professional judgment should shape the final rubric.


Related Articles

Copyright © 2016 QTitHow All Rights Reserved