🔓 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 + Gmail: faster ecommerce support replies

Lisa Granqvist Partner Workflow Automation Expert

Your support inbox isn’t “busy.” It’s chaotic. Messages come in from everywhere, order lookups take too long, and customers get different answers depending on who replies.

Support managers feel it when SLAs slip. A store owner feels it when refunds spike. And marketers running promos feel it when every campaign triggers a mini support storm. This Telegram Gmail support automation cuts response time down to minutes and keeps replies consistent.

You’ll set up an AI-powered workflow in n8n that routes questions, pulls order info, recommends products, and escalates real issues through Gmail when needed.

How This Automation Works

Here’s the complete workflow you’ll be setting up:

n8n Workflow Template: Telegram + Gmail: faster ecommerce support replies

Why This Matters: Slow Replies Create Expensive Tickets

Ecommerce support looks simple until you’re living in it. One customer asks for order tracking, another wants a size recommendation, and a third is angry because a package didn’t arrive. The “quick” work is never quick because you bounce between admin panels, search order IDs, then rewrite the same reassurance message for the hundredth time. And when a message gets handled late (or inconsistently), it turns into follow-ups, chargebacks, and public complaints you now have to clean up.

It adds up fast. Here’s where it typically breaks down in real teams.

  • Order status questions force constant context switching between chat, store admin, and your database.
  • Reps copy-paste replies, so tone and policies drift from person to person over time.
  • Escalations get lost because “someone will email them” is not a process.
  • When promos hit, the same three questions arrive all day, and your team still answers them manually.

What You’ll Build: An AI Support Router That Replies, Looks Up Orders, and Escalates

This workflow starts with an incoming webhook from your site, store, help widget, or any system that can send a request. n8n passes the message to an AI intent classifier that decides what the customer is actually asking: general support, order status, product recommendations, or a ticket-worthy issue. Based on that intent, the workflow routes the conversation to the right AI agent, which can remember recent context so follow-ups don’t feel like starting over. If the customer needs order tracking, the workflow retrieves order details from your Supabase database and responds immediately. If they need recommendations, it pulls product or category data and generates a helpful suggestion. And if it’s a support ticket, it generates a ticket ID, stores the record, then sends an escalation email through Gmail so your team can step in with all context included.

The flow is simple to reason about. A webhook triggers the workflow, AI classifies intent, then a switch routes the request to the correct “lane.” Each lane ends by responding right away, which keeps your customer experience fast even when backend steps (like email) are happening.

What You’re Building

Expected Results

Say you get about 30 support messages a day. A typical manual loop is 5 minutes to read, check an order system, paste a reply, and log a note, which is roughly 2–3 hours daily. With this workflow, the customer gets an instant response via webhook (seconds), and your team only steps in on real ticket cases; even then, Gmail sends the escalation automatically with the ticket ID and context. Most teams get back about 2 hours a day and, honestly, the mental load drop is just as valuable.

Before You Start

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Telegram for internal alerts and support routing
  • Gmail to send escalations and ticket emails
  • OpenAI API key (get it from your OpenAI dashboard)
  • Supabase to store and fetch orders/tickets
  • Google Sheets for lightweight logging or reporting

Skill level: Intermediate. You’ll connect accounts, add API keys, and map a few fields from your webhook payload.

Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).

Step by Step

A webhook receives the customer message. Your site, store, or help widget sends the question (and whatever identifiers you have, like email or order number) into n8n’s Incoming Webhook Trigger.

AI classifies intent and keeps context. An intent classifier agent uses an OpenAI chat model, plus session memory, to decide what lane the message belongs in and to remember recent back-and-forth.

Routing sends the request to the right assistant. A switch node splits into four paths: general reply, order status, product recommendations, or support ticket handling. Each path uses its own AI agent and memory so conversations stay coherent.

Data lookups and escalations happen behind the scenes. The order and recommendation paths query Supabase tools for order details and product/category info. The ticket path generates a ticket ID, stores the ticket record, and dispatches a Gmail message for your team to handle.

You can easily modify the intent categories to match your store (for example, “returns,” “shipping delay,” or “wholesale”) based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Webhook Trigger

