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/]















