Templates / Process multiple media files in Telegram with Gemini AI & PostgreSQL database

Process multiple media files in Telegram with Gemini AI & PostgreSQL database

Ready for 3.0

by John Alejandro SIlva ✓ · 11,353 views · created 2025-08-15 · Support Chatbot, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 88 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects Telegram, Postgres, Google Gemini and Google Gemini Chat Model and 1 more.

How it runs

Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).

  1. Create Tables (Postgres): run a query
  2. get_chat_id (Edit Fields (Set)): sets 2 fields: chat_id, payload.media_group_id
  3. Input Message Router (Switch): routes items into 7 branches
  4. Wait: pauses before continuing
  5. get_message (text) (Edit Fields (Set)): sets 2 fields: message, chat_id
  6. Download Voice Message (Telegram): work with file
  7. Download VIDEO NOTE (Telegram): work with file
  8. Download IMAGE (Telegram): work with file
  9. Download AUDIO (Telegram): work with file
  10. Download VIDEO (Telegram): work with file

…plus 73 more steps. See the full node list below.

Services it uses

TelegramPostgresGoogle GeminiGoogle Gemini Chat ModelPostgres Chat Memory

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (18)

From the author

🤖📨 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. --- 📋…

Excerpt from John Alejandro SIlva's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.