Telegram AI Assistant with Multi-File Media Group Handling, Smart File Processing & PostgreSQL Integration > AI-powered Telegram bot for text, voice, video, documents & media β with database-driven grouping and Telegram-safe formatting. --- π Description This n8n template creates a next-generation Telegram AI assistant π§ π¬ capable of handling text messages, media files, and documents with advanced processing, PostgreSQL integration, and AI-powered responses. It is desi

Telegram AI Assistant with Multi-File Media Group Handling, Smart File Processing & PostgreSQL Integration > AI-powered Telegram bot for text, voice, video, documents & media β with database-driven grouping and Telegram-safe formatting. --- π Description This n8n template creates a next-generation Telegram AI assistant π§ π¬ capable of handling text messages, media files, and documents with advanced processing, PostgreSQL integration, and AI-powered responses. It is designed to solve Telegramβs media group challenge π¦ β when multiple files are sent together, they are stored, processed, and combined into one coherent AI-generated reply. β¨ Key Features - π Multi-file media group management with PostgreSQL: - mediagroup - mediaqueue - chathistories - π Document parsing for CSV, HTML, ICS, JSON, ODS, PDF (with AI fallback), RTF, TXT, XML, and spreadsheets. - π€ Voice & video transcription for AI analysis. - πΌοΈ Image, audio, and video description for richer AI context. - π‘οΈ Telegram-safe MarkdownV2 formatting with auto-splitting for messages over 4096 chars. - β οΈ Error fallback for unsupported file types. --- π‘ Acknowledgment A huge thank you to Ezema Gingsley Chibuzo π for the inspiration of the first version of this workflow: Create a Multi-Modal Telegram Support Bot with GPT-4 and Supabase RAG Your pioneering work laid the foundation for this improved, database-powered multi-modal assistant π --- π· Tags telegram ai-assistant postgresql multi-file media-group file-processing voice-transcription document-parser pdf-extraction markdown-formatting n8n-template --- πΌ Use Case Use this template if you need an AI-powered Telegram bot that can: - π¦ Handle multiple files sent in a single message (albums, multiple PDFs, etc.). - π§Ύ Extract & analyze content from many file formats. - ποΈ Transcribe voice and video messages. - ποΈ Maintain chat memory for contextual AI answers. - π‘οΈ Avoid Telegram formatting errors and length limit issues. This workflow automates the full chain: Receive β Process β AI Analysis β Telegram-safe Reply. --- π¬ Example User Interactions - π Multiple PDFs with a caption β AI extracts and summarizes all PDFs in one combined reply. - π€ Voice message β AI transcribes and replies with a contextual answer. - π CSV or spreadsheet file β AI parses and summarizes the data. - πΌοΈ Multiple images β AI describes each image and replies in a single message. --- π Required Credentials - Telegram Bot API (Bot Token) - PostgreSQL (Connection credentials) - AI Provider API (OpenAI, Google Gemini, or compatible LLM) --- βοΈ Setup Instructions 1. ποΈ Create the PostgreSQL tables (Gray section SQL): - mediagroup - mediaqueue - chathistories 2. π Configure the Telegram Trigger with your bot token. 3. π€ Connect your AI provider credentials. 4. ποΈ Set up PostgreSQL credentials in the database nodes. 5. βΆοΈ Deploy the workflow in n8n. 6. π― Start sending messages and files to your bot. --- π Extra Notes - β Green section ensures only one trigger per media group. - π Yellow section guarantees captions and files are stored in the correct sequence. - β¨ Purple section formats AI output to be Telegram-safe and split if needed. - π§ AI prompt is not fixed, allowing full customization. --- π‘ Need Assistance? If youβd like help customizing or extending this workflow, feel free to reach out: π§ Email: johnsilva11031@gmail.com π LinkedIn: John Alejandro Silva RodrΓguez
Download the workflow JSON file after purchase.
Open n8n β click the menu β Import from File.
Select the downloaded JSON and import.
Set up credentials for each node that requires them.
Click Execute Workflow to test, then activate.
Setup guide included
Purchase to unlock the full step-by-step guide
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.