Automate PII Redaction in Google Drive with AI
detail.loadingPreview
This workflow automatically monitors a Google Drive folder for new files, uses OpenAI to identify and remove Personally Identifiable Information (PII) columns from tabular data, and then saves the sanitized file to a designated "processed" folder. Ensure data privacy and compliance without manual intervention.
About This Workflow
This powerful n8n workflow provides an automated solution for handling sensitive data within your Google Drive. When a new tabular file (like CSV or Excel) is added to a monitored folder, the system springs into action. It downloads the file, extracts its contents, and leverages OpenAI's advanced AI capabilities to intelligently detect and pinpoint columns containing PII. After identification, the workflow meticulously removes these sensitive columns, transforms the data into a clean CSV, and uploads the redacted file to a specified 'processed' folder. This ensures compliance, reduces manual effort, and enhances data security. Ideal for organizations prioritizing data governance and privacy.
Key Features
- Automated Google Drive Monitoring: Instantly triggers upon new file uploads to a designated folder.
- AI-Powered PII Detection: Utilizes OpenAI's GPT models (e.g., gpt-4o-mini) to accurately identify PII columns in tabular data.
- Automated PII Redaction: Programmatically removes sensitive PII columns from your datasets, generating a new, clean file.
- Customizable File Output: Saves sanitized files with a clear
_PII_removedsuffix to a specified Google Drive folder. - Enhanced Compliance & Security: Helps maintain data privacy standards and streamline compliance efforts effortlessly.
How To Use
- Google Drive Trigger:
- Connect your Google Drive account credentials.
- Set the
Eventto "File Created". - Choose "Specific Folder" and select the Google Drive folder you want to monitor for new file uploads.
- OpenAI Node:
- Connect your OpenAI API credentials.
- Ensure the
Modelis set togpt-4o-mini(or your preferred compatible model). - Verify the system and user messages are configured to identify PII columns and return a comma-separated list of column names.
- Google Drive (Upload) Node:
- Connect the same Google Drive account credentials.
- Set the
Operationto "Create From Text". - Specify the
Folder IDwhere you want the PII-removed files to be uploaded (e.g., create a dedicated "processed" folder). - Map the
nameparameter to={{ $json.fileName }}andcontentto={{ $json.content }}from the "Remove PII columns" node.
- Review the Code Node (
Remove PII columns): This node contains the core logic for parsing OpenAI's output, iterating through your data, removing the identified PII columns, and formatting the output as a new CSV. While pre-configured, understanding its logic is key for advanced customization. - Activate Workflow: Save and activate the workflow to begin automatically monitoring your Google Drive for new files and sanitizing them.
Apps Used
Workflow JSON
{
"id": "9d52466b-5307-447d-8463-3a2bd7e42e59",
"name": "Automate PII Redaction in Google Drive with AI",
"nodes": 22,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 9d52466b-5307...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.