Skip to main content

Automate Telegram support handover from AI to humans with GPT4 and email alerts

Workflow preview

Workflow preview
100%
Automate Telegram support handover from AI to humans with GPT4 and email alerts preview
Open on n8n.io

Important notice

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

1. Workflow Overview

How it Works This is a Telegram AI to Human Handover System that seamlessly transitions customer support conversations between an AI agent and human operators: 1. AI First Response : When users mes...

Best for

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

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.set, n8n-nodes-base.telegram, n8n-nodes-base.if, n8n-nodes-base.emailsend, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.memorybufferwindow

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate Telegram support handover from AI to humans with GPT4 and email alerts
Workflow name
Automate Telegram support handover from AI to humans with GPT4 and email alerts

How it Works

This is a Telegram AI-to-Human Handover System that seamlessly transitions customer support conversations between an AI agent and human operators:

  1. AI-First Response: When users message the Telegram bot, an AI agent handles the conversation initially, using memory to maintain context across messages.

  2. Smart Handover Detection: The AI recognizes when users request human assistance and triggers a two-step confirmation process (user approval, then operator availability check).

  3. Topic-Based Routing: Once confirmed, the system creates a dedicated Telegram Forum topic named after the user's ID, where operators can respond. Messages are automatically forwarded between the user's private chat and the operator's topic.

  4. Session Management: A data table tracks conversation states ('ai', 'human', 'open', 'closed'), ensuring messages route correctly and maintaining conversation history.

  5. Clean Closure: Operators type "exit" in the topic to close conversations, updating the database and closing the forum topic.

Set-up Steps

Estimated Time: 30-45 minutes (first-time setup)

You'll need to:

  • Create and configure a Telegram bot via BotFather
  • Set up a Telegram group with Topics enabled and add your bot as admin
  • Configure SMTP credentials (Gmail app password recommended)
  • Create an n8n Data Table with specific columns (type, status, topic, user)
  • Add your bot token to multiple HTTP Request nodes
  • Set up AI model credentials (OpenRouter or Azure OpenAI)
  • Fill in the Configuration node with your IDs and email addresses
  • Test the flow using the included Personal Trigger to capture your group/user IDs

Note: The template includes detailed video guides (1-minute overview and 10-minute setup walkthrough) plus extensive documentation in sticky notes covering every node and credential setup.

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 - Telegram Trigger

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

Block 2 - Configuration

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

Block 3 - Confirm Operator

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

Block 4 - User Approved

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

Block 5 - Alert Operator

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 6 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 7 - Operator Confirmed

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

Block 8 - Operator Attendance

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

Block 9 - Operator Declined Attendance

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

Block 10 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 11 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 12 - Reply To User

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

Block 13 - Human Requested

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

Block 14 - Azure OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatAzureOpenAi - lmChatAzureOpenAi
Config choices
Version 1

Block 15 - Update Last Message

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

Block 16 - Last Message Exists

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

Block 17 - Row is Empty

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

Block 18 - Create Temporary Message

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

Block 19 - Update Temporary Message

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

Block 20 - Get Temporary Message

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

Block 21 - Message Router

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.3

Block 22 - Personal

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

Block 23 - Create Topic

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

Block 24 - Text Message

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

Showing the first 24 of 40 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate Telegram support handover from AI to humans with GPT4 and email alerts
Complexity advanced
Nodes 40
Categories Support Chatbot, AI Chatbot
Author Meelioo
Published 21 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9987/9987.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 Automate Telegram support handover from AI to humans with GPT4 and email alerts do?

How it Works This is a Telegram AI to Human Handover System that seamlessly transitions customer support conversations between an AI agent and human operators: 1. AI First Response : When users mes...

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.