Automatically convert documents from Google Drive into vector embeddings using OpenAI, LangChain, and PGVector â fully automated through n8n.
This workflow monitors a Google Drive folder for new files, supports multiple file types (PDF, TXT, JSON), and processes them into vector embeddings using OpenAIâs text-embedding-3-small
model. These embeddings are stored in a Postgres database using the PGVector extension, making them query-ready for semantic search or RAG-based AI agents.
After successful processing, files are moved to a separate âvectorizedâ folder to avoid duplication.
Search Folder
, Download File
, and Move File
nodes)Embeddings OpenAI
node)Postgres PGVector Store
node)Search Folder
node â this is where incoming files are placed.Move File
node â files will be moved here after vectorization.Postgres PGVector Store
node.Embeddings OpenAI
node and select text-embedding-3-small
.Schedule Trigger
node to run daily or configure your own schedule.When clicking âTest workflowâ
for on-demand ingestion.Want to support more file types or enhance the pipeline?
Extract from File
with other formats like DOCX, Markdown, or HTML.Switch
node routes files to the correct extraction method based on MIME type (application/pdf
, text/plain
, application/json
).Search Folder
or Switch
node logic to skip specific files or folders.Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Use, adapt, and share - even commercially - as long as you give proper credit and share alike.
Full License Details