Automation library · Customer support

Build a Telegram AI assistant with MemMachine and OpenAI

Started by an incoming Telegram message, and works across Gmail, Google Calendar, Google Sheets and Telegram. It hands the judgement calls to OpenAI. 21 steps, 1 branch: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

21 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
0Loops or waits
4Services it connects to

The flow

Starts it 2Model 4Logic 7Service 8

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

  1. 11. Telegram TriggerTelegram triggerStarts it
  2. 2Gmail ToolGmail ToolService
  3. 3Google Sheets ToolGoogle Sheets ToolService
  4. 4Google Calendar ToolGoogle Calendar ToolService
  5. 5MCP ClientMcp Client ToolModel
  6. 6OpenAI Chat ModelLm Chat Open AiModel
  7. 72. Message TypeSwitchLogic
  8. 8MCP Server TriggerMcp triggerStarts it
  9. 97. AI AgentAgentModel
  10. 103a. Download VoiceTelegramService
  11. 113d. Extract Text DataSetLogic
  12. 128. Extract ResponseSetLogic
  13. 133b. Transcribe VoiceOpen AiModel
  14. 14UnifierCodeLogic
  15. 158b. Prepare for StorageCodeLogic
  16. 163c. Extract Voice DataSetLogic
  17. 174. Store User QueryHttp RequestService
  18. 189. Store AI ResponseHttp RequestService
  19. 195. Search MemoryHttp RequestService
  20. 2010. Send ResponseTelegramService
  21. 216. Format MemoryCodeLogic

How it's built

Starts on
An incoming Telegram message
Steps
21, with 1 branch
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Calendar, Google Sheets, Telegram
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Calendar, Google Sheets 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. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 21 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 21 steps before you point it at anything that matters.