Extract and analyze Google Drive documents with AI
Workflow Description
An automation that receives questions via chat, loads documents from Google Drive, splits them into manageable chunks, converts them to vector embeddings, and searches a vector database to find relevant answers using OpenAI models.
How it works
- 1.Receive user query through ChatTrigger
- 2.Automatically load documents from Google Drive
- 3.Split text into smaller, processable chunks
- 4.Convert chunks to OpenAI embeddings
- 5.Search Pinecone vector store for matching context
- 6.Send context and query to OpenAI for intelligent response
Use cases
- Answer questions about documents stored in your Google Drive
- Index and analyze reports, PDFs, and business documents
- Build a smart assistant that understands company knowledge bases
- Search quickly for specific information across large file collections
Requirements
- OpenAI API key with Embeddings and Chat Completion permissions
- Google account with Google Drive access authorization
- Active Pinecone project with configured vector index
- OpenAI embedding model such as text-embedding-3-small
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (22)
When clicking "Execute Workflow"
Manual Trigger
Embeddings OpenAI
OpenAI
Sticky Note
Sticky Note
Default Data Loader
Document Default Data Loader
Set file URL in Google Drive
Set
Sticky Note2
Sticky Note
Add in metadata
Code
Download file
Google Drive
Chat Trigger
Chat Trigger
Prepare chunks
Code
Embeddings OpenAI2
OpenAI
OpenAI Chat Model
OpenAI
Set max chunks to send to model
Set
Structured Output Parser
Output Parser Structured
Compose citations
Set
Generate response
Set
Sticky Note1
Sticky Note
Answer the query based on chunks
LLM Chain
Sticky Note4
Sticky Note
Get top chunks matching query
Vector Store Pinecone
Add to Pinecone vector store
Vector Store Pinecone
Recursive Character Text Splitter
Text Splitter Recursive Character Text Splitter