Telegram Video Uploader and Gemini AI Tracking System - n8n Workflow

Automate Telegram video uploads to Google Drive, log metadata in Google Sheets, and enable data queries using a contextual Gemini AI n8n workflow. This n8n template handles file management and AI chat routing.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content creators who manage video submissions or archiving via Telegram.
Teams needing a simple, tracked file upload solution from a messaging platform.
Developers looking for advanced n8n templates integrating AI agents, cloud storage, and database logging.
Users who want to leverage the power of n8n and the Gemini model for dynamic data lookup.

Overview

This comprehensive automation solves the common challenge of efficiently managing multimedia content shared through instant messaging. By using this n8n workflow, any video sent to your Telegram bot is automatically downloaded, uploaded to a specific Google Drive folder, and meticulously logged in Google Sheets with details like file size, duration, and direct Drive links. Furthermore, the n8n template includes a powerful AI Agent powered by Gemini. This agent utilizes the tracked Google Sheets data ('Data Vidio' tool) to answer user questions about their uploaded files, making the entire system searchable and intelligent. This seamless integration ensures zero manual effort in file handling and tracking, maximizing productivity within your n8n environment. The core of this system relies on the initial Telegram Trigger n8n node to start the flow.

How it Works

The entire process begins when the Telegram Trigger n8n node receives a message.


  1. Flow Routing: The Switch1 n8n node checks the incoming message type.

  2. Path A: Video Upload: If a video is detected, the workflow uses the Get a file1 Telegram n8n node to download the media. It then uses the Upload file1 Google Drive n8n node to store it securely. Finally, the Append row in sheet1 Google Sheets n8n node logs all relevant metadata. A confirmation message is sent via Telegram.

  3. Path B: File Renaming: If the message starts with /edit, the Code1 n8n node parses the command to extract the File ID and the desired new name. The Update file1 Google Drive n8n node renames the file in the cloud, and the Update row in sheet1 Google Sheets n8n node updates the tracker sheet accordingly.

  4. Path C: AI Query: Any other text message is routed to the AI Agent1 n8n node. This agent uses the Google Gemini Chat Model1 for processing, maintains context via the Simple Memory1 n8n node, and can query the video data using the Data Vidio1 Google Sheets tool. The AI's response is sent back to the user via Telegram.

Installation Guide

To deploy this advanced n8n workflow template, follow these steps:


  1. Import: Copy the provided n8n workflow JSON and import it into your n8n instance.

  2. Telegram Credentials: Set up your Telegram Bot API credentials for the Telegram Trigger and the Send a text message n8n nodes. Ensure your bot is configured to receive messages.

  3. Google Drive/Sheets Credentials: Configure OAuth2 credentials for Google Drive and Google Sheets. You must grant access to manage files and sheets.

  4. Google Sheets Setup: Specify the exact Document ID and Sheet Name in the Google Sheets n8n nodes (Append row in sheet1, Update row in sheet1, and Data Vidio1). This sheet is crucial for tracking metadata and enabling AI queries.

  5. Google Gemini Setup: Provide your Google Gemini API key to the Google Gemini Chat Model1 n8n node.

  6. Activation: Once all credentials and parameters are correctly configured, activate the n8n workflow to start receiving updates from your Telegram bot.

Node Details

Telegram Trigger: The starting n8n trigger node, set to listen for new 'message' updates. It initiates the n8n workflow whenever a user interacts with the bot.
Switch1 (Core Logic Flow Control): This vital n8n node routes the flow based on message content, determining if the message is a video upload, a rename command (/edit), or an AI query.
Get a file1 (Telegram): Retrieves the video file data from Telegram using the dynamic expression {{ $json.message.video.file_id }}.
Upload file1 (Google Drive): Handles the physical upload of the video to a predefined Google Drive folder. This n8n node ensures files are correctly archived.
Append row in sheet1 (Google Sheets): Logs detailed metrics (e.g., file ID, duration, size in MB using ($json.size / (10241024)).toFixed(2)) into the sheet for reporting and AI access.
Code1 (Custom Code Scripting): Parses the /edit text command, splitting it by spaces to extract the target file ID and the new file name, preparing data for downstream Google Drive n8n nodes.
AI Agent1 (LangChain Agent): The brain of the system. It connects the Google Gemini Chat Model1 LLM, uses Simple Memory1 for context, and links the Data Vidio1 Google Sheets Tool, enabling conversational data lookups. The system prompt is configured to act as a personal assistant.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by
AbSa~
AbSa~

Hi, I’m AbSa~ automation builder and AI tinkerer. I help teams simplify their processes with n8n and creative workflow design.

Featured*