Gmail + Telegram: consistent support replies, logged
Your support inbox is doing that thing again. The same questions arrive in Gmail, then show up on Telegram five minutes later, and somehow the replies don’t match. It’s slow, messy, and easy to get wrong.
Support leads feel it first, but marketing managers and operations folks end up pulled in too when customers get stuck. This Gmail Telegram automation keeps replies consistent, remembers the thread, and logs every interaction so you stop losing context.
Below, you’ll see how the workflow routes Gmail and Telegram messages into an AI support agent, pulls answers from your Google Sheets knowledge base, escalates tricky cases, and records clean logs for reporting.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Gmail + Telegram: consistent support replies, logged
flowchart LR
subgraph sg0["📧 Gmail Customer Inquiry Flow"]
direction LR
n6@{ icon: "mdi:play-circle", form: "rounded", label: "📧 Gmail Customer Inquiry Tri..", pos: "b", h: 48 }
n7@{ icon: "mdi:swap-vertical", form: "rounded", label: "📋 Process Gmail Message", pos: "b", h: 48 }
n8@{ icon: "mdi:robot", form: "rounded", label: "🤖 Gmail AI Agent", pos: "b", h: 48 }
n9@{ icon: "mdi:brain", form: "rounded", label: "🧠 OpenAI Chat Model - Gmail", pos: "b", h: 48 }
n10@{ icon: "mdi:memory", form: "rounded", label: "🧠 Gmail Memory", pos: "b", h: 48 }
n11@{ icon: "mdi:message-outline", form: "rounded", label: "📧 Send Gmail Reply", pos: "b", h: 48 }
n12@{ icon: "mdi:message-outline", form: "rounded", label: "✅ Mark Gmail as Read", pos: "b", h: 48 }
n13@{ icon: "mdi:database", form: "rounded", label: "📊 Log Gmail Interaction", pos: "b", h: 48 }
n17@{ icon: "mdi:database", form: "rounded", label: "Gmail Escalation Logger", pos: "b", h: 48 }
n18@{ icon: "mdi:database", form: "rounded", label: "knowledge base", pos: "b", h: 48 }
n18 -.-> n8
n10 -.-> n8
n8 --> n11
n11 --> n12
n11 --> n13
n17 -.-> n8
n7 --> n8
n9 -.-> n8
n6 --> n7
end
subgraph sg1["💬 Telegram Customer Message Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>💬 Telegram Customer Message .."]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "📋 Process Telegram Message", pos: "b", h: 48 }
n2@{ icon: "mdi:robot", form: "rounded", label: "🤖 Telegram AI Agent", pos: "b", h: 48 }
n3@{ icon: "mdi:brain", form: "rounded", label: "🧠 OpenAI Chat Model - Telegram", pos: "b", h: 48 }
n4@{ icon: "mdi:memory", form: "rounded", label: "🧠 Telegram Memory", pos: "b", h: 48 }
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>💬 Send Telegram Reply"]
n14@{ icon: "mdi:database", form: "rounded", label: "📊 Log Telegram Interaction", pos: "b", h: 48 }
n19@{ icon: "mdi:database", form: "rounded", label: "knowledge base1", pos: "b", h: 48 }
n20@{ icon: "mdi:database", form: "rounded", label: "Telegram Escalation Logger", pos: "b", h: 48 }
n19 -.-> n2
n4 -.-> n2
n2 --> n5
n5 --> n14
n20 -.-> n2
n1 --> n2
n3 -.-> n2
n0 --> n1
end
subgraph sg2["🚨 Error Flow"]
direction LR
n15@{ icon: "mdi:play-circle", form: "rounded", label: "🚨 Error Trigger", pos: "b", h: 48 }
n16["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>📢 Notify Admin of Error"]
n15 --> n16
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n6,n0,n15 trigger
class n8,n2 ai
class n9,n3 aiModel
class n10,n4 ai
class n13,n17,n18,n14,n19,n20 database
class n16 api
classDef customIcon fill:none,stroke:none
class n0,n5,n16 customIcon
The Problem: Support Replies Drift Across Channels
When customers bounce between email and chat, your team’s “single conversation” turns into fragments. Someone answers in Gmail using yesterday’s policy. Another person answers in Telegram with a different tone, different steps, or a different promise. Then comes the follow-up: “But your teammate said…” and now you’re digging through threads, searching for screenshots, and trying to reconstruct what happened. Even if you’re fast, the mental load is real, and the mistakes tend to show up when you’re busiest. Honestly, it’s not the hard questions that burn time. It’s the repeated ones, multiplied by two channels.
The friction compounds. Here’s where it usually breaks down.
- Agents answer the same “where’s my order” question several times a day because there is no single, trusted response.
- Conversation context gets lost when a customer starts in Gmail and then switches to Telegram, so you re-ask basic details.
- Escalations happen too late because no one is tagging “this is complex” consistently in the moment.
- Reporting becomes guesswork since support interactions are scattered across inboxes instead of logged in one place.
The Solution: One AI Support Brain for Gmail and Telegram
This workflow monitors both Gmail and Telegram for incoming support questions, then routes them to a dedicated AI support agent built in n8n. The agent reads the message, checks conversation memory so it doesn’t treat every reply like a brand-new ticket, and looks up answers from a Google Sheets knowledge base you control. It generates a consistent, brand-appropriate response and sends it back through the same channel the customer used. If the question is risky or genuinely complicated (billing disputes, angry messages, technical edge cases), the workflow logs an escalation to a separate sheet for a human to pick up. Everything gets recorded: what the customer asked, what the AI responded, when it happened, and whether it was resolved.
The workflow starts when a Gmail email arrives or a Telegram message hits your bot. From there, the AI agent uses your knowledge base sheet plus short-term memory to write the reply. Finally, it sends the message back, marks the email as processed, and logs the full interaction (and any escalation) into Google Sheets.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you handle about 30 support questions a day split across Gmail and Telegram. Manually, if each message takes roughly 6 minutes to read, search past replies, answer, and log, that’s about 3 hours of repetitive work daily. With this workflow, a new message triggers instantly, the agent drafts and sends the reply, and logging happens in the background. You still review escalations, but your “touch time” drops to checking a sheet a couple times a day, which is closer to 15 minutes than half your afternoon.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Gmail (or Google Workspace) to receive and send support emails.
- Telegram Bot to receive and send chat support messages.
- Google Sheets for the knowledge base, logs, and escalations.
- OpenAI API key (get it from the OpenAI Platform “API Keys” page).
Skill level: Intermediate. You will connect OAuth credentials, paste a few IDs (sheet IDs), and test with real messages.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A new message arrives in Gmail or Telegram. Gmail triggers when a support email hits your inbox, and Telegram triggers when someone messages your bot. Two entry points, one support brain.
The message is cleaned up and mapped. n8n standardizes the payload (name, contact, subject, message text) so the agent gets the same structure regardless of channel. That small detail is what keeps answers consistent.
The AI agent drafts a response using your knowledge base. The workflow checks Google Sheets for relevant FAQ entries, then uses the OpenAI chat model to write a reply in your tone. It also uses simple session memory so the agent can handle “following up on my last message” without guessing.
Replies, logging, and escalation happen automatically. Gmail gets a response and the email is marked read. Telegram gets a formatted chat reply. Both channels write a row into your Interaction Log sheet, and anything flagged as “needs a human” goes into the Escalations sheet.
You can easily modify the knowledge base structure to match how your team writes answers, or adjust escalation rules based on what you consider high-risk. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
Set up the Telegram entry point so new messages are captured and mapped into a consistent structure for the AI agent.
- Add and configure Telegram Incoming Trigger with Updates set to
message. - Credential Required: Connect your telegramApi credentials in Telegram Incoming Trigger.
- In Map Telegram Payload, map fields using expressions like
{{ $json.message.from.first_name }},{{ $json.message.chat.id }}, and set channel totelegram. - Confirm Map Telegram Payload sets subject to
Customer Support Inquiryand message_content to{{ $json.message.text }}.
Step 2: Configure the Gmail Trigger
Set up email intake and normalize Gmail fields for the AI agent.
- Configure Gmail Inquiry Trigger with Filters set to
INBOXandCATEGORY_PERSONAL, and Read Status set tounread. - Credential Required: Connect your gmailOAuth2 credentials in Gmail Inquiry Trigger.
- In Map Gmail Payload, set customer_email to
{{ $json["From"].match(/<(.*?)>/)?.[1] || $json["From"] }}and message_content to{{ $json.text || $json.snippet }}. - Ensure Map Gmail Payload captures subject as
{{ $json.Subject }}and message_id as{{ $json.id }}.
Step 3: Set Up AI Agents and Memory
Wire the AI agents to their chat models, memory, and knowledge base tools for both Gmail and Telegram support paths.
- In Telegram Support Agent, set Text to
{{ $json.message_content }}and keep Prompt Type asdefine. - Connect Telegram Chat Model as the language model for Telegram Support Agent and set options like Max Tokens to
100and Temperature to0.3. - Credential Required: Connect your openAiApi credentials in Telegram Chat Model.
- Set Telegram Session Memory with Session Key as
telegram_{{ $json.customer_id }}and Session ID Type tocustomKey. - In Gmail Support Agent, set Text to
{{ $json.message_content }}and keep Prompt Type asdefine. - Connect Gmail Chat Model as the language model for Gmail Support Agent with Max Tokens
1000and Temperature0.3. - Credential Required: Connect your openAiApi credentials in Gmail Chat Model.
- Set Gmail Session Memory with Session Key as
gmail_{{ $json.customer_email }}and Session ID Type tocustomKey. - Attach knowledge base and escalation tools: Knowledge Base Lookup, Gmail Escalation Log to Gmail Support Agent, and Knowledge Base Lookup TG, Telegram Escalation Log to Telegram Support Agent.
Credential Required: Connect your googleSheetsOAuth2Api credentials in Knowledge Base Lookup, Knowledge Base Lookup TG, Gmail Escalation Log, and Telegram Escalation Log. For AI tool sub-nodes and memory (like Telegram Session Memory and Gmail Session Memory), credentials should be added to the parent agent and model nodes.
Step 4: Configure Output Actions
Send AI responses back to the customer and record interactions.
- In Dispatch Telegram Reply, set Text to
{{ $json.output }}and Chat ID to{{ $('Map Telegram Payload').item.json.chat_id }}. - Enable Parse Mode as
Markdownand set Reply To Message ID to{{ $('Map Telegram Payload').item.json.message_id }}. - Credential Required: Connect your telegramApi credentials in Dispatch Telegram Reply.
- In Send Gmail Response, set Operation to
reply, Message to{{ $json.output }}, and Message ID to{{ $('Map Gmail Payload').item.json.message_id }}. - Credential Required: Connect your gmailOAuth2 credentials in Send Gmail Response.
Send Gmail Response outputs to both Flag Gmail Read and Record Gmail Interaction in parallel. Make sure both nodes are connected correctly so the email is marked as read while logging the response simultaneously.
- In Flag Gmail Read, set Operation to
markAsReadand Message ID to{{ $('Map Gmail Payload').item.json.message_id }}. - Credential Required: Connect your gmailOAuth2 credentials in Flag Gmail Read.
- In Record Gmail Interaction, keep Operation as
append, set Document ID to[YOUR_ID], and Sheet Name toAI_Responses. - Credential Required: Connect your googleSheetsOAuth2Api credentials in Record Gmail Interaction.
- In Record Telegram Interaction, keep Operation as
append, set Document ID to[YOUR_ID], and Sheet Name toAI_Responses. - Credential Required: Connect your googleSheetsOAuth2Api credentials in Record Telegram Interaction.
⚠️ Common Pitfall: The Google Sheets nodes use [YOUR_ID] placeholders. Replace both Document ID and Sheet Name with your actual sheet IDs and sheet names.
Step 5: Add Error Handling
Ensure failures trigger admin notifications for quick recovery.
- Confirm Handle Error Trigger is connected to Notify Admin on Error.
- In Notify Admin on Error, set URL to
[CONFIGURE_YOUR_WEBHOOK]and keep Method asPOST. - Verify the body text contains
{{ $json.error.message }},{{ $json.error.node.name }}, and{{ new Date().toISOString() }}for diagnostics.
[CONFIGURE_YOUR_WEBHOOK], error alerts will silently fail.Step 6: Test and Activate Your Workflow
Validate both Telegram and Gmail paths, then enable automation.
- Click Execute Workflow and send a test Telegram message to confirm Telegram Incoming Trigger → Map Telegram Payload → Telegram Support Agent → Dispatch Telegram Reply → Record Telegram Interaction.
- Send a new unread Gmail message and verify Gmail Inquiry Trigger → Map Gmail Payload → Gmail Support Agent → Send Gmail Response runs, with Flag Gmail Read and Record Gmail Interaction executing in parallel.
- Check your Google Sheet to ensure rows append with timestamps and AI responses.
- Trigger a controlled error to confirm Handle Error Trigger sends a notification via Notify Admin on Error.
- When everything looks correct, toggle the workflow to Active for production use.
Common Gotchas
- Google (Gmail and Sheets) credentials can expire or need specific permissions. If things break, check n8n’s Credentials page and your Google Cloud OAuth consent settings 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.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About an hour if your Gmail, Telegram bot, and Sheets are ready.
No. You’ll mostly connect accounts and copy in your Google Sheet IDs.
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 OpenAI API costs, which are usually a few cents per conversation depending on message length.
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.
Yes, and you should. In the two “Support Agent” sections (one for Gmail, one for Telegram), you can adjust the agent instructions so it escalates on things like refund threats, legal terms, high-value billing disputes, or repeated failed troubleshooting. You can also change what gets written to the Escalations sheet by editing the Google Sheets escalation logging nodes, so your team sees priority, reason, and the exact customer message.
Most of the time it’s the bot token or webhook setup. Re-check the token from @BotFather, then confirm the Telegram credentials in n8n are using the updated value. If it still fails, look for blocked webhook delivery (common on locked-down networks) and confirm your n8n instance URL is reachable from Telegram.
On a typical n8n Cloud plan, you can handle thousands of messages a month as long as you stay within your execution quota.
Often, yes, because this is more than “if message then reply.” You’re combining multi-step logic, memory, a knowledge base lookup, and two-channel handling, and that complexity gets expensive (or awkward) in many no-code tools. n8n also gives you a self-hosted path, which matters once volume grows. Zapier or Make can still be fine for lightweight routing, especially if you don’t need conversation memory or sheet-driven knowledge retrieval. If you’re torn, Talk to an automation expert and you can sanity-check the best fit in a few minutes.
Set this up once and your support stops relying on heroics. The workflow handles the repetitive questions, keeps the story straight across Gmail and Telegram, and leaves you with logs you can actually use.
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.