🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Telegram + Google Drive, consistent support replies

Lisa Granqvist Partner Workflow Automation Expert

Your Telegram support chat gets noisy fast. One person answers from memory, another pastes an outdated snippet, and customers end up asking the same thing again because the first reply wasn’t quite right.

Support leads feel it first. Ops managers inherit the mess when handoffs break. And a founder usually becomes the last-resort “human search bar.” This Telegram support automation routes people to the right department and answers from your live docs, so replies stay consistent even as policies change.

Below you’ll see how the workflow routes slash commands, remembers the customer’s department, and pulls answers from a Google Drive knowledge base that updates automatically.

How This Automation Works

See how this solves the problem:

n8n Workflow Template: Telegram + Google Drive, consistent support replies

The Challenge: Support Replies Drift (and Customers Notice)

Command-based support in Telegram sounds clean until the volume picks up. Someone asks about invoices, another person jumps in with a half-remembered policy, and now you’ve got two “official” answers floating around. Next week your return policy doc changes, but the saved snippet in a teammate’s notes doesn’t. Customers get confused, refunds take longer, and your team spends more time clarifying than solving. It’s not the big tickets that burn your day, honestly. It’s the constant repeat questions and the mental load of deciding who should respond.

The friction compounds. Here’s where it breaks down in real teams.

  • Routing is manual, so billing questions land with technical staff (and then bounce around in chat).
  • Replies come from memory or old snippets, which means the same question gets different answers.
  • No reliable “state,” so a user switches topics and the conversation loses context halfway through.
  • When you update docs, nothing downstream updates, so the chatbot and humans keep quoting yesterday’s policy.

The Fix: Route by Slash Command, Answer From Live Docs

This workflow turns Telegram into a lightweight support console with guardrails. A customer starts in Telegram and chooses a department using a slash command like /billing, /tech-support, or /return-policy. n8n records that choice in PostgreSQL so the bot doesn’t “forget” five messages later. When the user asks a question, an AI agent answers using the correct department’s knowledge base, not whatever it guesses from the open web. The key detail is the knowledge base: it is built from Google Drive documents, and it refreshes automatically when those docs change. Your team updates the doc once, and support replies follow.

The workflow starts with Telegram Trigger receiving a message, then a Switch routes the command and loads the right department context from PostgreSQL. From there, an AI agent uses a department-specific vector store to find the most relevant doc sections and drafts a consistent reply. Finally, the response is sent back in Telegram, with session state handled cleanly so conversations don’t bleed into each other.

What Changes: Before vs. After

Real-World Impact

Say your team gets 20 Telegram questions a day split across billing, tech support, and returns. If each question takes about 5 minutes to route, find the right doc, and write a consistent reply, that’s around 100 minutes daily of repeatable work. With this workflow, the user self-routes via slash command, and the AI reply is generated in under a minute once the session is set. You’re usually left with quick review and the truly weird edge cases, so you can claw back about an hour a day.

Requirements

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Telegram for receiving messages and replying.
  • Google Drive to store and update support docs.
  • PostgreSQL for conversation state and department memory.
  • Pinecone API key (get it from your Pinecone console).
  • Cohere API key (get it from your Cohere dashboard for embeddings).
  • OpenRouter API key (get it from your OpenRouter account for chat model access).

Skill level: Intermediate. You’ll connect accounts, add API keys, and confirm your Drive folder structure for each department.

Need help implementing this? Talk to an automation expert (free 15-minute consultation).

The Workflow Flow

A Telegram message triggers the workflow. The Telegram Trigger fires on new messages, then the workflow checks if the user is starting fresh or continuing an active support session.

Department choice is captured and remembered. A command router (Switch) handles /billing, /tech-support, and /return-policy. That selection is written into PostgreSQL, so the next message can be treated as a question for the right team.

Docs become searchable support knowledge. Google Drive Triggers watch department folders. When a doc is added or updated, n8n downloads it, splits it into readable chunks, generates embeddings (Cohere), and inserts them into the matching Pinecone vector store.

An AI agent answers with the correct context. When a user asks something, the agent queries the department’s Pinecone store, uses an OpenRouter chat model to draft a response, and keeps short-term conversation memory so follow-ups make sense.

Results go back to Telegram (and sessions get cleaned up). The reply is sent to the user, and the workflow can end or clear session state when the conversation is finished, which prevents cross-talk later.

You can easily modify the slash commands to match your teams, then swap the Google Drive folders to point at different doc sets based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Telegram Trigger

This workflow starts when a Telegram message arrives and creates a session record for routing.

  1. Add and configure Incoming Telegram Trigger with Updates set to message.
  2. Connect Incoming Telegram Trigger to Insert Session Row so new users are registered before routing.
  3. Ensure your Telegram bot is correctly set up so the trigger can receive webhook updates.
  4. Credential Required: Connect your Telegram credentials for Incoming Telegram Trigger and all Telegram reply nodes (8 total Telegram nodes handle inbound and outbound messages).
