Templates / Ingest and vectorize documents with Gemini and PostgreSQL pgvector

Ingest and vectorize documents with Gemini and PostgreSQL pgvector

Ready for 3.0

by Intuz ✓ · 1 views · created 2026-11-03 · Document Extraction, AI RAG

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What 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.

  1. Validate Input and Binary (Code): runs custom JavaScript code
  2. Route by File Type (Switch): routes items into 4 branches
  3. Extract PDF Text (Extract from File): extracts data from a file (pdf)
  4. Extract DOCX Text (Extract from File): extracts data from a file (docx)
  5. Extract TXT Text (Extract from File): extracts data from a file (text)
  6. Extract CSV Rows (Extract from File): extracts data from a file (csv)
  7. Normalize Extracted Content (Code): runs custom JavaScript code
  8. Gemini - Extract Metadata (HTTP Request): calls generativelanguage.googleapis.com (POST)
  9. Parse Metadata Response (Code): runs custom JavaScript code
  10. SHA-256 Content Fingerprint (Crypto): hashes or encrypts values

…plus 9 more steps. See the full node list below.

Services it uses

Postgres

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.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (10)

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…

Excerpt from Intuz 's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.