Multi-Modal Telegram Customer Support Chatbot with Supabase RAG - n8n Workflow

Deploy a powerful n8n workflow for a Telegram chatbot that handles text, audio, images, and documents. Uses GPT-4, Supabase RAG, and persistent conversation memory.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Companies seeking to automate first-line customer support using Telegram.

  • Developers looking for advanced n8n templates integrating multiple AI services (OpenAI, Supabase, Cohere).

  • Users needing a robust n8n workflow that handles complex data types (images, documents, audio).

  • Anyone needing an n8n solution for RAG functionality in a live chat environment.

Overview

This sophisticated n8n workflow transforms a standard Telegram bot into a powerful, multi-modal AI customer support agent. The main challenge solved is accepting and processing diverse user inputs—including voice messages, images (analyzed using OpenAI Vision), PDFs, spreadsheets, and Word documents—and using that context to provide accurate, grounded answers. This comprehensive n8n workflow leverages Retrieval-Augmented Generation (RAG) by storing proprietary knowledge in a Supabase Vector Database. The result is a highly effective, context-aware chatbot implemented entirely using n8n node logic, minimizing external coding needs. This complete n8n solution showcases advanced AI integration capabilities.

How it Works

The process begins with the Telegram Trigger n8n node, which activates upon receiving any user message. This specialized n8n trigger immediately signals the start of the n8n workflow.


  1. Initial Routing & UX: Upon receiving a message, the n8n workflow first sends a "Typing…" action for immediate user feedback. The Input Message Router (an n8n Switch node) then directs the flow based on the input type (Text, Audio, Photo, Document).

  2. Multi-Modal Conversion:

Audio (Voice): The voice message is downloaded and translated into text using a dedicated OpenAI n8n node (Translate to Text).
Photo/Image: The image is downloaded, and an OpenAI Vision n8n node analyzes the visual content, converting it into a detailed text description, which is then combined with any user caption.
Documents (Files): The Supported Document File Types custom code n8n node filters inputs, ensuring only valid file types (PDF, DOCX, XLSX, JSON, XML) proceed. Documents are then routed to specialized nodes (like Extract from PDF or the multi-step Convert to text process for Word files) to extract plain text content, ensuring all document types are handled correctly by the n8n workflow.

  1. AI Core Processing: The resulting standardized text input feeds into the Knowledge Base AI Agent n8n node. This agent executes the core logic:

Memory: It uses the Postgres Chat Memory n8n node to maintain conversation history based on the unique Telegram chat ID.
* RAG Tool: It employs the Supabase Vector Store Search n8n node as a tool for grounding answers. This tool queries the vector database using OpenAI embeddings and refines the results using the Reranker Cohere n8n node to retrieve the most relevant knowledge chunks.

  1. Response: The AI model (configured via the OpenAI Chat Model1 n8n node) generates a final answer, grounded in both memory and retrieved knowledge. The final Telegram n8n node sends this response back to the user, completing the n8n workflow execution cycle.

Installation Guide

To deploy and use this powerful n8n workflow, follow these setup steps:


  1. Import: Import the provided n8n workflow JSON data into your n8n instance.

  2. Credentials Setup:

Telegram: Set up a Telegram API credential (Bot Token) and ensure the Telegram Trigger n8n node is activated via webhook.
OpenAI: Set up an OpenAI credential for the LLM operations (GPT-4o-mini) and the Embedding models.
Supabase: Configure a Supabase credential pointing to your database and specify the table (documents) for vector storage.
Postgres: Configure a Postgres credential to enable persistent chat memory via the Postgres Chat Memory n8n node.
ConvertAPI & Cohere: Configure credentials for ConvertAPI (necessary for DOCX conversion) and Cohere (for result reranking).

  1. Knowledge Base Initialization: Before activating the main n8n trigger, you must load your data. Run the initial data loading sequence manually:

Ensure the Download file n8n node points to your external Google Drive knowledge base document.
* Click "Execute workflow" on the initial path (starting at When clicking ‘Execute workflow’) to process the document, create embeddings, and store them in the Supabase vector database using the Add to Supabase Vector DB n8n node.

  1. Activation: Once all credentials are set and the knowledge base is loaded, activate the Telegram Trigger n8n node to start listening for user messages.

Node Details

Telegram Trigger: The primary n8n trigger node, responsible for starting the workflow upon receiving any new message (text, document, photo, voice).
Input Message Router (Switch): A crucial flow control n8n node that dynamically directs the input to the correct processing branch based on the message type.
Download Audio / Translate to Text (OpenAI): This sequence uses a Telegram n8n node to download the audio file, which is then transcribed into plain text by the specialized OpenAI n8n node operation.
Photo to text (OpenAI): An OpenAI LangChain n8n node utilizing Vision capabilities (GPT-4o-mini) to analyze image content and convert visual data into text descriptions.
Supported Document File Types (Code): A custom code n8n node acting as a validator, checking file extensions to ensure compatibility before attempting document extraction.
Extract from PDF / Extract from Spreadsheet: Utility n8n node operations used to parse binary file data from documents into usable text strings within the n8n workflow.
Convert to text (convertapi.com) (HTTP Request): Handles complex file conversions (like DOCX) by routing the data through an external service, demonstrating how an n8n workflow can utilize third-party APIs.
Knowledge Base AI Agent (LangChain Agent): The central processing n8n node that orchestrates the use of memory, tools, and the language model to generate contextually relevant responses.
Postgres Chat Memory: An n8n node used to store and retrieve conversation history, providing long-term context awareness to the AI agent based on the Telegram chat ID.
Supabase Vector Store Search (Tool): An integrated RAG tool n8n node. It queries the Supabase vector database, enabling the AI to retrieve factual, grounded knowledge, augmented by the Reranker Cohere n8n node for precision.


  • Telegram: The final n8n node responsible for delivering the AI-generated output back to the user, concluding the execution of the n8n workflow.

Related n8n Workflows

Free

Nodes: 20 Nodes
Updated: December 26 2025
View all
Created by
Ezema Kingsley Chibuzo
Ezema Kingsley Chibuzo

Automation developer and AI workflow specialist with experience building end-to-end systems using n8n, OpenAI, Supabase, and other modern tools. I help businesses save time and scale operations through smart automation, AI agents, and no-code integrations.

Featured*