Effortlessly Vectorize Google Drive Documents with n8n
detail.loadingPreview
Automate the process of loading and preparing your Google Drive documents for AI-powered vector databases. This n8n workflow securely connects to your Google Drive, splits documents into manageable chunks, and embeds them using OpenAI for efficient storage and retrieval.
About This Workflow
This n8n workflow streamlines the ingestion of your Google Drive documents into a vector database. It starts by searching for specific files within a designated Google Drive folder, then downloads and processes them. Utilizing LangChain nodes, the workflow splits text content into optimized chunks, generates embeddings via OpenAI's powerful models, and finally inserts this vectorized data into a PostgreSQL database with PGVector extension. The workflow also includes automation for moving processed files to a 'vectorized' folder, ensuring efficient management and preventing re-processing. This solution is ideal for building intelligent search, recommendation, or Q&A systems on your existing document repositories.
Key Features
- Automated Google Drive Integration: Seamlessly search, download, and manage files from your Google Drive.
- Intelligent Document Chunking: Leverages LangChain's Recursive Character Text Splitter for optimal text segmentation.
- Powerful AI Embeddings: Utilizes OpenAI's
text-embedding-3-smallmodel for high-quality vector representations. - PostgreSQL PGVector Support: Directly inserts vectorized data into a PGVector-enabled PostgreSQL database.
- Automated File Management: Moves processed files to a designated 'vectorized' folder.
How To Use
- Trigger Configuration: Choose between a 'Schedule Trigger' (e.g., daily at 3 AM) or a 'When clicking ‘Test workflow’' manual trigger.
- Google Drive Search: Configure the 'Search Folder' node to specify the Google Drive folder containing your documents (e.g., 'n8n Workflow JSON Files').
- Looping and Downloading: The 'Loop Over Items' node iterates through found files, and the 'Download File' node retrieves each document.
- File Type Handling: The 'Switch' node differentiates between PDF and plain text files based on MIME type.
- Document Processing: The 'Default Data Loader' and 'Recursive Character Text Splitter' nodes prepare your document content for embedding.
- OpenAI Embeddings: Connect your OpenAI credentials and select the desired embedding model (e.g.,
text-embedding-3-small) in the 'Embeddings OpenAI' node. - Vector Database Insertion: Configure the 'Postgres PGVector Store' node with your PostgreSQL credentials, collection name ('n8n_wfs'), and table name ('n8n_vectors_wfs') to store the vectorized data.
- File Archiving: The 'Move File' node automatically moves the processed file to a designated 'vectorized' folder in your Google Drive.
Apps Used
Workflow JSON
{
"id": "9fd9e724-9933-4335-b99e-3869de9913f9",
"name": "Effortlessly Vectorize Google Drive Documents with n8n",
"nodes": 12,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 9fd9e724-9933...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Effortless Bug Reporting: Slack Slash Command to Linear Issue
Streamline your bug reporting process by instantly creating Linear issues directly from Slack using a simple slash command. This workflow enhances team collaboration by providing immediate feedback and a structured approach to logging defects, saving valuable time for development and QA teams.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.