Automation library · AI assistants

Build a cost engineering RAG with Google Drive and OpenAI

Started by someone opening a chat with it, and works across Google Drive and Pinecone. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 22 steps: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

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

The flow

Starts it 3Model 7Logic 8Service 4

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

  1. 1Schedule Document IngestionSchedule triggerStarts it
  2. 2Split Documents into ChunksText Splitter Recursive Character Text SplitterModel
  3. 3Generate EmbeddingsEmbeddings Open AiModel
  4. 4Receive User QueryChat triggerStarts it
  5. 5Generate AnswerLm Chat Open AiModel
  6. 6Provide Knowledge Base SettingsExecute Workflow triggerStarts it
  7. 7Get Ingestion SettingsExecute WorkflowLogic
  8. 8Convert Text to DocumentsDocument Default Data LoaderModel
  9. 9Store Document EmbeddingsVector Store PineconeModel
  10. 10Retrieve Relevant DocumentsVector Store PineconeModel
  11. 11Get Retrieval SettingsExecute WorkflowLogic
  12. 12Answer Query Using Knowledge BaseAgentModel
  13. 13Define Knowledge Base ConfigurationSetLogic
  14. 14Load Ingestion ConfigurationSetLogic
  15. 15Move Document to Processed FolderGoogle DriveService
  16. 16Load Retrieval ConfigurationSetLogic
  17. 17Response ReadyNo OpLogic
  18. 18Configuration ReadyNo OpLogic
  19. 19List Pending DocumentsGoogle DriveService
  20. 20Ingestion CompleteNo OpLogic
  21. 21Download Source DocumentGoogle DriveService
  22. 22Extract PDF ContentExtract From FileService

How it's built

Starts on
Someone opening a chat with it
Steps
22
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Pinecone
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 and Pinecone 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 22 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 22 steps before you point it at anything that matters.