Skip to main content

Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1

Workflow preview

Workflow preview
100%
Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1 preview
Open on n8n.io

Important notice

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

1. Workflow Overview

How it works This workflow creates an intelligent Telegram bot with a knowledge base powered by Qdrant vector database. The bot automatically processes documents uploaded to Google Drive, stores th...

Best for

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

Tools used

n8n-nodes-base.googledrivetrigger, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, @n8n/n8n-nodes-langchain.vectorstoreqdrant, n8n-nodes-base.telegramtrigger, n8n-nodes-base.filter, @n8n/n8n-nodes-langchain.embeddingsopenai

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1
Workflow name
Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1

How it works

This workflow creates an intelligent Telegram bot with a knowledge base powered by Qdrant vector database. The bot automatically processes documents uploaded to Google Drive, stores them as embeddings, and uses this knowledge to answer questions in Telegram. It consists of two independent flows: document processing (Google Drive → Qdrant) and chat interaction (Telegram → AI Agent → Telegram).

Step-by-step

Document Processing Flow:

  • New File Trigger: The workflow starts when the New File Trigger node detects a new file created in the specified Google Drive folder (polling every 15 minutes).
  • Download File: The Download File (Google Drive) node downloads the detected file from Google Drive.
  • Text Splitting: The Split Text into Chunks node splits the document text into chunks of 3000 characters with 300 character overlap for optimal embedding.
  • Load Document Data: The Load Document Data node processes the binary file data and prepares it for vectorization.
  • OpenAI Embeddings: The OpenAI Embeddings node generates vector embeddings for each text chunk.
  • Insert into Qdrant: The Insert into Qdrant node stores the embeddings in the Qdrant vector database collection.
  • Move to Processed Folder: After successful processing, the Move to Processed Folder (Google Drive) node moves the file to a "Qdrant Ready" folder to keep files organized.

Telegram Chat Flow:

  • Telegram Message Trigger: The Telegram Message Trigger node receives new messages from the Telegram bot.
  • Filter Authorized User: The Filter Authorized User node checks if the message is from an authorized chat ID (26899549) to restrict bot access.
  • AI Agent Processing: The AI Agent receives the user's message text and processes it using the fine-tuned GPT-4.1 model with access to the Qdrant knowledge base tool.
  • Qdrant Knowledge Base: The Qdrant Knowledge Base node retrieves relevant information from the vector database to provide context for the AI agent's responses.
  • Conversation Memory: The Conversation Memory node maintains conversation history per chat ID, allowing the bot to remember context.
  • Send Response to Telegram: The Send Response to Telegram node sends the AI-generated response back to the user in Telegram.

Set up steps

Estimated set up time: 15 minutes

  1. Google Drive Setup:

    • Add your Google Drive OAuth2 credentials to the New File Trigger, Download File, and Move to Processed Folder nodes.
    • Create two folders in your Google Drive: one for incoming files and one for processed files.
    • Copy the folder IDs from the URLs and update them in the New File Trigger (folderToWatch) and Move to Processed Folder (folderId) nodes.
  2. Qdrant Setup:

    • Add your Qdrant API credentials to the Insert into Qdrant and Qdrant Knowledge Base nodes.
    • Create a collection in your Qdrant instance (e.g., "Test-youtube-adept-ecom").
    • Update the collection name in both Qdrant nodes.
  3. OpenAI Setup:

    • Add your OpenAI API credentials to the OpenAI Chat Model and OpenAI Embeddings nodes.
    • (Optional) Replace the fine-tuned model ID in OpenAI Chat Model with your own model or use a standard model like gpt-4-turbo.
  4. Telegram Setup:

    • Create a Telegram bot via @BotFather and obtain the bot token.
    • Add your Telegram bot credentials to the Telegram Message Trigger and Send Response to Telegram nodes.
    • Update the authorized chat ID in the Filter Authorized User node (replace 26899549 with your Telegram user ID).
  5. Customize System Prompt (Optional):

    • Modify the system message in the AI Agent node to customize your bot's personality and behavior.
    • The current prompt is configured for an n8n automation expert creating social media content.
  6. Activate the Workflow:

    • Toggle "Active" in the top-right to enable both the Google Drive trigger and Telegram trigger.
    • Upload a document to your Google Drive folder to test the document processing flow.
    • Send a message to your Telegram bot to test the chat interaction flow.

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 - New File Trigger

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

Block 2 - Download File

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

Block 3 - Move to Processed Folder

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

Block 4 - Load Document Data

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

Block 5 - Split Text into Chunks

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 6 - Insert into Qdrant

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

Block 7 - Telegram Message Trigger

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

Block 8 - Filter Authorized User

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.3

Block 9 - OpenAI Embeddings

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

Block 10 - Send Response to Telegram

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

Block 11 - Qdrant Knowledge Base

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

Block 12 - AI Agent1

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

Block 13 - OpenAI Chat Model1

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

Block 14 - Sticky Note

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

Block 15 - Sticky Note1

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

Block 16 - Sticky Note2

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

Block 17 - Sticky Note3

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

Block 18 - Sticky Note4

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

Block 19 - Sticky Note5

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

3. Summary Table

Workflow Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1
Complexity advanced
Nodes 19
Categories Internal Wiki, AI RAG
Author Konstantin
Published 28 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12228/12228.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 Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1 do?

How it works This workflow creates an intelligent Telegram bot with a knowledge base powered by Qdrant vector database. The bot automatically processes documents uploaded to Google Drive, stores th...

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.