Automation library · CRM

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.

LargeCalls a model: OpenAIRetrieval

30 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 2Model 13Logic 4Service 11

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

  1. 1ModelLm Chat Open AiModel
  2. 2MemoryMemory Redis ChatModel
  3. 3Handoff SubworkflowExecute Workflow triggerStarts it
  4. 4Telegram TriggerTelegram triggerStarts it
  5. 5OpenAI Chat ModelLm Chat Open AiModel
  6. 6Memory1Memory Redis ChatModel
  7. 7Model1Lm Chat Open AiModel
  8. 8Handoff ToolTool WorkflowModel
  9. 9Memory2Memory Redis ChatModel
  10. 10Memory3Memory Redis ChatModel
  11. 11Onboarding AgentAgentModel
  12. 12Notify userTelegramService
  13. 13Get Interaction StateRedisService
  14. 14Information ExtractorInformation ExtractorModel
  15. 15After Sales AgentAgentModel
  16. 16Update Agent MemoryMemory ManagerModel
  17. 17Update Agent Memory1Memory ManagerModel
  18. 18Get Onboarding Chat HistoryRedisService
  19. 19Set Interaction to HumanRedisService
  20. 20Switch InteractionSwitchLogic
  21. 21With DefaultsCodeLogic
  22. 22Send Response3TelegramService
  23. 23Send Response2TelegramService
  24. 24Human Handoff using Send and WaitTelegramService
  25. 25Get Canned ResponseTelegramService
  26. 26Has All Criteria?IfLogic
  27. 27Set Interaction to BotRedisService
  28. 28Handoff Subworkflow1Execute WorkflowLogic
  29. 29Continue ConversationTelegramService
  30. 30Send ResponseTelegramService

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.