Skip to product information

Redact & Restore PII in n8n: Claude Sonnet via OpenRouter

Redact & Restore PII in n8n: Claude Sonnet via OpenRouter

 (200+Reviews)
Regular price £36.99
Regular price £36.99 Sale price
SAVE Sold out
Instant Digital Download
Unlimited Downloads
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
23 people viewing
High interest right now
9 added today
Fast-moving digital product
Redact & Restore PII in n8n: Claude Sonnet via OpenRouter

Redact & Restore PII in n8n: Claude Sonnet via OpenRouter

Regular price £36.99
Regular price £36.99 Sale price
SAVE Sold out

Redact & Restore PII in n8n using Claude Sonnet (via OpenRouter) — end-to-end safe LLM processing

This n8n workflow automatically removes sensitive personal data (PII) from incoming chat text, runs your custom AI task on the sanitized version, and then restores the original values in the final output—so you can keep privacy controls without losing context.

What this workflow does

  • Ingests chat text from the Chat Trigger input.
  • Redacts structured PII locally by detecting and tokenizing items such as email addresses, IBANs, payment card numbers (including Luhn validation), Finnish HETU, and phone-like numbers. It stores a token-to-original mapping.
  • Redacts unstructured PII with Claude Sonnet by calling OpenRouter (Anthropic Claude Sonnet) to identify additional sensitive spans (e.g., full names and home addresses) and returning them as an array.
  • Merges tokens and sanitizes text by replacing detected unstructured spans with redaction tokens.
  • Runs your configurable LLM task on the fully sanitized text using a second OpenRouter (Claude Sonnet) call (example tasks include summarization or classification).
  • Restores original values in the AI task output by replacing all redaction tokens with the originals, and returns restored text (including any unresolved tokens).

Use cases

  • Process customer chat conversations in n8n while keeping PII out of your LLM prompts.
  • Perform secure summarization/classification of support messages without leaking names, addresses, or payment details.
  • Build privacy-preserving workflows for SaaS operators handling sensitive user communications.

Technical details

  • n8n nodes: code, sticky note, Chat Trigger, OpenRouter Chat Model, LLM task step, and an output parser (structured output).
  • OpenRouter integration: uses Anthropic Claude Sonnet via OpenRouter for unstructured PII span detection and for your AI task.
  • Setup: create an OpenRouter API credential in n8n and configure both OpenRouter Chat Model nodes; update the “Your AI Task (replace me)” prompt/instructions to match your intended operation.
View full details