Automation library · Documents and files

AI-Powered RAG Document Processing & Chatbot with Google Drive

Started by someone opening a chat with it, and works across Google Drive and Supabase vectors. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 27 steps, 1 branch, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini, OpenAIRetrieval

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

The flow

Starts it 2Model 14Logic 7Service 4

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

  1. 1Google Drive Trigger File CreatedGoogle Drive triggerStarts it
  2. 2Character Text SplitterText Splitter Character Text SplitterModel
  3. 3Structured Output ParserOutput Parser StructuredModel
  4. 4Google Gemini Chat ModelLm Chat Google GeminiModel
  5. 5Embeddings OpenAIEmbeddings Open AiModel
  6. 6Google Gemini Chat Model1Lm Chat Google GeminiModel
  7. 7OpenAI Chat ModelLm Chat Open AiModel
  8. 8Embeddings OpenAI1Embeddings Open AiModel
  9. 9When chat message receivedChat triggerStarts it
  10. 10Simple MemoryMemory Buffer WindowModel
  11. 11Loop Over ItemsSplit In BatchesLogic
  12. 12Default Data LoaderDocument Default Data LoaderModel
  13. 13Create Metadata Title & DescriptionChain LlmModel
  14. 14Process ContextChain LlmModel
  15. 15Add Data to Supabase Vector StoreVector Store SupabaseModel
  16. 16AI AgentAgentModel
  17. 17Supabase Vector StoreVector Store SupabaseModel
  18. 18Set File IDSetLogic
  19. 19Split into chunksCodeLogic
  20. 20SummarizeSummarizeService
  21. 21Download FIleGoogle DriveService
  22. 22Split OutSplit OutLogic
  23. 23SwitchSwitchLogic
  24. 24LimitLimitLogic
  25. 25Extract from PDFExtract From FileService
  26. 26Extract from CSVExtract From FileService
  27. 27Document DataSetLogic

How it's built

Starts on
Someone opening a chat with it
Steps
27, with 1 branch, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Supabase vectors
Model
Gemini, 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 and Supabase vectors accounts, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini and 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 27 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 27 steps before you point it at anything that matters.