Set up the inbound webhook that receives support messages and starts the routing flow.

  1. Add Incoming Webhook Trigger and set HTTP Method to POST.
  2. Set Path to 4cdaa2e9-be46-4f60-83f6-8d7bd4a6ad5d.
  3. Set Response Mode to responseNode so downstream nodes (Return Order Response, Return Recommendation Response, Return Ticket Response, Return General Reply) return the webhook response.
  4. Keep Flowpast Branding as a documentation-only sticky note (optional).

Tip: Send a POST body containing message and session_id fields to align with the AI memory configuration later in the workflow.

Step 2: Connect the Intent Classifier and Session Memory

Configure the initial AI classification layer that determines where each request should be routed.

  1. In Intent Classifier Agent, set Text to =Here is the query of user {{ $json.body.message }}.
  2. Connect Primary Chat Model as the language model for Intent Classifier Agent. Credential Required: Connect your openAiApi credentials.
  3. Connect Session Memory Core as memory for Intent Classifier Agent and set Session Key to ={{ $json.body.session_id }} with Context Window Length 7.

⚠️ Common Pitfall: Do not add credentials to Session Memory Core—memory nodes inherit access via the parent agent. Ensure credentials are set on Primary Chat Model instead.

Step 3: Parse Intent and Route Requests

Parse the classifier output and route to the correct assistant based on intent.

  1. In Parse Intent Payload, keep the JavaScript Code as provided to parse the agent’s JSON output into category.
  2. In Route by Intent, confirm each rule uses ={{ $json.category.intent }} and matches:
  3. Set the four rule values to order_status, product_recommendation, support_ticket, and general.
  4. Ensure Route by Intent connects to Order Status Assistant, Product Suggestion Agent, Support Ticket Agent, and Return General Reply based on the matched intent.

Tip: This switch routes to only one path at a time based on intent, so confirm the classifier returns valid JSON and a supported intent string.

Step 4: Configure the Order Status Path

Set up the order tracking assistant to retrieve order status and respond to the user.

  1. In Order Status Assistant, set Text to =The query of the user is this .{{ $('Incoming Webhook Trigger').item.json.body.message }}.
  2. Connect Order Chat Model as the language model. Credential Required: Connect your openAiApi credentials.
  3. Connect Order Memory Buffer as memory with Session Key ={{ $('Incoming Webhook Trigger').item.json.body.session_id }} and Context Window Length 7.
  4. Configure Retrieve Order Status with Table orders and Operation get, with filter value ={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}. Credential Required: Connect your supabaseApi credentials.
  5. In Return Order Response, keep Response Body as ={ "response": "{{ $json.output.replace(/[\n\r\t]+/g, ' ').replace(/\s{2,}/g, ' ').trim() }}" }.

⚠️ Common Pitfall: Tools like Retrieve Order Status are called by the agent, so credentials must be valid and the Supabase table must exist with matching field names.

Step 5: Configure the Product Recommendation Path

