n8n

How to Automate Google Drive CSV Data Privacy?

Keep contact lists and exports safe by removing personal data before anyone shares them. This workflow watches a Google Drive folder for new CSV files, finds columns with personal information, deletes those columns, and saves a clean file back to Drive. It suits teams that handle sign ups, lead lists, or survey data and need a simple way to protect privacy.

Here is how it works. A Google Drive trigger checks a specific folder for new files. The file is downloaded and the table is read so the columns are visible. An OpenAI step reviews the column names and returns only the ones that look like personal data, such as email or phone. The flow then combines the original file name, the parsed table, and the flagged columns. A code step removes those columns and creates a clean CSV. The clean file is uploaded to a chosen Drive folder with a clear name. This reduces risk, speeds up reviews, and keeps your data pipeline consistent.

You will need Google Drive and an OpenAI API key. Expect faster handoffs and fewer errors when sharing data. Teams can use it for lead uploads, report sharing, or vendor handoffs where private data is not allowed. Setup is simple in n8n Cloud and runs in the background once connected.

What are the key features?

  • Google Drive folder watch detects new CSV files and starts the flow automatically.
  • File download and table extraction make column names and rows easy to process.
  • OpenAI identifies which columns contain personal information and returns only those names.
  • Merge step combines file data, original name, and flagged columns into one stream.
  • Code step removes listed columns and rebuilds a clean CSV file.
  • Upload to Google Drive saves the sanitized file in a selected folder with a clear name.

What are the benefits?

  • Reduce manual review from hours to minutes by auto removing personal data in each new CSV
  • Improve data quality by removing risky columns before sharing with vendors or partners
  • Lower compliance risk by standardizing how files are scrubbed every time
  • Handle larger upload volume without adding staff by automating repeat steps
  • Connect Google Drive and OpenAI so privacy checks happen as soon as files arrive

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, open the Google Drive Trigger node, click Credential to connect with, select Create new credential, and follow the on screen steps to connect your Google account.
  4. Repeat the same in the Google Drive download and upload nodes so all Drive steps use the same Google Drive credential.
  5. Open the Google Drive Trigger node and choose the folder to watch. Set Event to file created and confirm the poll interval matches your needs.
  6. Open the OpenAI node, click Credential to connect with, select Create new credential, and paste your OpenAI API key from the OpenAI account API page. Select the model listed in the node or choose a compatible one.
  7. Check the Extract from File node settings and confirm it reads CSV input and exposes column headers. Use a small sample CSV to validate the output.
  8. Open the Get filename and Get result nodes and confirm the destination fields match the flow. These nodes pass the original name and the OpenAI list of PII columns into the Merge step.
  9. Review the Remove PII columns code node. It removes any columns returned by OpenAI and builds a clean CSV. Test with a sample file that includes email and phone headers.
  10. Set the Upload to Drive node to the destination folder where clean files should go. Confirm the file name field maps correctly so the output is easy to find.
  11. Run a full test: place a new CSV in the watched Drive folder. Check the execution in n8n, confirm PII columns were removed, and verify the clean file appears in the output folder.
  12. Troubleshooting tips: ensure the CSV has a header row, confirm the OpenAI API key is active, and check file size limits. If the trigger does not fire, confirm the correct folder is selected and that the file type is CSV.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.