Automation library · Customer support

Automate Telegram support handover from AI to humans with GPT4

Started by an incoming Telegram message, and works across Email, Telegram and n8n data table. It puts Azure OpenAI and OpenRouter behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 33 steps, 8 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: Azure OpenAI, OpenRouterRetrieval

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

The flow

Starts it 2Model 4Logic 11Service 16

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2OpenRouter Chat ModelLm Chat Open RouterModel
  3. 3Simple MemoryMemory Buffer WindowModel
  4. 4Reply To UserTelegram ToolService
  5. 5Azure OpenAI Chat ModelLm Chat Azure Open AiModel
  6. 6Chat AdminsHttp RequestService
  7. 7Personal TriggerTelegram triggerStarts it
  8. 8Topic MessageIfLogic
  9. 9AI AgentAgentModel
  10. 10PersonalSetLogic
  11. 11ExitIfLogic
  12. 12Text MessageIfLogic
  13. 13Human RequestedIfLogic
  14. 14Close TopicHttp RequestService
  15. 15Forward MessageHttp RequestService
  16. 16ConfigurationSetLogic
  17. 17Stop WorkflowNo OpLogic
  18. 18Confirm OperatorTelegramService
  19. 19Last Message ExistsData TableService
  20. 20Update Closed TopicData TableService
  21. 21Get Temporary MessageData TableService
  22. 22User ApprovedIfLogic
  23. 23Row is EmptyIfLogic
  24. 24Message RouterSwitchLogic
  25. 25Alert OperatorEmail SendService
  26. 26Create Temporary MessageData TableService
  27. 27Update Last MessageData TableService
  28. 28Forward Message To GroupHttp RequestService
  29. 29Operator ConfirmedIfLogic
  30. 30Operator AttendanceTelegramService
  31. 31Operator Declined AttendanceTelegramService
  32. 32Create TopicHttp RequestService
  33. 33Update Temporary MessageData TableService

How it's built

Starts on
An incoming Telegram message
Steps
33, with 8 branches
Size
Large: read it before trusting it with anything live
Connects to
Email, Telegram, n8n data table
Model
Azure OpenAI, OpenRouter
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 Email and Telegram accounts, and a key for Azure OpenAI and OpenRouter. 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 Azure OpenAI and OpenRouter. 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 33 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 33 steps before you point it at anything that matters.