Upload and index files in Pinecone with Google Drive and OpenAI

Go to Workflow
0 views
Built by isaWOW isaWOW
Created on August 21, 2026

Description

Quick overview
This workflow accepts file uploads via a webhook, archives the originals in Google Drive, then chunks and embeds the content with OpenAI before indexing it into a Pinecone vector database for retrieval.

How it works
Receives a file upload via a POST webhook request as binary multipart form data.
Detects the file name, size, and extension and calculates dynamic chunk size, chunk overlap, and OpenAI embedding batch size.
Uploads the original file to a specified Google Drive folder to keep a source copy.
Downloads the same file back from Google Drive and prepares it for document loading.
Splits the document into pages and chunks (tagged with the source filename), generates OpenAI embeddings, and inserts the vectors into the specified Pinecone index.
Responds to the webhook with the workflow output once indexing completes.

Setup
Add credentials for Google Drive, OpenAI, and Pinecone.
Replace YOUR_GOOGLE_DRIVE_FOLDER_ID with the destination Drive folder ID and YOUR_PINECONE_INDEX_NAME with your Pinecone index name.
Activate the workflow, copy the webhook URL, and configure your client to POST a file using the file binary field (multipart/form-data).

Nodes Used (6)

Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
Google Drive
n8n-nodes-base.googleDrive
Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter