Skip to main content

Document Q&A chatbot with Google Drive, GPT-4-mini & Telegram (RAG system)

Workflow preview

Workflow preview
100%
Document Q&A chatbot with Google Drive, GPT-4-mini & Telegram (RAG system) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Description Overview This workflow creates a chat based Retrieval Augmented Generation (RAG) agent that lets you upload documents to Google Drive and then query them directly through Telegram. I...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.documentdefaultdataloader, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by DuyTran.

Original n8n.io source

1.1 Workflow description

Title
Document Q&A chatbot with Google Drive, GPT-4-mini & Telegram (RAG system)
Workflow name
Document Q&A chatbot with Google Drive, GPT-4-mini & Telegram (RAG system)

Description πŸ“Œ Overview

This workflow creates a chat-based Retrieval-Augmented Generation (RAG) agent that lets you upload documents to Google Drive and then query them directly through Telegram. It uses embeddings, vector storage, and an AI agent to retrieve, analyze, and answer user questions with context-aware responses.

🧩 Key Features

πŸ“‚ Google Drive Integration

Watches a folder for new file uploads.

Downloads and loads documents automatically into the system.

πŸ”Ž Vector Embeddings & Storage

Uses OpenAI embeddings to transform documents into vectors.

Stores them in an in-memory vector store for retrieval.

πŸ€– AI Agent with Memory

Built on LangChain Agent + GPT-4.1-mini.

Performs similarity search in the vector store.

Provides contextual answers with citations from the uploaded documents.

Maintains short-term conversation memory for better continuity.

πŸ’¬ Telegram Bot Integration

Users can send questions directly to the bot.

AI agent retrieves relevant information and replies with clear answers.

βš™οΈ How It Works

Trigger: Upload a file into the Google Drive folder.

Processing: Workflow downloads the file β†’ loads β†’ embeds β†’ stores in vector memory.

Query: User sends a question via Telegram.

Retrieval & Response: AI agent searches stored documents β†’ analyzes results β†’ returns summarized answer in Telegram.

πŸ” Requirements

Google Drive OAuth credentials.

OpenAI API key (for embeddings + LLM).

Telegram Bot API token.

πŸ“₯ Use Cases

πŸ“‘ Knowledge base assistant – Upload internal docs and query them in chat.

🏫 Learning support – Students upload study materials and ask questions.

πŸ“Š Business intelligence – Teams upload reports and get instant summaries.

More templet: https://auton8n.pw/

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 2 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 3 - Embedding model

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 4 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 5 - Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 7 - File uploaded

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Insert documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreInMemory - vectorStoreInMemory
Config choices
Version 1.3

Block 11 - Retrieve documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreInMemory - vectorStoreInMemory
Config choices
Version 1.3

Block 12 - Listen for incoming events

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1

Block 13 - Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.1

3. Summary Table

Workflow Document Q&A chatbot with Google Drive, GPT-4-mini & Telegram (RAG system)
Complexity intermediate
Nodes 13
Categories Internal Wiki, AI RAG
Author DuyTran
Published 02 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8147/8147.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Document Q&A chatbot with Google Drive, GPT-4-mini & Telegram (RAG system) do?

Description Overview This workflow creates a chat based Retrieval Augmented Generation (RAG) agent that lets you upload documents to Google Drive and then query them directly through Telegram. I...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.