Mask PII before GPT-5.5 analysis with Google Sheets audit logs
Go to WorkflowDescription
This template is for compliance teams, support teams, HR operations, legal teams, and builders who want to use AI analysis while reducing exposure of personal data. It is useful when documents, tickets, or form submissions may contain emails, phone numbers, addresses, IDs, or other sensitive values.
How it works
The workflow receives text through a webhook, detects structured PII with regex patterns, and applies lightweight context-based matching for names and addresses. Detected values are replaced with reversible tokens before the sanitized text is sent to GPT-5.5 for analysis. The workflow stores token metadata and audit information in Google Sheets, restores original values from the in-execution vault after analysis, logs the processing result, and returns a JSON response.
How to set up
Create a Google Sheet with PII Vault and Audit Log tabs. Connect Google Sheets and OpenAI credentials, then send a POST request to the /pii-proxy webhook with a text field.
Requirements
OpenAI access to GPT-5.5, Google Sheets credentials, and webhook access in n8n.
How to customize the workflow
Add country-specific PII patterns, replace Google Sheets with encrypted database storage, route high-risk documents to manual review, or return masked output for lower-privilege users.