n8n tutorial - Lesson 26: n8n Multi-Tool AI Chatbot: Internal Knowledge Assistant

Hi everyone, in this session we're building a multi-tool internal knowledge assistant using an n8n chatbot workflow — an AI agent that pulls data from multiple Google Sheets sources and synthesizes it into a single natural-language report. This is part of our ongoing n8n workflow automation tutorial series, and it's where the real power of agents over fixed workflows becomes clear.

How to do:

Step 1 — Upgrade Your Existing Agent with Three New Tools

Open your base agent workflow (here: T7-B1-First-Agent) and add three new Google Sheets tool nodes — each connecting to a different data source.
  1. Open the workflow and click the + button inside the AI Agent node's Tools section to add a new tool.
  2. Add the first tool: set Name to get_rejected_content, connect it to the Google Sheets node pointing to spreadsheet T6-Rejected, tab Sheet1.
  3. Add the second tool: set Name to get_youtube_performance, connect it to spreadsheet T5-Performance-Snapshots, tab Snapshots.
  4. Add the third tool: set Name to get_comments_queue, connect it to spreadsheet T5-Comments-Queue, tab Queue.
  5. For each tool, fill in the Description field immediately — describe what data it returns so the agent can decide when to call it.

Note — Always configure all four fields — Name, Description, Operation, and Document/Sheet — in one go. Skipping Description means the agent won't know when to invoke the tool, and you'll have to go back and re-edit each node.

Step 2 — Add a System Prompt to Define the Agent's Role

The System Message field in the AI Agent node is where you define the agent's persona, default language, and response behavior — without it, the agent gives raw data dumps instead of useful summaries.
  1. Click the AI Agent node to open its settings, then locate the System Message field.
  2. Write a prompt that:
    • Declares the agent's role (e.g., "You are an internal assistant for a content team.")
    • Specifies the response language appropriate for your team.
    • Instructs the agent to summarize insights rather than list raw data.
  3. Save the node after entering the system prompt.

Tip — The system prompt is the single biggest lever for output quality. Telling the agent to "summarize insights, not raw rows" transforms the response from a data table into an actionable briefing.

Step 3 — Test the Daily Briefing (Multi-Tool Parallel Call)

Send one natural-language question to verify the agent calls all three tools and synthesizes a combined report.
  1. Open the workflow's test chat or trigger a manual execution.
  2. Send the message: Give me a full system overview report for today.
  3. Watch the execution log — the agent should call all three tools in parallel: get_rejected_content, get_youtube_performance, and get_comments_queue.
  4. Verify the output contains all four sections:
    • YouTube performance summary
    • Blog/rejected content status
    • Comment queue overview
    • A "needs action" section highlighting items requiring follow-up

Note — This is the core advantage of an agent over a fixed n8n workflow automation: one free-form question triggers dynamic multi-tool reasoning. A scheduled workflow would require you to hardcode exactly which nodes run and in what order.

Step 4 — Build the Telegram Chatbot Workflow

Create a new workflow named T7-B2-Telegram-Chatbot that chains a Telegram trigger, the AI agent, and a Telegram reply node.
  1. Create a new workflow and add a Telegram Trigger node as the entry point — this listens for incoming messages via webhook.
  2. Add an AI Agent node and configure it with the same four tools and system prompt from Steps 1–2.
  3. Add a Simple Memory node and connect it to the AI Agent's memory input so conversation context persists across messages.
  4. Add a Telegram node (Send Message operation) and wire it to the agent's output to return the response to the user.
  5. Set the model to Claude Haiku 4.5 (or your preferred model) in the AI Agent node.

Step 5 — Handle the Localhost / HTTPS Limitation for Telegram

