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:
AI-First Response: When users message the Telegram bot, an AI agent handles the conversation initially, using memory to maintain context across messages.
Smart Handover Detection: The AI recognizes when users request human assistance and triggers a two-step confirmation process (user approval, then operator availability check).
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.
Session Management: A data table tracks conversation states ('ai', 'human', 'open', 'closed'), ensuring messages route correctly and maintaining conversation history.
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.
Related Templates
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
ā” AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Instagram Full Profile Scraper with Apify and Google Sheets
šø Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Compare Lists and Identify Common Items & Differences Using Custom Keys
This workflow compares two lists of objects (List A and List B) using a user-specified key (e.g. email, id, domain) and ...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments