Automation library · Documents and files

Automated document ingestion & vectorization with RAG

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

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 4Model 15Logic 14Service 14

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

  1. 1Embeddings OpenAI1Embeddings Open AiModel
  2. 2Recursive Character Text SplitterText Splitter Recursive Character Text SplitterModel
  3. 3When chat message receivedChat triggerStarts it
  4. 4OpenAI Chat ModelLm Chat Open AiModel
  5. 5Postgres Chat MemoryMemory Postgres ChatModel
  6. 6Embeddings OpenAIEmbeddings Open AiModel
  7. 7Structured Output ParserOutput Parser StructuredModel
  8. 8OpenAI Chat Model1Lm Chat Open AiModel
  9. 9New filesGoogle Drive triggerStarts it
  10. 10Update FilesGoogle Drive triggerStarts it
  11. 11New files1Google Drive triggerStarts it
  12. 12Query Vector StoreTool WorkflowModel
  13. 13Supabase Vector Store1Vector Store SupabaseModel
  14. 14Default Data Loader1Document Default Data LoaderModel
  15. 15AI AgentAgentModel
  16. 16Documents knowledgeVector Store SupabaseModel
  17. 17Auto-fixing Output ParserOutput Parser AutofixingModel
  18. 18Basic LLM ChainChain LlmModel
  19. 19Loop Over Items1Split In BatchesLogic
  20. 20Loop Over ItemsSplit In BatchesLogic
  21. 21Set metadataSetLogic
  22. 22Download fileGoogle DriveService
  23. 23Search Record Manager1SupabaseService
  24. 24Set Text for EmbeddingSetLogic
  25. 25Switch1SwitchLogic
  26. 26If1IfLogic
  27. 27Get a documentGoogle DocsService
  28. 28Extract from FileExtract From FileService
  29. 29Extract from File1Extract From FileService
  30. 30Delete Previous Vector1SupabaseService
  31. 31Delete a fileGoogle DriveService
  32. 32Set TextSetLogic
  33. 33Strip out New lines & WhitespaceSetLogic
  34. 34MarkdownMarkdownLogic
  35. 35Update record manager1SupabaseService
  36. 36Generate HashCryptoService
  37. 37IfIfLogic
  38. 38Search Record ManagerSupabaseService
  39. 39Set content pdfSetLogic
  40. 40Download file1Google DriveService
  41. 41SwitchSwitchLogic
  42. 42Extract textMistral AiModel
  43. 43Created a row in record managerSupabaseService
  44. 44Delete Previous VectorSupabaseService
  45. 45Réunir toutes pagesCodeLogic
  46. 46Update record managerSupabaseService
  47. 47Set content ocrSetLogic

How it's built

Starts on
Someone opening a chat with it
Steps
47, with 4 branches, 2 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Docs, Google Drive, Supabase, Supabase vectors
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 Docs, Google Drive, Supabase and Supabase vectors accounts, and a key for 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 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 47 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 47 steps before you point it at anything that matters.