Telegram Trigger uses a webhook, which requires a publicly accessible HTTPS URL — this is the wall you'll hit when running n8n locally.
  1. Understand the constraint:
    • Telegram webhooks only POST to HTTPS public URLs.
    • A local localhost n8n instance has no public URL, so Telegram can't reach it.
  2. Attempt with ngrok (common workaround):
    • Install ngrok and get an HTTPS tunnel URL.
    • Open docker-compose.yml and add the environment variable N8N_WEBHOOK_URL=https://your-ngrok-url.
    • Restart the container: run docker-compose down && docker-compose up -d.
    • Verify the variable was applied: run docker exec <container_name> env | findstr N8N_WEBHOOK_URL.
  3. Accept the result: ngrok free tier is too unstable for Telegram webhooks in practice — tunnels disconnect, Telegram stops receiving events.
  4. Leave T7-B2-Telegram-Chatbot as Inactive until you deploy to a VPS with a real domain and HTTPS certificate.

Production tip — The real fix is deploying n8n on a VPS with a proper domain and HTTPS — the same requirement as Human-in-the-Loop workflows. ngrok is fine for quick testing but not reliable for any trigger that depends on an external service pushing data to you.

Note — When working with Docker, remember that the container name shown by docker ps is not always the same as the service name in docker-compose.yml. Always use docker ps to find the real container name before running docker exec commands.

Step 6 — Audit API Costs and Decide Which Workflows to Keep Active

Some scheduled workflows call an AI model on every item every run — these accumulate cost fast and should be deactivated when not needed.
  1. Identify high-cost workflows to deactivate:
    • T5-B2-Comment-Pipeline — runs every 30 minutes, calls Claude for every comment. Primary cost driver.
    • T2-B4-Email-Classifier — runs every 15 minutes, calls Claude for every email.
  2. Identify safe workflows to keep active (no AI calls or infrequent calls):
    • T6-B1-Error-Handler — no AI node.
    • T5-B2b-Reply-Sender — no AI node.
    • T5-B3b-Title-Updater — no AI node.
    • T5-B4-Performance-Insight — weekly schedule, one AI call per run.
    • T5-B7-Weekly-Digest — weekly schedule, one AI call per run.
  3. Toggle the high-cost workflows to Inactive in the n8n dashboard until you're ready to run them intentionally.

Tip — A per-item AI call inside a frequent schedule is the fastest way to drain API credits. The rule: if a workflow calls an AI model in a loop and runs more than once per hour, treat it as high-cost by default and run it manually or reduce its frequency.

Key Lessons from This Session

  1. Always fill in the tool Description field immediately. The agent uses this text to decide which tool to call — a blank description makes the tool invisible to the agent's reasoning.
  2. One question → multi-tool parallel execution is the agent's core value. A fixed n8n tutorial workflow can automate a known sequence; an agent handles unknown, flexible queries by choosing tools dynamically.
  3. Telegram Trigger requires a real HTTPS public URL. ngrok free tier is not reliable enough for production webhooks — deploy to a VPS for any external trigger.
  4. Set environment variables in docker-compose.yml, not in the running container. Use docker-compose down && docker-compose up -d to apply changes, and verify with docker exec.
  5. Frequent scheduled workflows with per-item AI calls are the main API cost risk. Audit and deactivate them when not in active use.
  6. Agent vs. fixed workflow is a design choice, not a default. Use agents when the query is unpredictable or requires reasoning; use fixed workflows for known, repeatable automation sequences.

Conclusion:

In this n8n tutorial session, we turned a single-tool agent into a full internal knowledge assistant by connecting it to three Google Sheets data sources, adding a system prompt, and validating multi-tool parallel execution with one natural-language question. We also built a Telegram-connected n8n chatbot workflow, hit the real-world HTTPS limitation of local deployments, and learned how to audit API costs across the entire automation stack. The next session will explore either scheduled agent automation, custom code tools, or a VPS deployment to unlock Telegram and Human-in-the-Loop workflows — all key milestones in n8n workflow automation.

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

Tags: n8n chatbot workflow, n8n tutorial, n8n workflow automation, AI agent n8n, n8n Google Sheets, Telegram bot n8n, n8n multi-tool agent, n8n localhost webhook

Maybe you are interested!