AutomationMart
Home/Browse/Build a multi-functional Telegram bot with Gemini, RAG PDF search & Google Suite
n8n

Build a multi-functional Telegram bot with Gemini, RAG PDF search & Google Suite

n8nn8n65 modulesv1.0
OpenAIGoogle DriveTelegramGoogle CalendarGemini

The Ultimate Beginner's Guide to an AI-Powered Telegram Assistant (PDF, Brave search & Google Suite) This comprehensive workflow bundle is designed as a powerful starter kit, enabling you to build a multi-functional AI assistant on Telegram. It seamlessly integrates AI-powered voice interactions, an intelligent PDF document search using a Retrieval-Augmented Generation (RAG) system, and automates various Google Suite tasks like calendar management and document generation. Perfect for beginners l

At a glance

Build a multi-functional Telegram bot with Gemini, RAG PDF search & Google Suite is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI, Google Drive, Telegram, Google Calendar. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI, Google Drive, Telegram, Google Calendar, Gemini
Modules
65
Price
Free
Version
v1.0
Build a multi-functional Telegram bot with Gemini, RAG PDF search & Google Suite workflow diagram

About this workflow

The Ultimate Beginner's Guide to an AI-Powered Telegram Assistant (PDF, Brave search & Google Suite) This comprehensive workflow bundle is designed as a powerful starter kit, enabling you to build a multi-functional AI assistant on Telegram. It seamlessly integrates AI-powered voice interactions, an intelligent PDF document search using a Retrieval-Augmented Generation (RAG) system, and automates various Google Suite tasks like calendar management and document generation. Perfect for beginners looking to explore advanced AI and automation capabilities. Disclaimer This template is designed for self-hosted n8n instances. 🚀 Key Features Telegram Bot Interface: Interact with your AI assistant using both text and voice commands through Telegram. AI Voice Bot: Transcribes user voice messages using OpenAI Whisper. Processes requests with an AI agent powered by Google Gemini. Responds with AI-synthesized voice using Replicate API. PDF RAG System: Index PDF documents from Google Drive via Telegram commands. Utilizes Mistral AI for Optical Character Recognition (OCR) on PDFs. Stores document content and embeddings in a Qdrant vector database. Answers questions about your documents using Google Gemini, based on retrieved context. Google Suite Automation: Manage Google Calendar: Create events, find upcoming holidays, and list birthdays. Google Drive: Search for PDF files and manage document templates. Google Docs: Automatically generate invoices from templates. Intelligent Web Search: Employs Brave Search for fetching real-time information from the web. Versatile AI Agent: Leverages Google Gemini with a suite of tools including a calculator, date & time utilities, and custom integrations (e.g., example Airbnb tools). Command-Driven Functionality: Easily trigger specific actions using Telegram commands like /help, /pdf, /rag, /invoice, /chat, /brave, and /birthday. ⚙️ How It Works The workflow is initiated by messages or commands sent to your Telegram bot. A central Switch node directs the flow based on the input received. 1. Telegram Interaction & Command Routing A Telegram Trigger node listens for new messages (text or voice). A "typing..." indicator is sent to Telegram for better user experience. The Switch node parses the message content and routes it to the appropriate sub-workflow based on predefined commands (e.g., /pdf, /rag, /voice) or general chat. 2. AI Voice Bot Functionality For voice messages (or if the voice path is triggered): The voice file is downloaded from Telegram. OpenAI Whisper transcribes the audio into text. The transcribed text is fed to an AI Agent (powered by Google Gemini and equipped with various tools and memory). The AI Agent's text response is then sent to the Replicate API to generate a natural-sounding voice. The generated audio response is sent back to the user on Telegram. 3. PDF RAG System with Mistral OCR & Qdrant Indexing PDFs (via /qdrant <GoogleDriveFileID> command): The specified PDF is downloaded from Google Drive. The PDF is uploaded to Mistral AI for OCR processing. The extracted text (in markdown format) is retrieved. The text is split into manageable chunks. OpenAI Embeddings are generated for each chunk. These chunks and their embeddings are stored in a Qdrant vector collection. A confirmation message is sent to Telegram. Querying PDFs (via /rag <yourquestion> command): The user's question is processed by a RetrievalQA Chain. This chain uses Google Gemini as the Language Model and retrieves relevant document chunks from Qdrant based on semantic similarity (embeddings). Google Gemini then generates a concise answer based on the user's question and the retrieved contextual information from the documents. The answer is sent back to the user on Telegram. Searching PDFs in Drive (via /pdf <searchterm> command): Searches your Google Drive for PDF files matching the provided search term. Sends a list of found PDF files (name and ID) to the user on Telegram, allowing them to easily identify files for indexing with /qdrant. 4. AI Chat & Task Automation (General Chat & /chat command) Handles general text messages or transcribed voice inputs that are not specific commands. An AI Agent (Google Gemini) processes these inputs. The agent is equipped with tools such as: Google Calendar Tools: To create events, find the next public holiday, or list upcoming birthdays. Brave Search Tool: To search the internet for information. Calculator Tool: For mathematical computations. Date & Time Utility: For handling and formatting dates. Example Airbnb Tools: Demonstrates extensibility for custom tool integrations. The agent utilizes a "Think Node" process for reasoning and Window Buffer Memory to maintain conversational context. Responses are formulated and sent back to the user on Telegram. 5. Google Automations Invoice Generation (via /invoice command): Copies a predefined Google Docs invoice template from your Google Drive. Populates the new document with details (client name, items, etc. – currently uses placeholder data from an 'Edit Fields' node, which can be customized to parse input from the command). Converts the populated Google Doc into a PDF file. Sends the generated PDF invoice to the user via Telegram. Calendar Management (via AI Agent or specific commands like /birthday): The /birthday command fetches upcoming birthdays from a specified Google Calendar. The AI Agent can also interact with Google Calendar to create events or retrieve information based on natural language requests. 6. Web Search (via /brave <query> command or AI Agent) Performs a web search using the Brave Search API. Returns a list of search results, including titles and URLs, to the user on Telegram. 7. Help Command (/help) Provides the user with a formatted list of all available Telegram commands and their basic usage instructions. 🛠️ Setup Steps & Credentials To get this workflow bundle up and running, you'll need to configure several credentials: 1. Telegram: Create a new bot via @BotFather on Telegram to obtain a Bot Token. Add this token to the Telegram Trigger node and all Telegram (sender) nodes in the workflow. 2. OpenAI: Obtain an API Key from platform.openai.com. Create an OpenAI credential. Use this credential in the Convert audio to text (OpenAI node for Whisper transcription) and all Embeddings OpenAI nodes (for RAG system). 3. Replicate API (Text-to-Speech): Sign up at replicate.com and get your API token. Create an HTTP Bearer Auth credential using this token. Assign this credential to the Call Replicate API (HTTP Request) node. 4. Google Gemini (PaLM API): Get an API key from Google AI Studio or Google Cloud Console. Create a Google Gemini(PaLM) Api credential. Assign it to all Google Gemini Chat Model nodes. 5. Qdrant (Vector Database): Set up a Qdrant instance (either cloud-hosted or self-managed). Note your Qdrant instance URL and API Key (if security is enabled). Create a QdrantApi credential with these details. Assign it to the Qdrant Vector Store nodes. For the Refresh collection node (an HTTP Request node used to clear the collection for /pdf command demo), create an HTTP Header Auth credential with your Qdrant API key if required by your instance. 6. Mistral AI (PDF OCR): Obtain an API key from console.mistral.ai. Create a Mistral Cloud API credential. Assign this to the Mistral Upload, Mistral Signed URL, and Mistral DOC OCR (HTTP Request) nodes. 7. Google Drive & Google Docs: Ensure the Google Drive API and Google Docs API are enabled in your Google Cloud Console project. Set up OAuth 2.0 credentials (Client ID and Client Secret). Create Google Drive OAuth2 Api and Google Docs OAuth2 Api credentials. Assign these to the respective Google Drive and Google Docs nodes throughout the workflow. Important: Configure relevant Folder IDs (for PDF search, invoice template source, invoice output) and the invoice template Document ID in the Google Drive and Google Docs nodes. 8. Google Calendar: Enable the Google Calendar API in your Google Cloud Console project. Set up OAuth 2.0 credentials. Create a Google Calendar OAuth2 Api credential. Assign it to the Google CalendarTool and Google Calendar nodes. Specify the correct calendar names or IDs in the nodes (e.g., for birthdays, holidays, new event creation). 9. Brave Search: Get a Brave Search API key from their developer portal. Create a Brave Search API credential. Assign it to the Brave Search nodes and tools. 10. (Optional) Airbnb MCP Client: The workflow includes example nodes for Airbnb MCP tools. If you intend to use or expand these, set up the corresponding MCP Client API credentials. 💡 Customization & Learning This "Beginner Bundle" is not just a ready-to-use solution but also a fantastic learning resource: Explore AI Agent Prompts: Dive into the AI Agent nodes to see how prompts are structured to guide the LLM's behavior, including the "Think Node" process and character guidance for robust messaging. Modify Toolsets: Easily add or remove tools for the AI agent to expand its capabilities. Invoice Customization: Adapt the Edit Fields node and the Google Docs template to match your invoicing needs. You can extend it to parse invoice details directly from the Telegram command. RAG Parameters: Experiment with chunk sizes, overlap, and different embedding models in the RAG pipeline. Extend Commands: Add new commands and corresponding functionalities by expanding the main Switch node and building out new automation paths. By setting up and dissecting this workflow, beginners can gain a practical understanding of building complex, AI-driven applications, integrating various services, and managing different data flows.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Automate client onboarding with Asana, Google Docs, Gmail, Slack and Sheets

