Detect and mask PII for GDPR-safe AI document analysis with Anthropic and PostgreSQL
Ready for 3.0What 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.
- Workflow Configuration (Edit Fields (Set)): sets 4 fields: documentId, confidenceThreshold, vaultTable…
- Extract Text (Extract from File): extracts data from a file (pdf)
- Email Detector (Code): runs custom JavaScript code
- Phone Detector (Code): runs custom JavaScript code
- ID Number Detector (Code): runs custom JavaScript code
- Address Detector AI (AI Agent): runs an AI agent, with model: Anthropic Chat Model; output parser: Address Output Parser
- Merge: merges the data from its input branches
- PII Consolidation & Conflict Resolver (Code): runs custom JavaScript code
- Tokenization & Vault Storage (Code): runs custom JavaScript code
- Store Tokens in Vault (Postgres): uses Postgres
…plus 9 more steps. See the full node list below.
Services it uses
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)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Extract from File
n8n-nodes-base.extractFromFile
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…