{"product_id":"n8n-workflow-redact-restore-pii-with-guardrails","title":"n8n Workflow: Redact \u0026 Restore PII with Guardrails","description":"\u003ch3\u003eMask PII before an LLM call—then automatically restore it with reversible tokens\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow demonstrates a safe, end-to-end pattern for \u003cstrong\u003eredacting sensitive personally identifiable information (PII)\u003c\/strong\u003e using \u003cstrong\u003eEnterprise PII Guardrails\u003c\/strong\u003e, sending the sanitized text through a simulated LLM step, and then \u003cstrong\u003erestoring the original values\u003c\/strong\u003e in the final output using a token-to-original mapping.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eManual test run:\u003c\/strong\u003e Start the workflow manually to process a sample customer support prompt.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSample PII creation:\u003c\/strong\u003e It builds a customer support message containing common sensitive data such as \u003cstrong\u003ename\u003c\/strong\u003e, \u003cstrong\u003eemail\u003c\/strong\u003e, \u003cstrong\u003ephone number\u003c\/strong\u003e, \u003cstrong\u003emedical record number\u003c\/strong\u003e, and a \u003cstrong\u003ecredit card number\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePII masking with guardrails:\u003c\/strong\u003e The prompt is sent to \u003cstrong\u003eEnterprise PII Guardrails\u003c\/strong\u003e to detect sensitive entities and replace them with \u003cstrong\u003esurrogate tokens\u003c\/strong\u003e. The workflow also receives a \u003cstrong\u003etoken-to-original mapping\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLLM-safe processing (simulated):\u003c\/strong\u003e A simulated LLM response is generated that references the \u003cstrong\u003esurrogate tokens\u003c\/strong\u003e rather than the original PII.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUnmask and restore:\u003c\/strong\u003e The simulated response and the saved mapping are sent back to \u003cstrong\u003eEnterprise PII Guardrails\u003c\/strong\u003e to \u003cstrong\u003eunmask tokens\u003c\/strong\u003e and restore the original PII in the final text.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eTest and validate an \u003cstrong\u003eLLM prompt-sanitization\u003c\/strong\u003e workflow for customer support tickets.\u003c\/li\u003e\n  \u003cli\u003eReduce PII exposure when building \u003cstrong\u003eLLM-powered assistance\u003c\/strong\u003e while still returning accurate, real details to users.\u003c\/li\u003e\n  \u003cli\u003eProvide a concrete template for implementing \u003cstrong\u003ereversible redaction\u003c\/strong\u003e with Guardrails and an n8n-friendly token mapping flow.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWorkflow nodes:\u003c\/strong\u003e manual trigger, set, sticky note, and \u003cstrong\u003en8n-nodes-piiguardrails\u003c\/strong\u003e steps around mask\/unmask.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOptional LLM integration:\u003c\/strong\u003e The example uses a \u003cem\u003esimulated\u003c\/em\u003e LLM step, but you can replace it with your real LLM node (the key requirement is keeping mask\/unmask steps before and after).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEnterprise PII Guardrails setup:\u003c\/strong\u003e install the community node \u003cstrong\u003e(n8n-nodes-piiguardrails)\u003c\/strong\u003e, run Guardrails locally (e.g., \u003ccode\u003epip install piiguardrails \u0026amp;\u0026amp; piiguardrails start\u003c\/code\u003e), and point n8n to your Guardrails endpoint (default \u003ccode\u003ehttp:\/\/localhost:8000\u003c\/code\u003e) via an API credential.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46047342821555,"sku":"N8N-19658","price":20.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/jHI7TeOeOfblLdMw3Vzn4_S5v73tB4.png?v=1789636333","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-redact-restore-pii-with-guardrails","provider":"N8N Commerce","version":"1.0","type":"link"}