Build a Retrieval-Based Chatbot with Telegram, OpenAI, and Google Drive PDF Backup - n8n Workflow | Neura Market

    Build a Retrieval-Based Chatbot with Telegram, OpenAI, and Google Drive PDF Backup

    # Telegram RAG Chatbot with PDF Document & Google Drive Backup - An upgraded Retrieval-Augmented Generation (RAG) chatbot built in **n8n** that lets users ask questions via Telegram and receive accurate answers from uploaded PDFs. It embeds documents using OpenAI and backs them up to Google Drive. ## ☀ Who's it for Perfect for: - Knowledge workers who want instant access to private documents - Support teams needing searchable SOPs and guides - Educators enabling course material Q&A for students - Individuals automating personal document search + cloud backup ## ℹ How it works / What it does ### Telegram Chat Handling 1. **User sends a message** Triggered by the Telegram bot, the workflow checks if the message is text. 2. **Text message ➡ OpenAI RAG Agent** If the message is text, it's passed to a GPT-powered document agent. This agent: - Retrieves relevant info from embedded documents using semantic search - Returns a context-aware answer to the user 3. **Send answer back** The bot sends the generated response back to the Telegram user. 4. **Non-text input fallback** If the message is not text, the bot replies with a polite unsupported message. ### ➡ PDF Upload and Embedding 1. **User uploads PDFs manually** A manual trigger starts the embedding flow. 2. **Default Data Loader** Reads and chunks the PDF(s) into text segments. 3. **Insert to Vector Store (Embedding)** Text chunks are embedded using OpenAI and saved for retrieval. 4. **Backup to Google Drive** The original PDF is uploaded to Google Drive for safekeeping. ## 🛠 How to set up 1. **Telegram Bot** - Create via [BotFather](https://t.me/botfather) - Connect it to the Telegram Trigger node 2. **OpenAI** - Use your OpenAI API key - Connect the Embeddings and Chat Model nodes (GPT-3.5/4) - Ensure both embedding and querying use the same Embedding node 3. **Google Drive** - Set up credentials in n8n for your Google account - Connect the "Backup to Google Drive" node 4. **PDF Ingestion** - Use the "Upload your PDF here" trigger - Connect it to the loader, embedder, and backup flow ## 📜 Requirements - Telegram bot token - OpenAI API key (GPT + Embeddings) - n8n instance (self-hosted or cloud) - Google Drive integration - PDF files to upload ## © How to customize the workflow | Feature | How to Customize | |-------------------------|------------------------------------------------------------| | Auto-ingest from folders| Add Google Drive/Dropbox watchers for new PDFs | | Add file upload via Telegram| Extend Telegram bot to receive PDFs and run the embedding flow| | Track user questions | Log Telegram usernames and questions to a database | | Summarize documents | Add summarization step on upload | | Add Markdown or HTML support| Format replies for better Telegram rendering | Built with Telegram + PDF + OpenAI Embeddings + Google Drive + n8n

    Platform
    n8n
    Category
    AI
    Price
    Free
    Creator
    Trung Tran
    • Chatbot
    • RAG
    • Telegram
    • if
    • code
    • telegram
    • stickyNote
    • formTrigger
    • googleDrive
    • agent
    Back to MarketplaceMore n8n Workflows

    How to import this workflow into n8n

    1. 1Purchase or download the workflow to get the n8n workflow JSON file.
    2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
    3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
    4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

    Related AI workflows

    • Launch Your First AI-Powered Chatbot with Actionable ToolsFree
    • Automate AI Video Creation and YouTube Upload with Google Sheets
    Free
  1. Build a WhatsApp Assistant with Memory, Google Suite, Multi-AI, Research, and ImagingFree
  2. Automate Blog Post Creation and Publishing with GPT, Leonardo AI, and WordPressFree
  3. Email Agent$500.99
  4. Create a Conversational Telegram Bot with GPT-4 for Text and Voice MessagesFree
  5. More from Trung Tran

    • Answer Code of Conduct Questions in Slack with GP-4 & RAGE Technology
    • Auto-Renew AWS Certificates with Slack Approval Workflow
    • AI Resume Screening & Evaluation for HR with GPT-4 & Google Workspace
    All AI workflows →All n8n workflows →

    Need help customizing this workflow?

    Our automation experts adapt it to your exact stack, data, and process — or build one from scratch.

    Get a Custom Build
    Neura Market
    Neura Market
    Marketplace
    Directories
    Resources

    Marketplace

    • Prompts
    • Workflows
    • Agents Store
    • Workflow Packs
    • Categories
    • Marketplace

    Directories

    • AI Tools Directory
    • ChatGPT
    • Claude
    • Gemini
    • Cursor
    • Grok
    • DeepSeek
    • Perplexity
    • CoPilot
    • Midjourney
    • Stable Diffusion
    • MCP Servers
    • .md Directory
    • All Directories

    Free Tools

    • AI Text Humanizer
    • AI Content Detector
    • Workflow Generator
    • Model Comparison
    • AI Pricing Calculator
    • AI Benchmarks
    • ROI Calculator
    • All Free Tools

    Resources

    • AI News
    • Blog
    • AI Models
    • Integrations
    • Alternatives
    • n8n vs Zapier
    • Make vs Zapier
    • n8n vs Make
    • Resource Library
    • Documentation

    Community

    • AI Jobs
    • AI Events
    • AI Companies
    • Start Selling
    • Sell n8n Workflows
    • Sell AI Agents
    • Sell Prompts
    • Creator Guide
    • Advertise
    • Affiliates

    Company

    • About
    • Contact
    • Help
    • Careers
    • Pricing
    • Terms
    • Privacy
    • License
    • DMCA

    Stay Updated

    Get the latest AI tools and insights delivered to your inbox.

    Neura Market Logoneuramarket

    © 2026 Neura Market. All rights reserved.