Skip to main content

Multi-language Telegram RAG chatbot with supervisor AI & automated Google Drive pipeline

Workflow preview

Workflow preview
100%
Multi-language Telegram RAG chatbot with supervisor AI & automated Google Drive pipeline preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

N8N Hybrid RAG Chatbot with Multiple AI Agents One of the most powerful system in the market, this template creates a sophisticated, multi agent hybrid RAG (Retrieval Augmented Generation) chatbot ...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.wait, n8n-nodes-base.googledocs, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.googlesheets, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Daniel Ng.

Original n8n.io source

1.1 Workflow description

Title
Multi-language Telegram RAG chatbot with supervisor AI & automated Google Drive pipeline
Workflow name
Multi-language Telegram RAG chatbot with supervisor AI & automated Google Drive pipeline

N8N Hybrid RAG Chatbot with Multiple AI Agents

One of the most powerful system in the market, this template creates a sophisticated, multi-agent hybrid RAG (Retrieval-Augmented Generation) chatbot that can handle diverse user queries by routing them to a “Supervisor AI agent”. The Supervisor agent will then send the request to “Expert AI agents”, agents specializing in specific domains. In addition, this system automates data ingestion from various sources (including websites and Google Drive), processes and stores the information in a vector database, and interacts with users through Telegram in multiple languages.

For more powerful n8n templates, visit our website at aiautomationpro.org.

Who’s it for?

This template is ideal for:

  • Developers and Businesses looking to build a powerful, knowledge-based chatbot for customer support, internal knowledge management, or lead generation.
  • AI Enthusiasts who want to explore advanced concepts like multi-agent systems, RAG, and automated data pipelines.
  • n8n Users who want to build a scalable and customizable AI solution that integrates multiple services.

Key Features

  • Multi-Agent Architecture: Utilizes a supervisor agent to route queries to specialized agents for different domains (e.g., Products, News, Academy).
  • Automated Data Ingestion: Automatically scrapes data from websites and syncs new or updated files from Google Drive.
  • Retrieval-Augmented Generation (RAG): Enriches the chatbot's knowledge by retrieving relevant information from a Supabase vector store and a Postgres database.
  • Telegram Integration: Provides a seamless, multi-language chat interface for users to interact with the bot.
  • Dynamic Data Handling: Automatically processes and embeds data from various sources like Google Docs, PDFs, and Word documents.
  • Data Management: Keeps the knowledge base up-to-date by automatically handling document creation, updates, and deletions.

How it works

The workflow is divided into three main parts: data ingestion, data management, and the chat interface.

  1. Data Ingestion & Processing:
    • Web Scraping: The workflow fetches URLs from a Google Sheet, scrapes the content using Crawl4ai, cleans it with an AI agent, and saves it to a Google Doc.
    • Google Drive Sync: It monitors specific Google Drive folders for new or updated files (Google Docs, PDFs, Word documents).
    • Embedding & Storage: The content from these sources is then chunked, converted into vector embeddings using OpenAI, and stored in a Supabase vector database for efficient retrieval.
  2. Data Deletion:
    • A scheduled trigger periodically checks a Google Sheet for records marked as "deleted."
    • It then removes the corresponding data from the Supabase vector store and deletes the file from Google Drive to ensure the chatbot's knowledge remains current.
  3. Chat Interface & Logic (Telegram):
    • User Input: The chatbot receives user messages via a Telegram trigger.
    • Language Detection: It first detects the language of the query and translates it to English if necessary.
    • Supervisor Agent: A central "Supervisor" AI agent analyzes the user's query.
    • Agent Routing: Based on the query, the Supervisor delegates the task to the most appropriate specialized agent:
      • News AI Agent: Handles questions about current events.
      • Product AI Agent: Answers queries about product details from a Postgres database.
      • Academy AI Agent: Responds to questions about courses and educational content.
    • Response Generation: The selected agent processes the query, retrieves the necessary information using RAG, generates a response, and translates it back to the user's original language before sending it via Telegram.

