# Telegram AI bot-to-human handoff for sales calls with OpenAI: n8n workflow

> Started by an incoming Telegram message, and works across Redis and Telegram. It puts OpenAI behind a retrieval step, so answers are drawn from documents...

Source: https://millionrounds.com/workflow/telegram-ai-bot-to-human-handoff-for-sales-calls-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [CRM](https://millionrounds.com/workflows?category=CRM#library)

# Telegram AI bot-to-human handoff for sales calls with OpenAI

Started by an incoming Telegram message, and works across Redis and Telegram. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 30 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ftelegram-ai-bot-to-human-handoff-for-sales-calls-with-openai)

**30 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 13 Logic 4 Service 11

The steps in the order they run, from what starts it.

- 1 **Model** Lm Chat Open Ai *Model*
- 2 **Memory** Memory Redis Chat *Model*
- 3 **Handoff Subworkflow** Execute Workflow trigger *Starts it*
- 4 **Telegram Trigger** Telegram trigger *Starts it*
- 5 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 6 **Memory1** Memory Redis Chat *Model*
- 7 **Model1** Lm Chat Open Ai *Model*
- 8 **Handoff Tool** Tool Workflow *Model*
- 9 **Memory2** Memory Redis Chat *Model*
- 10 **Memory3** Memory Redis Chat *Model*
- 11 **Onboarding Agent** Agent *Model*
- 12 **Notify user** Telegram *Service*
- 13 **Get Interaction State** Redis *Service*
- 14 **Information Extractor** Information Extractor *Model*
- 15 **After Sales Agent** Agent *Model*
- 16 **Update Agent Memory** Memory Manager *Model*
- 17 **Update Agent Memory1** Memory Manager *Model*
- 18 **Get Onboarding Chat History** Redis *Service*
- 19 **Set Interaction to Human** Redis *Service*
- 20 **Switch Interaction** Switch *Logic*
- 21 **With Defaults** Code *Logic*
- 22 **Send Response3** Telegram *Service*
- 23 **Send Response2** Telegram *Service*
- 24 **Human Handoff using Send and Wait** Telegram *Service*
- 25 **Get Canned Response** Telegram *Service*
- 26 **Has All Criteria?** If *Logic*
- 27 **Set Interaction to Bot** Redis *Service*
- 28 **Handoff Subworkflow1** Execute Workflow *Logic*
- 29 **Continue Conversation** Telegram *Service*
- 30 **Send Response** Telegram *Service*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 30, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Redis, Telegram
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Redis and Telegram accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 30 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 30 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ftelegram-ai-bot-to-human-handoff-for-sales-calls-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Redis](https://millionrounds.com/workflows?service=Redis#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also crm, with the same services where possible, closest in size first.

- [**Analyze customer feedback and send AI-written replies** 31 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/analyze-customer-feedback-and-send-ai-written-replies)
- [**Creator sponsorship and brand deals CRM with OpenAI and Gmail** 29 steps · calls a model · Gmail, Notion](https://millionrounds.com/workflow/creator-sponsorship-and-brand-deals-crm-with-openai-and-gmai)
- [**AI UGC ad generator - product to viral video pipeline** 33 steps · calls a model · Airtable, Telegram](https://millionrounds.com/workflow/ai-ugc-ad-generator-product-to-viral-video-pipeline)
- [**Capture and Store CRM Contacts with Telegram and Gemini** 22 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/capture-and-store-crm-contacts-with-telegram-and-gemini)
- [**Screen and score investment deals with OpenAI and Gmail** 18 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/screen-and-score-investment-deals-with-openai-and-gmail)
- [**Generate style-locked Seedance videos with Gmail and Jira** 18 steps · Gmail, Jira](https://millionrounds.com/workflow/generate-style-locked-seedance-videos-with-gmail-and-jira)
