Description
Turn your Google Drive documents into vector embeddings with OpenAI and PGVector โ fully automated via n8n
๐ Stop manual embedding workflows โ this automation detects, extracts, embeds, and stores documents with no code and no hassle
๐ง What Problem Does It Solve?
Embedding private documents manually for semantic search or RAG pipelines is tedious and error-prone. This AI-powered workflow solves that by:
๐น Monitoring a folder for new files
๐น Extracting content from PDFs, TXT, and JSON
๐น Converting content into embeddings via OpenAI
๐น Storing embeddings in PGVector (PostgreSQL)
๐น Archiving processed files to prevent duplication
โ๏ธ How it Works
๐ Watches a Google Drive folder for new files
๐ Supports PDF, TXT, and JSON formats
๐ Uses Switch logic to handle file types correctly
๐งผ Extracts and cleans text via LangChain
๐ง Sends content to OpenAIโs text-embedding-3-small model
๐พ Stores vectors in PGVector-enabled PostgreSQL
๐ฆ Moves processed files to a โvectorizedโ folder
โจ Key Features
๐ Fully automated ingestion and vectorization
๐ง OpenAI Embeddings + LangChain integration
๐ Handles structured and unstructured documents
๐ Automatically avoids reprocessing duplicates
๐ Ideal for RAG pipelines, document Q&A, internal search
๐
Optional: run daily via Schedule Trigger
๐งฐ What You Need
โ
Google Drive account with OAuth2 setup
โ
OpenAI API key (for Embedding API access)
โ
PostgreSQL database with PGVector extension
โ
Table and collection pre-created in your DB
๐ ๏ธ Setup Instructions
๐ Connect all Google Drive nodes with OAuth2 credentials
๐ Set upload folder in the Search Folder node
๐ฆ Set target โvectorizedโ folder in Move File node
๐ง Configure the OpenAI node with your API key
๐พ Connect the PGVector node with your DB details
โฐ Optionally enable daily run via Schedule Trigger
๐งช Use Manual Trigger for on-demand execution
๐ง Advanced Customizations
๐ Add DOCX, HTML, or Markdown support via Extract node
๐ผ๏ธ Add OCR layer for scanned PDFs or images
๐ซ Use filters to ignore unwanted files or extensions
๐งฉ Integrations
Google Drive
OpenAI
LangChain
PostgreSQL + PGVector
n8n
Project Link:-[https://preview--drive-vector-flow.lovable.app/]