Multi-functional Telegram Assistant with Gemini, RAG PDF Search & Google Suite - n8n Workflow

Implement a powerful AI Telegram bot using this n8n workflow. Features include Gemini chat, voice transcription, RAG knowledge base search (Qdrant), and Google Suite automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users looking for comprehensive n8n templates integrating multiple AI services (Gemini, OpenAI, Replicate).

  • Developers needing a customizable, multi-tool AI assistant framework.

  • Businesses requiring an internal bot capable of complex operations like invoice generation or PDF search.

  • Anyone seeking to leverage the n8n node ecosystem for AI-powered Telegram communication.

Overview

This incredibly comprehensive n8n workflow establishes a powerful AI assistant accessible via Telegram. It solves the complexity of integrating diverse services—from cutting-edge generative AI models like Google Gemini to specialized tools for voice processing (OpenAI/Replicate), external web search (Brave), and document indexing (Qdrant). This n8n workflow allows a single bot to act as a chat assistant, a voice responder, a document expert (RAG), and a task automator (Google Calendar, Drive). This sophisticated n8n template showcases the vast potential of using the core n8n platform alongside LangChain components.

How it Works

The process begins with the 'Listen for incoming events' n8n trigger, which activates upon any message received by the configured Telegram bot.


  1. Initial Response & Routing: The flow immediately sends a 'Typing' action notification. The 'Determine content type1' Switch n8n node then analyzes the message type (text command, voice, or general query) to route the request.

  2. Voice Interaction: If a voice message is detected, the 'Download voice file' n8n node fetches the audio. It is then transcribed using the 'Convert audio to text' OpenAI n8n node. The resulting text is fed into AI Agent 3 (focused on voice response). After processing by Google Gemini and supporting tools, the final text response is converted back to speech via a 'Call Replicate API' n8n node before being sent back via Telegram as an audio file.

  3. Text Chat: General text queries are routed to AI Agent 1, which utilizes a Google Gemini Chat Model and a wide array of tools (Brave Search, Calculator, Google Calendar). The response is delivered as text by the 'Send AI Text Response (Chat)' n8n node.

  4. RAG/Indexing: Specific commands trigger document actions. Indexing new PDFs involves a complex sequence: Google Drive retrieval, indexing through the Mistral API for OCR, text splitting, creation of OpenAI embeddings, and finally, storing vector data in the 'Qdrant Vector Store' n8n node. Retrieval (RAG) queries utilize the 'Question and Answer Chain' n8n node, combining the Gemini LLM with the Qdrant knowledge base.

  5. Utility Commands: Other commands execute specific utility tasks, such as generating an invoice using Google Docs and Drive, listing upcoming birthdays via 'Google Calendar 2', or performing a direct 'Brave Search 2' lookup. Every functional path demonstrates the power of the core n8n node ecosystem.

Installation Guide


  1. Import this n8n workflow JSON file into your n8n instance.

  2. Telegram Setup: Configure the 'Listen for incoming events' n8n trigger and all subsequent Telegram n8n nodes with your Bot Token. Ensure the webhook is correctly set up.

  3. AI Service Credentials: You must configure credentials for Google Gemini (for the Chat Models), OpenAI (for transcription and embeddings), Replicate (for text-to-speech generation), Qdrant (Vector Database endpoint), and Mistral (for document OCR/parsing during indexing).

  4. Google Suite Access: Authenticate all Google Drive, Google Docs, and Google Calendar n8n nodes using OAuth2 to grant necessary permissions. This n8n workflow relies on these connections.

  5. Brave Search: Provide the necessary API key for the Brave Search n8n node. Ensure all LangChain n8n node configurations (agents, tools, LLMs) correctly reference the corresponding credentials.

Node Details

Telegram Trigger (Listen for incoming events): The primary n8n trigger, initiating the workflow upon receiving a message from the Telegram bot.
Switch (Determine content type1): Acts as the central router, inspecting the incoming message payload to decide which complex branch of the n8n workflow to execute (e.g., chat, RAG search, voice, utility).
Google Gemini Chat Model: Used as the large language model within both AI Agent 1 (text chat) and AI Agent 3 (voice response), providing advanced conversational capabilities in this n8n template.
AI Agent 1 & AI Agent 3: LangChain Agent n8n nodes that orchestrate the use of multiple tools (Calculator, Calendar, Brave Search) based on the user's intent, maintaining conversation history via the Window Buffer Memory n8n node.
OpenAi (Convert audio to text): A crucial n8n node for processing voice messages, converting Telegram audio files into transcribed text inputs for the AI agents.
Qdrant Vector Store / Embeddings OpenAI: Core components of the RAG system. The Embedding n8n node generates vector representations of documents, which are stored and retrieved from the Qdrant Vector Store n8n node.
Google Drive / Google Docs: Used for file operations, fetching documents (PDFs for indexing), and executing multi-step tasks like drafting and converting invoices. These n8n nodes integrate essential GSuite functionality.
HTTP Request (Call Replicate API): This specialized n8n node handles the conversion of the AI's final text response into a synthetic voice audio file for the voice response branch.

Related n8n Workflows

Paid

Nodes: 29 Nodes
Updated: December 26 2025
View all
Created by
Issam AGGOUR
Issam AGGOUR

Featured*