Effortless Vector Database Loading from Google Drive with n8n
detail.loadingPreview
Automate the ingestion of your Google Drive documents into a PostgreSQL Vector database. This workflow efficiently processes various file types, splits them into manageable chunks, generates embeddings using OpenAI, and stores them for powerful semantic search and AI applications.
About This Workflow
This n8n workflow is designed to bridge the gap between your cloud storage and your vectorized data infrastructure. It begins by automatically scanning a designated Google Drive folder for new or updated files. Once identified, each file is downloaded, its content is extracted based on its MIME type (supporting PDFs and plain text), and then intelligently segmented into smaller, digestible chunks using the Recursive Character Text Splitter. For each chunk, OpenAI embeddings are generated, leveraging the text-embedding-3-small model. Finally, these vectorized representations are efficiently inserted into a PostgreSQL database with the PGVector extension, specifically into the n8n_vectors_wfs table within the n8n_wfs collection. Upon successful vectorization, the original file is moved to a 'vectorized' folder in Google Drive, keeping your source organized.
Key Features
- Automated Google Drive Integration: Seamlessly connect to your Google Drive to discover and process files.
- Intelligent Text Splitting: Empowers efficient processing of large documents by breaking them into optimal chunks.
- OpenAI Embeddings: Utilizes powerful AI models to convert text into meaningful vector representations.
- PostgreSQL PGVector Support: Leverages the robust and scalable PGVector extension for storing and querying vector data.
- File Management: Automatically moves processed files to a designated folder, maintaining workflow cleanliness.
How To Use
- Trigger Configuration: Choose between the 'Manual Trigger' (for testing) or the 'Schedule Trigger' (e.g., daily at 3 AM) to initiate the workflow.
- Google Drive Setup: Ensure you have connected your Google Drive account via OAuth2 credentials.
- Folder Configuration: Specify the
folderIdfor the Google Drive folder containing your documents to be processed (e.g., 'n8n Workflow JSON Files'). - OpenAI Setup: Connect your OpenAI account using API credentials.
- PostgreSQL Setup: Configure your PostgreSQL connection with the PGVector extension enabled. Set the
collectionNameto 'n8n_wfs' andtableNameto 'n8n_vectors_wfs'. - File Processing: The 'Switch' node handles different file types (PDF and text). The 'Default Data Loader' extracts content, and the 'Recursive Character Text Splitter' segments it.
- Embedding & Storage: 'Embeddings OpenAI' generates vectors, and 'Postgres PGVector Store' inserts them into your database.
- File Archiving: The 'Move File' node relocates processed files to a 'vectorized' folder.
Apps Used
Workflow JSON
{
"id": "00232d3f-7867-4155-acfe-afa447187017",
"name": "Effortless Vector Database Loading from Google Drive with n8n",
"nodes": 28,
"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: 00232d3f-7867...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
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.