Templates / Detect and mask PII for GDPR-safe AI document analysis with Anthropic and PostgreSQL

Detect and mask PII for GDPR-safe AI document analysis with Anthropic and PostgreSQL

Ready for 3.0

by ResilNext ✓ · 69 views · created 2026-03-25 · 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 Anthropic Chat Model and Postgres.

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. 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: Anthropic 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

Anthropic Chat ModelPostgres

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 (11)

From the author

Overview This workflow enables GDPR-compliant document processing by detecting, masking, and securely handling personally identifiable information (PII) before AI analysis. It ensures that sensitive data is never exposed to AI systems by replacing it with…

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.