Skip to main content

Build a cost engineering RAG with Google Drive, OpenAI, and Pinecone

Workflow preview

Workflow preview
100%
Build a cost engineering RAG with Google Drive, OpenAI, and Pinecone preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow ingests PDF cost engineering manuals from Google Drive into a Pinecone vector index using OpenAI embeddings, then answers user questions via an n8n chat webhook using a...

Best for

  • Document Extraction automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.googledrive, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.vectorstorepinecone, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Alysson Neves.

Original n8n.io source

1.1 Workflow description

Title
Build a cost engineering RAG with Google Drive, OpenAI, and Pinecone
Workflow name
Build a cost engineering RAG with Google Drive, OpenAI, and Pinecone

Quick Overview

This workflow ingests PDF cost-engineering manuals from Google Drive into a Pinecone vector index using OpenAI embeddings, then answers user questions via an n8n chat webhook using a retrieval-augmented OpenAI agent that responds only with evidence from the indexed documents.

How it works

  1. Runs every 2 minutes on a schedule.
  2. Lists files in a configured Google Drive “incoming” folder and downloads each document.
  3. Extracts text from each PDF, splits it into overlapping chunks, and attaches document metadata.
  4. Generates OpenAI embeddings for the chunks and inserts them into the Pinecone rag index.
  5. Moves each successfully processed Google Drive file into a configured “ingested/archive” folder.
  6. Receives user questions through an n8n Chat webhook and uses a LangChain agent with a Pinecone retrieval tool plus an OpenAI chat model to answer strictly from retrieved passages (or returns the defined fallback message when evidence is missing).

Setup

  1. Connect Google Drive credentials and replace RAG_INCOMING_FOLDER_ID and RAG_INGESTED_FOLDER_ID with your actual folder IDs.
  2. Add an OpenAI API key for both embedding generation and chat responses, and confirm the chat model selection (e.g., gpt-4.1-mini).
  3. Connect Pinecone credentials, ensure an index named rag exists, and match its embedding dimension to the OpenAI embeddings model you use.
  4. Upload your Technical Composition Manuals as PDFs to the Google Drive incoming folder.
  5. Enable the Chat trigger and copy its webhook URL into the client/app you use to send questions (or use n8n’s chat UI).

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Document Ingestion

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 2 - List Pending Documents

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 3 - Download Source Document

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 4 - Extract PDF Content

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1.1

Block 5 - Split Documents into Chunks

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 6 - Generate Embeddings

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 7 - Store Document Embeddings

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.3

Block 8 - Move Document to Processed Folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 9 - Receive User Query

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 10 - Answer Query Using Knowledge Base

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 11 - Retrieve Relevant Documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.3

Block 12 - Generate Answer

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 13 - Get Ingestion Settings

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.3

Block 14 - Ingestion Complete

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 15 - Get Retrieval Settings

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.3

Block 16 - Provide Knowledge Base Settings

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 17 - Convert Text to Documents

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 18 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Response Ready

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 24 - Define Knowledge Base Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Build a cost engineering RAG with Google Drive, OpenAI, and Pinecone
Complexity advanced
Nodes 27
Categories Document Extraction, AI RAG
Author Alysson Neves
Published 10 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16251/16251.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build a cost engineering RAG with Google Drive, OpenAI, and Pinecone do?

Quick Overview This workflow ingests PDF cost engineering manuals from Google Drive into a Pinecone vector index using OpenAI embeddings, then answers user questions via an n8n chat webhook using a...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI RAG use case.