Templates / Mask PII in documents for GDPR-safe AI processing with Postgres and Claude

Mask PII in documents for GDPR-safe AI processing with Postgres and Claude

Ready for 3.0

by ResilNext ✓ · 140 views · created 2026-03-08 · Document Extraction, AI Summarization

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-10-19.

What this workflow does

This AI workflow has 24 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Postgres, Anthropic Chat Model and Ollama Chat Model.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Workflow Configuration (Edit Fields (Set)): sets 4 fields: documentId, confidenceThreshold, vaultTable…
  2. OCR Extract Text (Extract from File): extracts data from a file (pdf)
  3. Email Detector (Code): runs custom JavaScript code
  4. Phone Detector (Code): runs custom JavaScript code
  5. ID Number Detector (Code): runs custom JavaScript code
  6. Address Detector AI (AI Agent): runs an AI agent, with model: Ollama Chat Model; output parser: Address Output Parser
  7. Merge: merges the data from its input branches
  8. PII Consolidation & Conflict Resolver (Code): runs custom JavaScript code
  9. Tokenization & Vault Storage (Code): runs custom JavaScript code
  10. Store Tokens in Vault (Postgres): uses Postgres

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

Services it uses

PostgresAnthropic Chat ModelOllama Chat Model

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.

Nodes used (12)

From the author

Overview This workflow implements a privacy-preserving AI document processing pipeline that detects, masks, and securely manages Personally Identifiable Information (PII) before any AI processing occurs. Organizations often need to analyze documents such as…

Excerpt from ResilNext'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.