Ingest and vectorize documents with Gemini and PostgreSQL pgvector
Ready for 3.0What this workflow does
This workflow has 21 nodes and runs when another workflow calls it. Along the way it connects Postgres. It also calls generativelanguage.googleapis.com over HTTP.
How it runs
Trigger: When another workflow calls it.
- Validate Input and Binary (Code): runs custom JavaScript code
- Route by File Type (Switch): routes items into 4 branches
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Extract DOCX Text (Extract from File): extracts data from a file (docx)
- Extract TXT Text (Extract from File): extracts data from a file (text)
- Extract CSV Rows (Extract from File): extracts data from a file (csv)
- Normalize Extracted Content (Code): runs custom JavaScript code
- Gemini - Extract Metadata (HTTP Request): calls generativelanguage.googleapis.com (POST)
- Parse Metadata Response (Code): runs custom JavaScript code
- SHA-256 Content Fingerprint (Crypto): hashes or encrypts values
…plus 9 more steps. See the full node list below.
Services it uses
Other Google Gemini + PostgreSQL templates (47)
HTTP calls to: generativelanguage.googleapis.com
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 (10)
- Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Extract from File
n8n-nodes-base.extractFromFile - HTTP Request
n8n-nodes-base.httpRequest - Crypto
n8n-nodes-base.crypto - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick Overview This subworkflow ingests uploaded documents (PDF, DOCX, TXT, or CSV), extracts text, uses Google Gemini to generate metadata and embeddings, and stores chunked vectors in PostgreSQL with pgvector for semantic search while skipping unchanged…