Telegram AI bot-to-human handoff for sales calls
Needs changesWhat this workflow does
This AI workflow has 30 nodes and runs on Telegram events (message) (plus 1 other trigger). Along the way it connects Telegram, Redis, OpenAI Chat Model and Redis Chat Memory.
How it runs
Trigger: On Telegram events (message) (plus 1 other trigger).
- Get Interaction State (Redis): get
- Notify user (Telegram): uses Telegram
- Switch: routes items into 2 branches
- Set Interaction to Human (Redis): set
- Get Canned Response (Telegram): uses Telegram
- After Sales Agent (AI Agent): runs an AI agent, with model: Model; 1 tool (Handoff Tool); memory: Memory
- Onboarding Agent (AI Agent): runs an AI agent, with model: Model; memory: Memory
- Human Handoff using Send and Wait (Telegram): send and wait for a reply
- Send Response (Telegram): uses Telegram
- Get Onboarding Chat History (Redis): get
…plus 10 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Onboarding Agent (v1.8), After Sales Agent (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Onboarding Agent (v1.8), After Sales Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (14)
- Telegram
n8n-nodes-base.telegram - Redis
n8n-nodes-base.redis - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Redis Chat Memory
@n8n/n8n-nodes-langchain.memoryRedisChat - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Telegram Trigger
n8n-nodes-base.telegramTrigger - Switch
n8n-nodes-base.switch - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - AI Agent
@n8n/n8n-nodes-langchain.agent - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Chat Memory Manager
@n8n/n8n-nodes-langchain.memoryManager
From the author
This n8n template demonstrates an approach to perform bot-to-human handoff using Human-in-the-loop functionality as a switch. In this experiment, we play with the idea of states we want our agent to be in which controls it's interacton with the user. First…