Description Automate short-term trading research by generating high-quality trade ideas using MCP (Market Context Protocol) signals and AI-powered analysis. 📈🤖 This workflow evaluates market context, catalysts, momentum, and risk factors to produce structured trade ideas with clear reasoning, confidence scores, and execution notes. Designed for fast-moving markets, it helps traders and analysts spot actionable opportunities consistently—without manual screening or emotional bias. Perfect fo

Free

Automatic pantry inventory management with Notion and email notifications

Pantry Soft-Stock Refill — Notion Thresholds → Grocery List + Email What it does (the vibe) Your pantry’s calm concierge. Each evening it checks your Notion Pantry for items at or below your Reorder Level, adds tidy rows to Grocery List, and sends a pretty summary email you can shop from. ✨🛒 Perfect for Moms, home managers, and founders who want a kitchen that quietly manages itself—no last-minute “we’re out!” moments. Requirements n8n with Notion + Email credentials connected Two Notion datab

Free

Translate WordPress posts and ACF fields using DeepL and OpenAI

Who it is for This workflow is designed for developers, content managers, and website administrators managing multilingual WordPress sites. It is highly beneficial for websites built with complex Advanced Custom Fields (ACF) or custom Gutenberg layouts that standard translation plugins often struggle to process efficiently. How it works When a post is created or updated, WordPress triggers a webhook to start the workflow. The workflow fetches the raw post JSON directly from the WordPress REST AP

Free

Ai-powered social media amplifier

gt; Reach out to me for any setup help/consulting. Automate the curation and sharing of trending GitHub discussions from Hacker News to Twitter and LinkedIn. This workflow leverages AI to generate engaging posts, streamlining your social media content creation and distribution. How it Works 1. Crawl Hacker News for GitHub Posts: The workflow fetches trending GitHub-related discussions from Hacker News. 2. Extract Key Information: Relevant data such as post titles, URLs, and metadata are extracte

Free

Monitor Google Sheets for new rows and update with OpenAI API responses

Automatically monitor Google Sheets for new rows, generate responses using ChatGPT's Make an API call module, and update the sheet with AI-generated insights.

Free

Automate event follow-ups with GPT-4, LinkedIn & HubSpot multi-channel outreach

Automate your post-event networking with this intelligent n8n workflow. Triggered instantly after an event, it collects attendee and interaction data, enriches profiles with LinkedIn insights, and uses GPT-4 to analyze engagement and generate tailored follow-up messages. High-value leads are prioritized, messages are sent via email, LinkedIn, or Slack, and all activity is logged in your CRM and database. Save hours of manual follow-up while boosting relationship-building and ROI. 🤝✨ --- Ad

Free

Find leads from LinkedIn posts using Airtop agents

This templates connects to an Airtop agent to find leads from LinkedIn posts Use Cases - Build a targeted outreach list by extracting engaged users from an industry influencer's posts. - Monitor your company's LinkedIn page to identify and connect with your most active community members. - Generate warm leads for your sales team by finding users who are actively engaging with a competitor's content. - Source potential candidates for a job opening by analyzing posts related to a specific skill or

Free

Generate AI songs + music videos using Suno API, Flux, Runway and Creatomate

This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets. Sample Audio Generated: Youtube Link ⚠️ Note: This is only a summary. The full setup guide (with detailed steps, API setup, code snippets, and integrations) is included in a PDF on the Gumroad download page. Follow it to configure everything seamlessly. --- ⚙️ What This Workflow Does - Lets users interact w

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free