Automation library · Chat assistants

Telegram chatbot with OpenAI

Started by an incoming Telegram message, and works across Google Sheets, 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. 26 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

26 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
1Loop or waits
3Services it connects to

The flow

Starts it 1Model 6Logic 10Service 9

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

  1. 1Embeddings OpenAI1Embeddings Open AiModel
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3Simple MemoryMemory Buffer WindowModel
  4. 4Telegram TriggerTelegram triggerStarts it
  5. 5Supabase Vector StoreVector Store SupabaseModel
  6. 6AI AgentAgentModel
  7. 7Link FilterIfLogic
  8. 8Send message Back to TGTelegramService
  9. 9Get Audio FileTelegramService
  10. 10Pass text messageSetLogic
  11. 11Delete Row from Message CheckupGoogle SheetsService
  12. 12Transcribe a recordingOpen AiModel
  13. 13MergeMergeLogic
  14. 14Transcript ResultSetLogic
  15. 15Transcript Error OutputSetLogic
  16. 16Edit FieldsSetLogic
  17. 17Append row in sheetGoogle SheetsService
  18. 18Get row(s) in sheet1Google SheetsService
  19. 19No RowsCodeLogic
  20. 20What to doIfLogic
  21. 21Update row in sheetGoogle SheetsService
  22. 22Update row in sheet1Google SheetsService
  23. 23WaitWaitLogic
  24. 24Get row(s) in sheetGoogle SheetsService
  25. 25Batch MessagesCodeLogic
  26. 26Delete rows or columns from sheet1Google SheetsService

How it's built

Starts on
An incoming Telegram message
Steps
26, with 2 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Sheets, 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 Sheets, 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 26 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 26 steps before you point it at anything that matters.