Requirements

To use this template, you will need accounts and credentials for the following services:

  • n8n
  • OpenAI
  • Supabase (for vector storage)
  • Google Workspace (Google Drive, Google Sheets, Google Docs)
  • Telegram Bot
  • Postgres Database
  • Crawl4AI

Step-by-step Setup

  1. Configure Credentials: Add your API keys and credentials for all the required services (OpenAI, Supabase, Google, Telegram, Postgres) in the n8n Credentials section.
  2. Set up Google Drive: Create two folders in your Google Drive: one for documents scraped from websites and another for manual document uploads. Note the folder IDs.
  3. Set up Google Sheets:
    • Clone the Google Sheet template, or create a Google Sheet with two tabs: Website Links and Manual Documents.
    • In the Website Links tab, add columns for Link, Category Code, Is Scraped, and Is Deleted.
    • In the Manual Documents tab, add columns for Document ID, Title, Category Code, and Is Deleted.
  4. Set up Supabase:
    • Create a new project in Supabase.
    • Run the provided SQL script to create the documents table for vector storage.
  5. Set up Postgres:
    • Set up a Postgres database (in Supabase).
    • Run the provided SQL script to create the products table to store product details.
  6. Configure the Main Workflow:
    • Open the AIAutomationPro Ultimate RAG Chatbot main workflow.
    • Update the Google Drive, Google Sheets, Supabase, and Postgres nodes with your specific Folder IDs, Sheet Names, and table names.
    • Link the three sub-workflows (News AI Agent, Product AI Agent, Academy AI Agent) in the corresponding Workflow Tool nodes.
  7. Activate Workflows: Activate the main workflow and all three sub-flow workflows.
  8. Start Chatting: Send a message to your Telegram bot to start interacting with your new RAG chatbot.

How to Customize the Workflow

  • Add More Agents: You can create new sub-workflows with specialized agents for different topics (e.g., a "Finance AI Agent"). Simply add a new Workflow Tool node in the main flow and update the Supervisor Agent's system prompt to include the new agent's capabilities.
  • Change Data Sources: Modify the data ingestion part of the workflow to pull data from other sources like Notion, HubSpot, or a CRM by adding the relevant n8n nodes.
  • Adjust the AI Model: You can switch to a different LLM by replacing the OpenAI Chat Model nodes.
  • Modify Prompts: Fine-tune the system prompts in the Agent nodes to alter the personality, instructions, or output format of the chatbot and its specialized agents.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 3 - Google Docs - Create

Type / Role
n8n-nodes-base.googleDocs - googleDocs
Config choices
Version 2

Block 4 - Save Text To Doc

Type / Role
n8n-nodes-base.googleDocs - googleDocs
Config choices
Version 2

Block 5 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - Content Formatter

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 8 - Google Sheets Website Links

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 9 - Loop Over Links

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - If Document ID

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 11 - Update Text To Doc

Type / Role
n8n-nodes-base.googleDocs - googleDocs
Config choices
Version 2

Block 12 - Filter Links

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 13 - Google Sheets Website Links - Update

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 14 - Merge Document Output

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 15 - Get Text From Doc

Type / Role
n8n-nodes-base.googleDocs - googleDocs
Config choices
Version 2

Block 16 - HTTP Request - Crawl4AI

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Edit Fields Settings

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 22 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Download File

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 24 - Delete Old Doc Rows

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Showing the first 24 of 128 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Multi-language Telegram RAG chatbot with supervisor AI & automated Google Drive pipeline
Complexity advanced
Nodes 128
Categories Support Chatbot, AI RAG
Author Daniel Ng
Published 18 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6158/6158.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Multi-language Telegram RAG chatbot with supervisor AI & automated Google Drive pipeline do?

N8N Hybrid RAG Chatbot with Multiple AI Agents One of the most powerful system in the market, this template creates a sophisticated, multi agent hybrid RAG (Retrieval Augmented Generation) chatbot ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI RAG use case.