Build a Google Drive document similarity database with Ollama and Postgres

Go to Workflow
0 views
Built by Siddharth Gupta Siddharth Gupta
Created on September 06, 2026

Description

Quick overview
This workflow clears two PostgreSQL tables, then scans a specific Google Drive folder for files and prepares to download each document for processing.

How it works
Starts by deleting the n8n_vectors table in PostgreSQL to remove existing vector data.
Deletes the scraped_pages table in PostgreSQL to clear previously scraped page records.
Lists all files in a specified Google Drive folder and returns each file’s ID, name, and webViewLink.
Downloads each listed Google Drive document using its file ID so it can be used in downstream steps.

Setup
Add PostgreSQL credentials with permission to delete tables, and confirm the public.n8n_vectors and public.scraped_pages tables match your environment.
Add a Google Drive OAuth2 connection with access to the target folder and its files.
Update the Google Drive folder URL/ID in the folder scan step to point to your source directory.

Nodes Used (8)

Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings Ollama
@n8n/n8n-nodes-langchain.embeddingsOllama
Google Drive
n8n-nodes-base.googleDrive
HTML
n8n-nodes-base.html
Postgres
n8n-nodes-base.postgres
Postgres PGVector Store
@n8n/n8n-nodes-langchain.vectorStorePGVector
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter