Automation library · Customer support

Create a multi-modal Telegram support bot with OpenAI

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

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 2Model 13Logic 15Service 18

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2When clicking ‘Execute workflow’Manual triggerStarts it
  3. 3Recursive Character Text Splitter1Text Splitter Recursive Character Text SplitterModel
  4. 4OpenAI Chat Model1Lm Chat Open AiModel
  5. 5Embeddings OpenAIEmbeddings Open AiModel
  6. 6Embeddings OpenAI1Embeddings Open AiModel
  7. 7Postgres Chat MemoryMemory Postgres ChatModel
  8. 8Reranker CohereReranker CohereModel
  9. 9Input Message RouterSwitchLogic
  10. 10Typing…TelegramService
  11. 11Download fileGoogle DriveService
  12. 12Default Data Loader1Document Default Data LoaderModel
  13. 13Knowledge Base AI AgentAgentModel
  14. 14Add to Supabase Vector DBVector Store SupabaseModel
  15. 15Supabase Vector Store SearchVector Store SupabaseModel
  16. 16Extract TextSetLogic
  17. 17Download AudioTelegramService
  18. 18Download PhotoTelegramService
  19. 19Supported Document File TypesCodeLogic
  20. 20TelegramTelegramService
  21. 21Translate to TextOpen AiModel
  22. 22Fix mimeType1CodeLogic
  23. 23IfIfLogic
  24. 24Photo to textOpen AiModel
  25. 25Group Similar DocumentsCodeLogic
  26. 26Extract Error MessageSetLogic
  27. 27Extract Text & ContentSetLogic
  28. 28Document RouterSwitchLogic
  29. 29Download ImageTelegramService
  30. 30Download PDFTelegramService
  31. 31Download Word DocumentTelegramService
  32. 32Download SpreadsheetTelegramService
  33. 33Download JSONTelegramService
  34. 34Download XMLTelegramService
  35. 35Fix mimeTypeCodeLogic
  36. 36Extract from PDFExtract From FileService
  37. 37File to Base64Extract From FileService
  38. 38Extract from SpreadsheetExtract From FileService
  39. 39Extract from JSONExtract From FileService
  40. 40Extract from XMLExtract From FileService
  41. 41Photo to text1Open AiModel
  42. 42Extract Text4SetLogic
  43. 43Convert to text (convertapi.com)Http RequestService
  44. 44Extract Text1SetLogic
  45. 45Extract Text2SetLogic
  46. 46Extract Text3SetLogic
  47. 47Download TextHttp RequestService
  48. 48Extract Text5SetLogic

How it's built

Starts on
An incoming Telegram message
Steps
48, with 3 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Supabase vectors, 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 Google Drive, Supabase vectors 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 48 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 48 steps before you point it at anything that matters.