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.
Download this n8n workflow template and start using it instantly.
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.
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.
Input Message Router (an n8n Switch node) then directs the flow based on the input type (Text, Audio, Photo, Document).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.Knowledge Base AI Agent n8n node. This agent executes the core logic:Postgres Chat Memory n8n node to maintain conversation history based on the unique Telegram chat ID.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.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.To deploy and use this powerful n8n workflow, follow these setup steps:
Telegram Trigger n8n node is activated via webhook.documents) for vector storage.Postgres Chat Memory n8n node.Download file n8n node points to your external Google Drive knowledge base document.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.Telegram Trigger n8n node to start listening for user messages. 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.
Build a powerful, context-aware chatbot using this advanced n8n workflow. Integrates Claude (Anthropic), Supabase Vector Store, and Postgres chat memory for RAG capabilities.

Build a powerful RAG chatbot using an n8n workflow combining OpenAI, Notion database tools, and conversational memory. Use this n8n template for fast deployment of AI knowledge agents.

Build a powerful RAG chatbot using Google Drive documents and GPT-4o with this comprehensive n8n workflow. Automate knowledge base creation, handle real-time chat requests, and deploy custom n8n templates.

Use this powerful n8n workflow to create a Telegram chatbot integrating multiple AI models via AIMLAPI, complete with daily usage limits tracked in Google Sheets.

Use this expert n8n workflow template to build an intelligent, multi-tool AI Agent. Integrates Gemini or OpenAI, memory, weather lookup, and RSS web scraping in a public chat interface.


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.







































