Ultimate Multi-Language RAG Chatbot with Automated Data Pipelines - n8n Workflow

Build an advanced multi-language RAG chatbot using a comprehensive n8n workflow. Integrates Telegram, OpenAI, Supabase vector database, Google Drive, and automated web scraping.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical teams requiring a scalable, AI-powered customer support or internal knowledge base tool.

  • Developers looking for advanced n8n templates integrating LangChain agents, RAG, and multi-cloud data sources.

  • Businesses needing an automated, multi-language conversational interface via Telegram.

  • Automation specialists seeking to implement complex data ingestion pipelines (web scraping, document indexing) within an n8n workflow.

Overview

This comprehensive n8n workflow template provides a production-ready solution for deploying a Retrieval-Augmented Generation (RAG) chatbot accessible via Telegram, complete with automated content ingestion and cleanup routines. The value of this n8n automation lies in its modularity and multi-language support, routing user queries through a sophisticated Supervisor AI Agent that directs the request to specialized RAG knowledge bases (Product, Academy, News). It solves the challenge of providing up-to-date, relevant answers across multiple data sources (Google Sheets, documents, scraped web data) by maintaining a synchronized Supabase vector store. This particular n8n workflow is a powerful example of how to leverage cutting-edge AI tools with robust cloud services.

How it Works

This vast n8n workflow is divided into three major operational pillars:

1. Data Ingestion Pipeline (Web & Documents)

Web Scrape Ingestion: A manual or scheduled n8n trigger starts the process. The flow reads website links from a Google Sheet, filters them, and uses an HTTP Request to crawl the content (via Crawl4AI). The resulting data is formatted by an OpenAI Agent and saved to a Google Doc, updating the link status in the Google Sheet. This demonstrates a flexible data preparation system.
Google Drive Ingestion: The n8n workflow is triggered by new or updated files in Google Drive (via the Google Drive n8n trigger). The system downloads the file, uses the 'Extract From File' n8n node to handle documents and PDFs, performs text splitting using a Character Text Splitter, generates vector embeddings via the Embeddings OpenAI n8n node, and finally inserts the vectorized data into the Supabase Vectorstore for RAG retrieval.

2. Chatbot Core Logic

Telegram Interaction: The flow starts with a Telegram n8n trigger when a user sends a message. The incoming message is first routed through a sequence of Translator AI Agents (using OpenAI Chat Model) and Structured Output Parsers to determine the user's language and translate the query into English for efficient processing by the RAG system. A temporary 'Telegram Waiting' message is sent back to the user.
Supervisor AI & RAG: The core logic runs through the Supervisor AI Agent (using OpenAI Chat Model 5 and Postgres Chat Memory for context). This supervisor agent evaluates the user's request and routes it to one of the specialized RAG agents: Product, Academy, or News. Each RAG AI Agent uses dedicated tools (Supabase Vector Store, Google Sheets Tool, or Postgres Tool) to query its specific knowledge base.

3. Response and Translation

The retrieved response is passed back to the main flow. An 'If English' n8n node checks the original user language. If translation is needed, the 'Output Translator' AI Agent translates the final English response back into the user's native language using the OpenAI Chat Model 2. The final message is merged and sent back to the user via the 'Send a text message' Telegram n8n node.

4. Cleanup and Maintenance

A dedicated 'Schedule Trigger1' runs periodically to fetch document IDs and links from Google Sheets and Supabase. The flow uses Supabase n8n nodes to delete old vector data and Google Sheets n8n nodes to clear metadata, ensuring the knowledge base remains clean and relevant.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Credential Setup: This n8n workflow requires multiple credentials. You must set up connections for:

OpenAI: Required for all LLM calls and Embedding generation.
Telegram: Required for the main chatbot trigger and response nodes.
Google Drive/Docs/Sheets: Required for data ingestion and metadata management.
Supabase: Required for the vector store database where RAG data is indexed.
* Postgres: Required for the Product RAG agent (Query Products node) and Chat Memory.

  1. Configure Service Nodes: For the HTTP Request - Crawl4AI n8n node, ensure the URL and any necessary authentication headers for the external web scraping service are correctly configured.

  2. Activate Trigger Nodes: Configure the Google Drive File Created/Updated n8n triggers to monitor the correct folders where documents will be uploaded. Configure the Schedule Trigger1 for your desired cleanup frequency.

  3. Activate Workflow: Once all credentials and settings are verified, activate the n8n workflow to make the Telegram chatbot live and enable the automated ingestion pipelines.

Node Details

Telegram Trigger (n8n trigger): The entry point for the chatbot, listening for incoming Telegram messages.
OpenAI Chat Model (n8n node): Used extensively across the workflow for LLM generation, translation, and agent decision-making. Essential for the RAG agents.
Supervisor AI Agent (n8n node - LangChain): Acts as the router, analyzing the incoming translated query and delegating the retrieval task to the appropriate specialized RAG agent (Product, Academy, or News).
Supabase Vector Store (n8n node - LangChain): The primary knowledge retrieval tool for RAG agents, storing and searching document embeddings generated by the Embeddings OpenAI n8n node.
Google Sheets (n8n node): Used for retrieving lists of URLs for scraping, monitoring file metadata, and scheduled row cleanup.
HTTP Request - Crawl4AI (n8n node): Used in the Web Scraping pipeline to fetch raw content from URLs before it is processed and vectorized.
Extract From Document / Extract From PDF (n8n node): Handles parsing various file types during the Google Drive document ingestion process.
Character Text Splitter (n8n node - LangChain): Prepares text data for embedding by breaking large documents into smaller, searchable chunks, optimizing RAG performance.


  • Schedule Trigger1 (n8n trigger): Ensures periodic maintenance by initiating the cleanup routine for outdated knowledge base entries.

Related n8n Workflows

Paid

Nodes: 32 Nodes
Updated: December 26 2025
View all
Created by

A Growth Hacker, Digital Marketer & AI Automation Builder with 10+ years of experience in Digital Marketing & Workflow Automation. Based in Helsinki, Finland. For questions about my templates and customization, contact me at: [email protected]

Featured*