Skip to main content

Mask PII before GPT-5.5 analysis with Google Sheets audit logs

Workflow preview

Workflow preview
100%
Mask PII before GPT-5.5 analysis with Google Sheets audit logs preview
Open on n8n.io

1. Workflow Overview

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, tic...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.respondtowebhook, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Țugui Dragoș.

Original n8n.io source

1.1 Workflow description

Title
Mask PII before GPT-5.5 analysis with Google Sheets audit logs
Workflow name
Mask PII before GPT-5.5 analysis with Google Sheets audit logs

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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Receive Document

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Detect PII via Regex

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Tokenize and Replace PII

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Store Token Vault

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 5 - OpenAI Analyze Sanitized Text

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.3

Block 6 - Restore Original PII

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Log Audit Trail

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Return Processed Document

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 9 - PII Proxy Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Detection Phase

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Vault and Analysis

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Restore and Audit

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Mask PII before GPT-5.5 analysis with Google Sheets audit logs
Complexity intermediate
Nodes 12
Categories Document Extraction, AI Summarization
Author Țugui Dragoș
Published 17 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15773/15773.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Mask PII before GPT-5.5 analysis with Google Sheets audit logs do?

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, tic...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.