Automation library · Data collection

Create a self-updating RAG chatbot with Google Drive

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

LargeCalls a model: GeminiRetrieval

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

The flow

Starts it 5Model 10Logic 7Service 12

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

  1. 1Reranker CohereReranker CohereModel
  2. 2File CreatedGoogle Drive triggerStarts it
  3. 3File UpdatedGoogle Drive triggerStarts it
  4. 4Character Text SplitterText Splitter Character Text SplitterModel
  5. 5Schedule TriggerSchedule triggerStarts it
  6. 6When clicking ‘Test workflow’Manual triggerStarts it
  7. 7Postgres Chat MemoryMemory Postgres ChatModel
  8. 8When chat message receivedChat triggerStarts it
  9. 9Google Gemini Chat ModelLm Chat Google GeminiModel
  10. 10Embeddings Google GeminiEmbeddings Google GeminiModel
  11. 11Embeddings Google Gemini1Embeddings Google GeminiModel
  12. 12Supabase Vector StoreVector Store SupabaseModel
  13. 13Loop Over ItemsSplit In BatchesLogic
  14. 14Default Data Loader1Document Default Data LoaderModel
  15. 15Get File IDsGoogle DriveService
  16. 16SupabaseSupabaseService
  17. 17Get File IDs2Google DriveService
  18. 18Supabase2SupabaseService
  19. 19Search files and foldersGoogle DriveService
  20. 20RAG AgentAgentModel
  21. 21Insert into Supabase VectorstoreVector Store SupabaseModel
  22. 22Set File IDSetLogic
  23. 23MergeMergeLogic
  24. 24Merge2MergeLogic
  25. 25Delete Old Doc RowsSupabaseService
  26. 26Code1CodeLogic
  27. 27Code2CodeLogic
  28. 28Insert Document MetadataPostgresService
  29. 29Delete RowsSupabaseService
  30. 30Delete Rows2SupabaseService
  31. 31Download File1Google DriveService
  32. 32SwitchSwitchLogic
  33. 33Extract PDF TextExtract From FileService
  34. 34Extract Document TextExtract From FileService

How it's built

Starts on
Someone opening a chat with it
Steps
34, with 1 branch, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Postgres, Supabase, Supabase vectors
Model
Gemini
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, Postgres, Supabase and Supabase vectors accounts, and a key for Gemini. 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. 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 34 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 34 steps before you point it at anything that matters.