⚠️ Common Pitfall: Telegram nodes in this workflow do not have credentials configured. The bot will not receive or send messages until Telegram credentials are added.

Step 2: Connect PostgreSQL for Session Management

PostgreSQL tracks user sessions and department selection for accurate routing.

  1. In Init Session Table, set the Query to CREATE TABLE tg_user_sessions ( user_id BIGINT PRIMARY KEY, department TEXT, active BOOLEAN DEFAULT FALSE, last_updated TIMESTAMP DEFAULT NOW() ); and run once to initialize.
  2. In Insert Session Row, confirm the Query uses INSERT INTO tg_user_sessions (user_id, active) SELECT {{ $json.message.from.id }}, FALSE WHERE NOT EXISTS ( SELECT 1 FROM tg_user_sessions WHERE user_id = {{ $json.message.from.id }} );.
  3. In Fetch Session Row, set Table to tg_user_sessions, Limit to 1, and Where to user_id = {{ $('Incoming Telegram Trigger').item.json.message.from.id }}.
  4. Verify session update nodes use their configured queries: Activate Session, Clear Session State, Set Return Department, Set Tech Department, and Set Billing Department.
  5. Credential Required: Connect your Postgres credentials for all Postgres nodes (8 total nodes manage session inserts, fetches, and updates).
⚠️ Common Pitfall: If Init Session Table hasn’t been executed, all session queries will fail. Run it once before activating the workflow.

Step 3: Connect Google Drive Triggers for Knowledge Files

Google Drive triggers ingest new documents for Billing, Tech, and Return policy knowledge bases.

  1. Configure Drive Billing Trigger with Event set to fileCreated, Trigger On set to specificFolder, and Folder to Watch set to [YOUR_ID].
  2. Configure Drive Tech Trigger and Drive Return Trigger with the same Event and Trigger On values, and replace their Folder to Watch values with your folder IDs.
  3. In Download Billing File, Download Tech File, and Download Return File, set Operation to download and File ID to {{ $json.id }}.
  4. Credential Required: Connect your Google Drive credentials for all Google Drive Trigger and Download nodes.
Tip: Keep each department’s documents in its dedicated folder to avoid mixing embeddings across namespaces.

Step 4: Set Up Vector Ingestion Pipelines

Each department’s documents are split, embedded, and inserted into a Pinecone vector store.

  1. For Billing Data Loader, Tech Data Loader, and Return Data Loader, set Data Type to binary and Text Splitting Mode to custom.
  2. Connect Billing Text Splitter, Tech Text Splitter, and Return Text Splitter to their respective data loaders.
  3. Configure Billing Vector Insert with Mode set to insert, Pinecone Namespace to billing, and Pinecone Index to n8n-proj.
  4. Configure Tech Vector Insert with Mode insert, Pinecone Namespace tech ques, and Pinecone Index n8n-proj.
  5. Configure Return Vector Insert with Mode insert, Pinecone Namespace return policy, and Pinecone Index n8n-proj.
  6. Credential Required: Connect your Pinecone credentials for all vector store nodes (6 total nodes handle insert and retrieval).
  7. Credential Required: Connect your Cohere credentials in Billing Vector Insert, Tech Vector Insert, and Return Vector Insert (parent nodes for Billing Embeddings, Tech Embeddings, and Return Embeddings).
⚠️ Common Pitfall: Embedding nodes are connected as AI sub-nodes; set Cohere credentials on their parent vector store nodes, not on the embedding nodes themselves.

Step 5: Set Up AI Agent and Retrieval Tools

The AI agent uses a chat model, memory, and vector tools to answer department-specific questions.

  1. In Support AI Agent, set Text to {{ $('Incoming Telegram Trigger').item.json.message.text }} and keep Prompt Type as define.
  2. Confirm the System Message in Support AI Agent includes the department variable {{ $json.department }} and guidance to ask users to use /end for switching departments.
  3. In OpenRouter Chat Model, set Model to deepseek/deepseek-chat-v3-0324:free.
  4. In Conversation Memory, set Session Key to {{ $json.user_id }} and Session ID Type to customKey. Conversation Memory is connected as memory for Support AI Agent.
  5. Configure vector tools: Return Vector Tool, Tech Vector Tool, and Billing Vector Tool with Mode set to retrieve-as-tool and their respective Tool Description values.
  6. Ensure the namespaces are correct: Return Vector Tool return policy, Tech Vector Tool tech ques, and Billing Vector Tool billing, all using n8n-proj index.
  7. Credential Required: Connect your OpenRouter credentials in OpenRouter Chat Model (used by Support AI Agent).
  8. Credential Required: Connect your Cohere credentials in Return Vector Tool, Tech Vector Tool, and Billing Vector Tool (parent nodes for Return Tool Embedding, Tech Tool Embedding, and Billing Tool Embedding).
Tip: If the agent responds without context, verify that the vector tool nodes are connected and the Pinecone namespaces match the insert pipelines.

Step 6: Configure Routing and Telegram Responses

Routing logic uses session state to decide whether to show the menu, route commands, or respond with AI.

  1. In Session Route Logic, set Mode to expression and Output to {{ $('Incoming Telegram Trigger').item.json.message.text === "/start" ? 0 : $('Incoming Telegram Trigger').item.json.message.text === "/end" ? 3 : ($json.active === "true" || $json.active === true) ? ($json.department != null ? 2 : 4) : 1 }} with Number Outputs set to 5.
  2. In Route by Command, verify the rules check {{ $('Incoming Telegram Trigger').item.json.message.text }} against /ReturnPolicy, /TechSupport, and /billing, with the fallback routed to Send Invalid Dept Notice.
  3. Configure outbound Telegram replies: Send Start Instructions, Send End Prompt, Return Policy Reply, Tech Support Reply, Billing Reply, Send Invalid Dept Notice, and Send Restart Prompt, each with their existing Text values and Chat ID expressions.
  4. Check session update queries: Set Return Department, Set Tech Department, Set Billing Department, and Clear Session State to ensure user routing is persisted.
  5. Confirm the execution flow: Incoming Telegram TriggerInsert Session RowFetch Session RowSession Route Logic → route to Send Start Instructions, Send End Prompt, Support AI Agent, Clear Session State, or Route by Command.
  6. Verify AI responses are sent by Send AI Response with Text set to {{ $json.output }} and Chat ID set to {{ $('Incoming Telegram Trigger').item.json.message.from.id }}.
⚠️ Common Pitfall: If users send “/billing” before “/start,” the session may not be active and routing will fail. Ensure Send Start Instructions and Activate Session remain connected.

Step 7: Test and Activate Your Workflow

Run a full test to validate triggers, routing, vector retrieval, and AI responses.

  1. Manually execute Init Session Table once to ensure the session table exists.
  2. Trigger the Telegram flow by sending /start to your bot and verify Send Start Instructions returns the menu.
  3. Test department routing using /billing, /ReturnPolicy, and /TechSupport and confirm each reply node fires and updates its department in PostgreSQL.
  4. Ask a question after choosing a department and confirm Support AI AgentSend AI Response returns a relevant answer.
  5. Upload a new file to each monitored Google Drive folder and verify the corresponding download and vector insert flow completes.
  6. When successful, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Watch Out For

  • Google Drive permissions are the usual culprit. If the Drive trigger fires but downloads fail, check the connected Google account has access to the exact folders and files first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Pinecone indexes and Cohere embeddings need to match your setup. If answers suddenly get vague, confirm the correct index is being written to and your embeddings key hasn’t hit a quota.

Common Questions

How quickly can I implement this Telegram support automation?

About an hour if your APIs are ready.

Can non-technical teams implement this support reply automation?

Yes, but someone needs to be comfortable pasting API keys and testing a few Telegram commands. Once accounts are connected, day-to-day changes are just doc edits in Google Drive.

Is n8n free to use for this Telegram support automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenRouter, Cohere embeddings, and Pinecone usage costs.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

How do I adapt this Telegram support automation solution to my specific challenges?

Start with the “Route by Command” switch: add or rename slash commands to match your teams. Then point each Google Drive Trigger at the folder that holds that department’s docs, and duplicate the department pattern if you’re adding a new area like /shipping or /account. Most customizations are about tightening the prompts in the AI Agent so it follows your tone, cites policy language, and knows when to escalate. If you already have a knowledge base elsewhere, you can replace the Google Drive download and loader portion with a different source, then keep the same Pinecone retrieval approach.

Why is my Telegram connection failing in this workflow?

Usually it’s a bad bot token or the webhook isn’t set correctly. Regenerate the Telegram bot token (or re-copy it), update the Telegram credentials in n8n, then send a new test message to trigger the workflow. If it works once and then stops, check for rate limiting and confirm your n8n instance is reachable from Telegram.

What’s the capacity of this Telegram support automation solution?

On n8n Cloud Starter, you can handle thousands of executions per month for typical support volume, and higher plans scale from there. If you self-host, there’s no execution limit (it depends on your server). The practical constraint is usually your AI and vector search usage, plus how many docs you’re embedding when Drive updates come in. For most small teams, it’s plenty.

Is this Telegram support automation better than using Zapier or Make?

For a RAG-style support bot, n8n is simply a better fit. You get state management with PostgreSQL, more control over branching logic, and you can run the knowledge base refresh (Drive trigger → embeddings → Pinecone) without fighting platform limits. Zapier or Make can work for basic “if message contains X then send Y,” but they get awkward once you need memory and department-aware retrieval. If you’re already deep in one of those tools, you can still keep them for lightweight tasks like notifications. Talk to an automation expert if you want a quick recommendation for your stack.

Once this is running, your docs become the source of truth for every reply, not a suggestion. Fewer handoffs, fewer repeats, and support that stays consistent even when your policies change.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Launch login modal Launch register modal