n8n Workflow: Redact & Restore PII with Guardrails
n8n Workflow: Redact & Restore PII with Guardrails
Regular price
£20.99
Regular price
£20.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
âš¡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Workflow: Redact & Restore PII with Guardrails
Regular price
£20.99
Regular price
£20.99
Sale price
Unit price
/
per
Mask PII before an LLM call—then automatically restore it with reversible tokens
This n8n workflow demonstrates a safe, end-to-end pattern for redacting sensitive personally identifiable information (PII) using Enterprise PII Guardrails, sending the sanitized text through a simulated LLM step, and then restoring the original values in the final output using a token-to-original mapping.
What this workflow does
- Manual test run: Start the workflow manually to process a sample customer support prompt.
- Sample PII creation: It builds a customer support message containing common sensitive data such as name, email, phone number, medical record number, and a credit card number.
- PII masking with guardrails: The prompt is sent to Enterprise PII Guardrails to detect sensitive entities and replace them with surrogate tokens. The workflow also receives a token-to-original mapping.
- LLM-safe processing (simulated): A simulated LLM response is generated that references the surrogate tokens rather than the original PII.
- Unmask and restore: The simulated response and the saved mapping are sent back to Enterprise PII Guardrails to unmask tokens and restore the original PII in the final text.
Use cases
- Test and validate an LLM prompt-sanitization workflow for customer support tickets.
- Reduce PII exposure when building LLM-powered assistance while still returning accurate, real details to users.
- Provide a concrete template for implementing reversible redaction with Guardrails and an n8n-friendly token mapping flow.
Technical details
- Workflow nodes: manual trigger, set, sticky note, and n8n-nodes-piiguardrails steps around mask/unmask.
- Optional LLM integration: The example uses a simulated LLM step, but you can replace it with your real LLM node (the key requirement is keeping mask/unmask steps before and after).
-
Enterprise PII Guardrails setup: install the community node (n8n-nodes-piiguardrails), run Guardrails locally (e.g.,
pip install piiguardrails && piiguardrails start), and point n8n to your Guardrails endpoint (defaulthttp://localhost:8000) via an API credential.