Set up the recommendation assistant to query product data based on user intent.

  1. In Product Suggestion Agent, set Text to =The query of the user is this . {{ $('Incoming Webhook Trigger').item.json.body.message }}.
  2. Connect Recommendation Chat Model as the language model. Credential Required: Connect your openAiApi credentials.
  3. Connect Recommendation Memory with Session Key ={{ $('Incoming Webhook Trigger').item.json.body.session_id }} and Context Window Length 7.
  4. Configure Product Recommendation Lookup with Table products, Operation get, and filter value ={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}. Credential Required: Connect your supabaseApi credentials.
  5. Configure Category Recommendation Lookup with Table products, Operation get, and filter value ={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions1_Value', ``, 'string') }}. Credential Required: Connect your supabaseApi credentials.
  6. In Return Recommendation Response, keep Response Body set to ={ "response":"{{ JSON.stringify($json.output) }}" }.

Tip: There are multiple Supabase tools in this workflow. Confirm all Supabase tools point to the correct project and tables to avoid partial failures.

Step 6: Configure the Support Ticket Path

Enable ticket creation and status lookup, including email notifications to your support team.

  1. In Support Ticket Agent, set Text to =The message/qiery of the user {{ $('Incoming Webhook Trigger').item.json.body.message }}.
  2. Connect Support Chat Model as the language model. Credential Required: Connect your openAiApi credentials.
  3. Connect Support Memory Buffer with Session Key ={{ $('Incoming Webhook Trigger').item.json.body.session_id }} and Context Window Length 7.
  4. Ensure Generate Ticket ID Tool is connected as an AI tool (no credentials required) and its code is unchanged.
  5. Configure Create Ticket Record with Table support_tickets and field values using the provided ={{ /*n8n-auto-generated-fromAI-override*/ $fromAI(...) }} expressions. Credential Required: Connect your supabaseApi credentials.
  6. Configure Retrieve Ticket Status with Table support_tickets and filter value ={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}. Credential Required: Connect your supabaseApi credentials.
  7. In Dispatch Support Email, set Send To to [YOUR_EMAIL] and keep Subject and Message as expressions. Credential Required: Connect your gmailOAuth2 credentials.
  8. In Return Ticket Response, keep Response Body as ={ "response": "{{ $json.output.replace(/[\n\r\t]+/g, ' ').replace(/\s{2,}/g, ' ').trim() }}" }.

⚠️ Common Pitfall: The tools Create Ticket Record, Retrieve Ticket Status, and Dispatch Support Email are called by Support Ticket Agent. Validate those credentials and fields before testing to prevent silent failures.

Step 7: Test and Activate Your Workflow

Validate each intent path and confirm the correct webhook response is returned.

  1. Use the Incoming Webhook Trigger test URL and send sample payloads with message and session_id.
  2. Verify the execution path: Incoming Webhook TriggerIntent Classifier AgentParse Intent PayloadRoute by Intent → the correct assistant node.
  3. Confirm successful responses from Return Order Response, Return Recommendation Response, Return Ticket Response, or Return General Reply.
  4. Once tests pass, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Troubleshooting Tips

  • Gmail credentials can expire or need specific permissions. If things break, check the Gmail connection in n8n’s Credentials list first.
  • If you’re seeing empty order results, it’s usually a mismatch between your webhook payload and the Supabase lookup fields. Double-check the order ID/email mapping in the “Retrieve Order Status” tool step.
  • Default prompts in the OpenAI agent nodes are generic. Add your brand voice and policy rules early (returns, refunds, shipping windows) or you’ll be editing outputs forever.

Quick Answers

What’s the setup time for this Telegram Gmail support automation?

About 45 minutes if Supabase and Gmail are already connected.

Is coding required for this support reply automation?

No. You’ll mainly connect accounts and map a few fields from your webhook payload.

Is n8n free to use for this Telegram Gmail support 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 OpenAI API costs (often a few cents per conversation) and whatever Supabase plan you’re on.

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.

Can I modify this Telegram Gmail support workflow for different use cases?

Yes, and you should. Most changes happen in “Route by Intent” (the categories), plus the Supabase tool steps used for lookups like “Retrieve Order Status” and “Create Ticket Record.” Common customizations include adding a “returns/refunds” lane, changing what data is pulled into the order response, and pushing a copy of ticket data into Google Sheets for reporting.

Why is my Gmail connection failing in this workflow?

Usually it’s expired OAuth access or the wrong Google account connected. Reconnect Gmail in n8n Credentials, then rerun a single test execution to confirm the “Dispatch Support Email” step can send. If you’re using a shared inbox, confirm that mailbox permissions are enabled on the Google Workspace side. Also check sending limits if you suddenly started escalating lots of tickets in a short window.

What volume can this Telegram Gmail support workflow process?

If you self-host, there’s no execution cap; it mostly depends on your server and API rate limits.

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

Often, yes, because this workflow isn’t just “send message from A to B.” You’re classifying intent, branching into multiple paths, using memory for follow-ups, and doing database lookups before replying, which is where simpler tools can get awkward or expensive. n8n also gives you a self-hosting route, so you’re not paying more just because you’re busy. That said, if you only need a basic escalation (like “new form submission → send email”), Zapier or Make can be quicker to set up. Talk to an automation expert if you want help picking the simplest option that still works.

Once this is running, routine questions stop stealing attention. Your customers get answers fast, and your team gets a calmer queue they can actually manage.

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

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal