Index Google Drive documents with OpenAI embeddings and Pinecone
Ready for 3.0What this workflow does
This AI workflow has 62 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects Embeddings OpenAI, Google Drive, Pinecone Vector Store and Gmail. It also calls api.openai.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).
- Settings (Edit Fields (Set)): sets 7 fields: adminEmail, pineconeIndexName, pineconeIndexHost…
- Find documents in Drive (Google Drive): work with file folder
- Reduce to single run (Code): runs custom JavaScript code
- Skip temp files (TEMP_) (If): checks a condition and branches into true / false
- Process documents one by one (Loop Over Items (Split in Batches)): loops over the items in batches
- Get all entries from table (Data table): get
- Is the file already indexed? (Data table): get
- Find orphaned entries (Code): runs custom JavaScript code
- Check lookup result (Code): runs custom JavaScript code
- Process orphans one by one (Loop Over Items (Split in Batches)): loops over the items in batches
…plus 44 more steps. See the full node list below.
Services it uses
Other OpenAI + Gmail templates (1,623) · Other OpenAI + Google Drive templates (628) · Other Gmail + Google Drive templates (465)
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (17)
- Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Edit Fields (Set)
n8n-nodes-base.set - Manual Trigger
n8n-nodes-base.manualTrigger - Google Drive
n8n-nodes-base.googleDrive - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - No Operation, do nothing
n8n-nodes-base.noOp - Code
n8n-nodes-base.code - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - HTTP Request
n8n-nodes-base.httpRequest - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Data table
n8n-nodes-base.dataTable - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Quick overview This workflow keeps a Pinecone knowledge base in sync with a Google Drive folder by extracting text from supported files, generating OpenAI embeddings, and upserting vectors with metadata, while emailing an admin via Gmail when unsupported…