Build a Google Drive document similarity database with Ollama and Postgres
Ready for 3.0What this workflow does
This AI workflow has 56 nodes and runs when a chat message arrives. Along the way it connects Google Drive, Postgres, Postgres PGVector Store and Embeddings Ollama.
How it runs
Trigger: When a chat message arrives.
- Prompt Main Action (Chat): send and wait for a reply
- Route Operations Mode (Switch): routes items into 2 branches
- Prompt Operational Rules (Chat): send and wait for a reply
- Confirm Pipeline Launch (Chat): send and wait for a reply
- Verify Rules Selection (If): checks a condition and branches into true / false
- Validate Launch Parameters (Code): runs custom JavaScript code
- Clear Vector Table (Postgres): delete table
- Broadcast Error Alert (Chat): uses Chat
- Evaluate Validation Results (If): checks a condition and branches into true / false
- Clear Scraped Pages Table (Postgres): delete table
…plus 39 more steps. See the full node list below.
Services it uses
Other Google Drive + PostgreSQL templates (65) · Other Ollama + PostgreSQL templates (20) · Other Google Drive + Ollama templates (14)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (17)
- Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Google Drive
n8n-nodes-base.googleDrive - HTML
n8n-nodes-base.html - Postgres
n8n-nodes-base.postgres - Postgres PGVector Store
@n8n/n8n-nodes-langchain.vectorStorePGVector - Embeddings Ollama
@n8n/n8n-nodes-langchain.embeddingsOllama - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Remove Duplicates
n8n-nodes-base.removeDuplicates - Filter
n8n-nodes-base.filter - Convert to File
n8n-nodes-base.convertToFile - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Chat
@n8n/n8n-nodes-langchain.chat - Switch
n8n-nodes-base.switch - If
n8n-nodes-base.if
From the author
Quick overview Builds a searchable semantic similarity database from Google Drive documents using PostgreSQL, PGVector, and Ollama embeddings, then analyzes document similarity and provides interactive internal linking recommendations through chunk-level and…