WhatsApp meets Telegram for organized customer threads
Your WhatsApp inbox gets messy fast. One customer sends three messages, another changes their number format, and suddenly your team is scrolling, guessing, and accidentally replying out of context.
This WhatsApp Telegram automation hits support leads first, but e-commerce founders and ops folks feel it too. You get one clean Telegram topic per customer, so handoffs stop breaking and “who replied to this?” stops being a daily question.
Below, you’ll see how the workflow routes incoming WhatsApp messages into the right Telegram thread, then sends agent replies back to WhatsApp automatically.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: WhatsApp meets Telegram for organized customer threads
flowchart LR
subgraph sg0["WhatsApp Flow"]
direction LR
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/supabase.svg' width='40' height='40' /></div><br/>Create a row"]
n6["<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/merge.svg' width='40' height='40' /></div><br/>Merge"]
n7@{ icon: "mdi:swap-vertical", form: "rounded", label: "Set Telegram SuperGroupID", pos: "b", h: 48 }
n8@{ icon: "mdi:swap-vertical", form: "rounded", label: "Customer Details", pos: "b", h: 48 }
n9["<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/merge.svg' width='40' height='40' /></div><br/>Merge1"]
n10["<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/supabase.svg' width='40' height='40' /></div><br/>Get existing customer details"]
n11["<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/supabase.svg' width='40' height='40' /></div><br/>Get customer by phone"]
n12@{ icon: "mdi:swap-vertical", form: "rounded", label: "Set Customer Name", pos: "b", h: 48 }
n13["<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/whatsapp.svg' width='40' height='40' /></div><br/>WhatsApp Trigger"]
n14["<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/>Send Telegram Message to exi.."]
n15["<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/>Create a Telegram Topic"]
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/>Send a Telegram message to t.."]
n17@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check existing conversation ..", pos: "b", h: 48 }
n6 --> n7
n9 --> n12
n5 --> n16
n8 --> n9
n13 --> n10
n12 --> n17
n11 --> n9
n15 --> n5
n7 --> n11
n7 --> n8
n10 --> n6
n17 --> n14
n17 --> n15
end
subgraph sg1["Telegram 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 Trigger"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Filter messages that are rep..", pos: "b", h: 48 }
n2["<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/supabase.svg' width='40' height='40' /></div><br/>Get a row"]
n3["<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/whatsapp.svg' width='40' height='40' /></div><br/>Send message"]
n4@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n4 --> n2
n2 --> n3
n0 --> n1
n1 --> n4
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 n13,n0 trigger
class n17,n4 decision
class n14,n15,n16 api
classDef customIcon fill:none,stroke:none
class n5,n6,n9,n10,n11,n13,n14,n15,n16,n0,n2,n3 customIcon
Why This Matters: WhatsApp Support Turns Into Inbox Chaos
If you’re handling more than a handful of WhatsApp conversations per day, the cracks show quickly. A single “inbox” is not a system. Agents jump between chats, copy-paste order numbers into internal notes, and lose context the moment a customer sends “any update?” three days later. It’s not just time wasted. It’s mental load, duplicated work, and those small mistakes that create refunds, escalations, and bad reviews. Honestly, the worst part is that you can’t scale it with headcount alone because the chaos scales too.
The friction compounds. Here’s where it breaks down in real teams.
- Important messages get buried when multiple agents share one WhatsApp inbox or device.
- Handoffs are fragile because the “history” lives in someone’s scrolling finger, not a structured thread.
- Customers resend details, so you spend time re-asking questions you already had yesterday.
- Managers can’t easily audit what’s happening without reading an endless chat log.
What You’ll Build: Two-Way WhatsApp ↔ Telegram Topics Sync
This workflow turns WhatsApp into your customer-facing channel and Telegram into your internal “case management” space, without building a new app. When a WhatsApp message arrives, n8n checks a mapping table (stored in Supabase/Postgres) to see if that phone number already has a Telegram topic. If it exists, the message is posted into that topic so the conversation stays contained. If it’s a new customer, the workflow creates a fresh Telegram forum topic, saves the mapping (phone number ↔ topic ID), and then posts the message there. On the other side, when an agent replies inside the Telegram topic, the workflow validates it’s a topic reply, looks up the linked WhatsApp number, and sends the response back through the WhatsApp Cloud API.
The workflow starts from two triggers: an inbound WhatsApp webhook and an inbound Telegram webhook. In the middle, it uses lookups, merge steps, and message formatting (plus optional AI) to keep context clean. Finally, it posts to the right Telegram topic and dispatches the right WhatsApp reply automatically.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say your team handles about 200 WhatsApp conversations a day. If agents spend even 2 minutes per conversation finding history, confirming the latest update, and figuring out who owns it, that’s roughly 6 hours of pure “where are we at?” time daily. With this workflow, each customer lands in their own Telegram topic automatically, so context is already there. Replies go out from Telegram with no copy-paste, which usually gives teams a few hours back every day once volume ramps.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- WhatsApp Cloud API for receiving and sending customer messages
- Telegram Bot + Supergroup with Topics to host customer threads internally
- Supabase/Postgres credentials (get them from your Supabase project settings or Postgres host)
Skill level: Intermediate. You’ll be comfortable editing HTTP request steps, adding credentials, and testing webhooks end-to-end.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A WhatsApp message arrives. The workflow is triggered by your WhatsApp webhook. n8n grabs the sender phone number and the message content, then prepares it for lookup and posting.
The workflow checks for an existing customer thread. It queries your Supabase/Postgres table (the thread mapping) to see if this phone number already has a Telegram topic ID. A quick conditional decides which path to take.
It posts into Telegram in the right place. If the topic exists, the workflow posts the message into that existing topic via HTTP request. If not, it creates a new Telegram topic, stores the new mapping, and then posts the first message into the new thread.
An agent reply goes back to WhatsApp. A Telegram trigger listens for replies, validates they are topic messages (not random group chatter), looks up the mapped phone number, and dispatches the WhatsApp response automatically.
You can easily modify the customer label formatting to include order status or priority tags based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
Set up the Telegram intake so replies from your supergroup can be captured and validated before forwarding to WhatsApp.
- Add and open Incoming Telegram Trigger.
- Credential Required: Connect your telegramApi credentials.
- In Updates, keep
messageselected. - Open Extract Reply Messages and set superGroupID to
[YOUR_ID]. - In Extract Reply Messages, set message to
{{ $json.message.text }}. - Configure Validate Incoming Topic with both conditions:
{{ $('Incoming Telegram Trigger').item.json.message.chat.id }}equals{{ $json.superGroupID }}and{{ $json.message }}exists.
Step 2: Connect WhatsApp and Supabase Services
Connect the inbound WhatsApp trigger and database nodes that map WhatsApp numbers to Telegram topics.
- Open Inbound WhatsApp Trigger and select Credential Required: Connect your whatsAppTriggerApi credentials.
- Open Fetch Thread Mapping and set Table to
wa_tg_threads, Operation toget, and filter telegram_topic_id with{{ $('Incoming Telegram Trigger').item.json.message.message_thread_id }}. - Credential Required: Connect your supabaseApi credentials to Fetch Thread Mapping, Insert Thread Mapping, Retrieve Existing Threads, and Lookup Order By Phone.
- In Retrieve Existing Threads, set filters for phone_e164 to
{{ $json.customerPhone }}and supergroup_id to[YOUR_ID]. - In Lookup Order By Phone, set Table to
ordersand filter phone_number with{{ $('When Executed by Another Workflow').item.json.customerPhone }}.
wa_tg_threads, orders, phone_e164, telegram_topic_id) to avoid empty lookups.Step 3: Set Up Data Mapping and Parallel Enrichment
This workflow enriches WhatsApp messages with customer details and order lookup data, then composes a label for Telegram topics.
- Configure Assign Supergroup ID with superGroupID set to
[YOUR_ID]. - Note the parallel branch: Assign Supergroup ID outputs to both Lookup Order By Phone and Map Customer Details in parallel.
- In Map Customer Details, set customerName to
{{ $('When Executed by Another Workflow').item.json.customerName }}and CustomerPhone to{{ $('When Executed by Another Workflow').item.json.customerPhone }}. - In Blend Order Lookup, set Join Mode to
{{ $items("Lookup Order By Phone").length > 0 ? "enrichInput1" : "enrichInput2" }}and map fieldsCustomerPhone↔phone_number. - In Compose Customer Label, set CustomerName to
{{ $items("Lookup Order By Phone").length > 0 ? $items("Lookup Order By Phone")[0].json.customer_name + " (" + $items("Lookup Order By Phone")[0].json.phone_number + ")" : $json.customerName + " (" + $items("Map Customer Details")[0].json.CustomerPhone + ")" }}. - In Combine Customer Data, set Join Mode to
{{ $items("Retrieve Existing Threads").length > 0 ? "enrichInput1" : "enrichInput2" }}and mapcustomerPhone↔phone_e164.
CustomerPhone, phone_number, customerPhone, phone_e164)—keep casing consistent.Step 4: Configure WhatsApp Reply Dispatch
When a Telegram reply is validated, the workflow looks up the WhatsApp mapping and sends the response back to the customer.
- Open Fetch Thread Mapping and confirm it runs after Validate Incoming Topic.
- Open Dispatch WhatsApp Reply and set Operation to
send. - Credential Required: Connect your whatsAppApi credentials.
- Set phoneNumberId to
[YOUR_ID]. - Set textBody to
{{ $('Extract Reply Messages').item.json.message }}and recipientPhoneNumber to{{ $json.phone_e164 }}.
phone_e164, Dispatch WhatsApp Reply will fail—ensure the mapping exists in wa_tg_threads.Step 5: Route WhatsApp Messages to Telegram Topics
This section posts incoming WhatsApp messages into an existing Telegram topic or creates a new one if no thread exists.
- Confirm Inbound WhatsApp Trigger flows into Retrieve Existing Threads and then Combine Customer Data → Assign Supergroup ID.
- In Check Prior Conversation, keep the condition
{{ $items('Retrieve Existing Threads').length > 0 }}set to true for the existing-thread branch. - Open Post to Existing Topic and set URL to
https://api.telegram.org/bot[CONFIGURE_YOUR_TOKEN]/sendMessagewith body parameters:chat_id={{ $('Assign Supergroup ID').item.json.superGroupID }},message_thread_id={{ $items("Retrieve Existing Threads").last().json.telegram_topic_id }},text={{ $('When Executed by Another Workflow').item.json.customerMessage }}. - Open Generate Telegram Topic and set URL to
https://api.telegram.org/bot[CONFIGURE_YOUR_TOKEN]/createForumTopicwith body parameterschat_id={{ $('Assign Supergroup ID').item.json.superGroupID }}andname={{ $('Compose Customer Label').item.json.CustomerName }}. - Open Insert Thread Mapping and set fields
phone_e164={{ $('Map Customer Details').item.json.CustomerPhone }},telegram_topic_id={{ $json.result.message_thread_id }},supergroup_id={{ $('Assign Supergroup ID').item.json.superGroupID }}. - Open Post to New Topic and set URL to
https://api.telegram.org/bot[CONFIGURE_YOUR_TOKEN]/sendMessagewith body parameters:chat_id={{ $('Assign Supergroup ID').item.json.superGroupID }},message_thread_id={{ $('Generate Telegram Topic').item.json.result.message_thread_id }},text={{ $('When Executed by Another Workflow').item.json.customerMessage }}.
[CONFIGURE_YOUR_TOKEN] in all Telegram HTTP URLs or requests will fail with authorization errors.Step 6: Test and Activate Your Workflow
Validate both Telegram-to-WhatsApp replies and WhatsApp-to-Telegram topic posting before enabling the workflow.
- Click Execute Workflow and send a Telegram message in the target supergroup to trigger Incoming Telegram Trigger.
- Confirm the reply passes Validate Incoming Topic and that Dispatch WhatsApp Reply sends a message to the mapped WhatsApp number.
- Send a WhatsApp message to the connected number to trigger Inbound WhatsApp Trigger and verify it posts to an existing topic or creates a new one via Generate Telegram Topic and Post to New Topic.
- Verify Supabase records are created or retrieved correctly in wa_tg_threads after the run.
- When successful, switch the workflow to Active to run in production.
Troubleshooting Tips
- WhatsApp Cloud API credentials can expire or need specific permissions. If things break, check your Meta Developer access token and phone number ID configuration 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.
- Telegram bot permissions matter more than people expect. Make sure the bot can post in the supergroup and create/send messages in Topics, or the “create topic” HTTP request will fail silently.
Quick Answers
About 1–2 hours once your WhatsApp and Telegram credentials are ready.
No. You will mostly connect accounts and edit a few request fields. The only “technical” part is copying API values into the right n8n credential slots.
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 WhatsApp Cloud API usage costs from Meta and any OpenAI usage if you enable the AI Agent nodes.
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. You can change how topics are named by editing the “Compose Customer Label” Set node, and you can swap the database behind “Retrieve Existing Threads” and “Insert Thread Mapping” if you prefer a different Postgres setup. Common customizations include routing VIP customers to a dedicated supergroup, attaching order status from your order lookup step, and adding an “after-hours” auto-reply when no agents are online.
Most of the time it’s an expired Meta access token or the wrong phone number ID. Refresh the token in your WhatsApp Cloud API credentials, then confirm your webhook is still subscribed to message events. If failures happen only during high volume, you may also be hitting rate limits, which means you’ll want retry logic or a queue.
On n8n Cloud, your limit is based on plan executions per month, so higher message volume usually means a higher tier. If you self-host, there’s no fixed execution cap, but your server size and database performance become the real limit. Practically, this workflow is lightweight per message (a couple of lookups and sends), so most teams can run hundreds of conversations per day without breaking a sweat. If you’re pushing into the thousands daily, tune your database indexes on phone numbers and add basic retry handling on the HTTP request steps.
For this workflow, n8n has a few advantages: more complex logic with unlimited branching at no extra cost, a self-hosting option for unlimited executions, and native database-style workflows (lookups, merges, conditional routing) that get awkward fast in simpler builders. Zapier or Make can work for basic forwarding, sure, but the “topic per customer” mapping is the part that usually needs real control. If you care about auditability, you’ll like having the mapping table in Supabase/Postgres. If you care about scale, you’ll like not paying per tiny step. Talk to an automation expert if you want help choosing the simplest option for your volume.
Once this is running, every customer gets a real thread and your team gets real breathing room. The workflow keeps the context organized so you can focus on solving problems, not hunting for them.
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.