Automation library · Documents and files

Provide academic OCR and RAG answers on Telegram with Gemini

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

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 3Model 10Logic 2Service 13

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2OpenAI Chat ModelLm Chat Open AiModel
  3. 3Get row(s) in sheet in Google SheetsGoogle Sheets ToolService
  4. 4Google Drive TriggerGoogle Drive triggerStarts it
  5. 5Embeddings OpenAIEmbeddings Open AiModel
  6. 6Default Data LoaderDocument Default Data LoaderModel
  7. 7OpenAI Chat Model1Lm Chat Open AiModel
  8. 8When Executed by Another WorkflowExecute Workflow triggerStarts it
  9. 9Postgres Chat Memory1Memory Postgres ChatModel
  10. 10Embeddings HuggingFace Inference1Embeddings Hugging Face InferenceModel
  11. 11SwitchSwitchLogic
  12. 12AI Agent2AgentModel
  13. 13Download fileGoogle DriveService
  14. 14Supabase Vector Store1Vector Store SupabaseModel
  15. 15AI AgentAgentModel
  16. 16Get many rowsSupabaseService
  17. 17Supabase Vector StoreVector Store SupabaseModel
  18. 18from FileExtract From FileService
  19. 19Telegram5TelegramService
  20. 20Get row(s) in sheetGoogle SheetsService
  21. 21Telegram4TelegramService
  22. 22Send a text messageTelegramService
  23. 23Append or update row in sheetGoogle SheetsService
  24. 24Analisa gambarHttp RequestService
  25. 25IfIfLogic
  26. 26Respon errorTelegramService
  27. 27Google SheetsGoogle SheetsService
  28. 28Telegram1TelegramService

How it's built

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