Skip to main content

AI-powered Telegram & WhatsApp business agent workflow

Workflow preview

Workflow preview
100%
AI-powered Telegram & WhatsApp business agent workflow preview
Open on n8n.io

Important notice

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

1. Workflow Overview

This workflow contains community nodes that are only compatible with the self hosted version of n8n. Deliver seamless, AI driven customer support on Telegram and WhatsApp—powered by GPT 4 Turbo and...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.telegramtrigger, n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.googlesheets, n8n-nodes-base.code, n8n-nodes-base.openai, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
AI-powered Telegram & WhatsApp business agent workflow
Workflow name
AI-powered Telegram & WhatsApp business agent workflow

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Deliver seamless, AI-driven customer support on Telegram and WhatsApp—powered by GPT-4 Turbo and n8n.


🌟 Key Features

  • Unified Messaging: Receive and normalize messages from both Telegram (via Bot Trigger) and WhatsApp (via Webhook).
  • Contextual AI Responses: Build customer context from Google Sheets, then craft personalized replies with GPT-4 Turbo.
  • Smart Routing: Automatically detect platform and send replies with platform-appropriate formatting (HTML for Telegram, plain for WhatsApp).
  • Intent Detection & Escalation: Flag orders, appointments or complex queries and trigger Slack notifications for human handoff.
  • Comprehensive Logging: Append every interaction to a “conversations” sheet and upsert customer profiles in a “customers” sheet.

📋 Prerequisites

  1. n8n instance (self-hosted or n8n Cloud)
  2. Credentials:
    • OpenAI API key
    • Telegram Bot Token
    • WhatsApp Business API credentials (WHATSAPP_PHONE_ID)
    • Google Sheets service-account credentials
    • Slack Incoming Webhook URL
  3. Google Sheets Setup:
    • customers sheet with columns: user_id, user_name, previousOrders, lastInteraction, preferences, conversationHistory
    • conversations sheet with columns: user_id, user_name, platform, message, ai_response, timestamp, needs_escalation, is_order, is_appointment

🚀 Setup & Usage

  1. Import the provided JSON into your n8n editor.
  2. Configure each node’s credentials in n8n’s Credentials panel.
  3. Set the following Workflow Variables:
    • GOOGLE_SHEET_ID
    • WHATSAPP_PHONE_ID
  4. Activate the Telegram Bot Trigger and WhatsApp Webhook nodes.
  5. Test by messaging your bot on Telegram and WhatsApp.

🔍 How It Works

  1. Trigger: Listens for new Telegram updates or WhatsApp webhook calls.
  2. Normalize Message: Standardizes payload into { user_id, user_name, message_text, platform, chat_id, timestamp }.
  3. Get Customer Data: Reads from “customers” sheet to fetch past history and order count.
  4. Build AI Context: Merges incoming message with customer info and history.
  5. AI Assistant: Sends context to GPT-4 Turbo (temperature 0.8, maxTokens 800).
  6. Process Response: Cleans formatting, identifies intents (order, appointment), and sets escalation flags.
  7. Platform Router: Routes reply to the appropriate “Send Telegram” or “Send WhatsApp” node.
  8. Log Conversation: Appends each message and response to the “conversations” sheet.
  9. Update Customer: Increments previousOrders, updates last interaction timestamp, and saves a snippet of the latest message.
  10. Escalation: If flagged, posts a formatted alert to your Slack channel for immediate attention.

Empower your business with 24/7 AI-powered support—save time, increase conversions, and ensure no customer inquiry goes unanswered.

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 - Sticky Note

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

Block 2 - Telegram Bot

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

Block 3 - WhatsApp Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - Normalize Message Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Sticky Note1

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

Block 6 - Get Customer History

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.4

Block 7 - Build AI Context

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Sticky Note2

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

Block 9 - AI Business Assistant

Type / Role
n8n-nodes-base.openAi - openAi
Config choices
Version 1.3

Block 10 - Sticky Note3

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

Block 11 - Process AI Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Platform Router

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 13 - Send Telegram Message

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

Block 14 - Send WhatsApp Message

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Sticky Note4

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

Block 16 - Log Conversation

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.4

Block 17 - Update Customer Record

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.4

Block 18 - Check Escalation

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 19 - Notify Support Team

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 20 - Sticky Note5

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

Block 21 - Webhook Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

3. Summary Table

Workflow AI-powered Telegram & WhatsApp business agent workflow
Complexity advanced
Nodes 21
Categories Support Chatbot, AI Chatbot
Author Amanda Benks
Published 25 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5311/5311.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 AI-powered Telegram & WhatsApp business agent workflow do?

This workflow contains community nodes that are only compatible with the self hosted version of n8n. Deliver seamless, AI driven customer support on Telegram and WhatsApp—powered by GPT 4 Turbo and...

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 Support Chatbot, AI Chatbot use case.