workflows.fit
Back to n8n workflows
n8n templateFreeBy Ezema Kingsley Chibuzo

Create a multi-modal Telegram support bot with GPT-4 and Supabase RAG

🧠 What It Does This n8n workflow turns your Telegram bot into a smart, multi-modal AI assistant that accepts text, documents, images, and audio messages, interprets them using OpenAI models, and responds instantly wi...

DevelopmentCore NodesCommunicationHITLData & StorageAILangchainTelegram Trigger
Loading interactive preview...

Template notes

🧠 What It Does This n8n workflow turns your Telegram bot into a smart, multi-modal AI assistant that accepts text, documents, images, and audio messages, interprets them using OpenAI models, and responds instantly with context-aware answers. It integrates a Supabase vector database to store document embeddings and retrieve relevant information before sending a prompt to OpenAI — enabling a full RAG experience

💡 Why This Workflow? Most support bots can only handle basic text input. This workflow: - Supports multiple input formats (voice, documents, images, text) - Dynamically extracts and processes data from uploaded files - Implements RAG by combining user input with relevant memory or vector-based context - Delivers more accurate, relevant, and human-like AI responses.

👤 Who It's For

- Businesses looking to automate support using Telegram - Freelancers or solopreneurs offering AI Chatbots for businesses. - Creators building AI-powered bots for real use cases as it's great for Customer support knowledge, Legal or Policy document, long FAQs, Project documentation, and Product information retrieval. - Devs or analysts exploring AI + multi-format input + vector memory.

⚙️ How It Works 🗂️ Knowledge Base Setup Run the “Add to Supabase Vector DB” workflow manually to upload a document from your google drive and embed it into your vector database. This powers the Telegram chatbot’s ability to answer questions using your content. 🔁 Telegram Message Routing 1. Telegram Trigger captures the user message (Text, Image, Voice, Document) 2. Message Router routes input by type using a Switch node 3. Each type is handled separately: - Voice → Translate recording to text (.ogg, .mp3) - Image → Analyze image to text. - Text → Sent directly to AI Agent (.txt). - Document → Parsed (e.g. .docx to .txt) accordingly.

📎 Document Type Routing

Before routing documents by type, the Supported Document File Types node first checks if the file extension is allowed. If not supported, it exits early with an error message — preventing unnecessary processing. Supported documents are then routed using the Document Router node, and converted to text for further processing.

Supported Document File Types .jpg .jpeg .png .webp .pdf .doc .docx .xls .xlsx .json .xml.