Process multiple media files in Telegram with Gemini AI & PostgreSQL database
Ready for 3.0What 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).
- Create Tables (Postgres): run a query
- get_chat_id (Edit Fields (Set)): sets 2 fields: chat_id, payload.media_group_id
- Input Message Router (Switch): routes items into 7 branches
- Wait: pauses before continuing
- get_message (text) (Edit Fields (Set)): sets 2 fields: message, chat_id
- Download Voice Message (Telegram): work with file
- Download VIDEO NOTE (Telegram): work with file
- Download IMAGE (Telegram): work with file
- Download AUDIO (Telegram): work with file
- Download VIDEO (Telegram): work with file
…plus 73 more steps. See the full node list below.
Services it uses
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)
- Telegram
n8n-nodes-base.telegram - Switch
n8n-nodes-base.switch - If
n8n-nodes-base.if - Postgres
n8n-nodes-base.postgres - Wait
n8n-nodes-base.wait - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Postgres Trigger
n8n-nodes-base.postgresTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Extract from File
n8n-nodes-base.extractFromFile - Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Aggregate
n8n-nodes-base.aggregate - HTML
n8n-nodes-base.html - Merge
n8n-nodes-base.merge - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Telegram Trigger
n8n-nodes-base.telegramTrigger
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. --- 📋…