Automate Google Drive Permissions Audit with n8n

This n8n workflow automates auditing of recently modified Google Drive documents to identify files shared externally or publically. It creates daily reports in Google Sheets and emails summaries to help secure sensitive data by regularly reviewing access permissions.
scheduleTrigger
googleSheets
googleDrive
+7
Workflow Identifier: 1224
NODES in Use: Schedule Trigger, Google Sheets, Google Drive, Filter, SplitInBatches, NoOp, SplitOut, Set, Aggregate, Gmail

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow runs every day at 6 AM and finds Google Drive files that were changed in the last 24 hours.

It spots files shared too openly, like anyone with the link can access or files shared outside the company domain.

A new Google Sheet tab is made every day to save the flagged files.

Finally, it sends an email report with links so you can check the risky files fast.


Who Should Use This Workflow

This is for people who want to keep their company files safe.

If you manage shared Google Drive files and want quick reports on risky sharing, this can help save you hours every week.


Tools and Services Used

  • Google Drive API: To get file info and permissions.
  • Google Sheets API: To create daily audit sheets and add data.
  • Gmail API: To send daily email reports.
  • n8n automation platform: Runs the workflow and connects all steps.

How This Workflow Works: Inputs → Processing → Outputs

Inputs

  • The Google Drive files modified in the last 24 hours.
  • File permissions data to check sharing settings.
  • Google Sheets for storing audit data.
  • Gmail for sending emails.

Processing Steps

  • Create a new audit tab in Google Sheets with today’s date.
  • Fetch Google Docs, Sheets, and Slides changed in last 24 hours.
  • Filter out files shared only privately (no risk).
  • Keep only files shared publicly or with users outside the company domain.
  • For each risky file, list ID, name, permission type, user email, and role.
  • Aggregate all risky file data.
  • Append this data as rows into the new audit sheet.
  • Send an email summary with clickable links for quick review.

Outputs

  • A new Google Sheets tab each day showing flagged files with risky sharing.
  • An email report sent at 6 AM with direct links and summaries.

Beginner step-by-step: How to Use This Workflow in n8n

Step 1: Download and Import

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor where you want to run the workflow.
  3. Import the workflow by clicking “Import from File” and select the downloaded file.

Step 2: Configure Credentials

  1. Add your Google Drive and Google Sheets API credentials in n8n under the credential settings.
  2. Add Gmail API credentials to allow email sending.
  3. Make sure these credentials have the correct reading and writing permissions.

Step 3: Update Workflow Details

  1. Update email addresses in the Gmail node for who should get the report.
  2. Check and update the company domain in the filter node if needed (e.g., change ‘example.com’ to your domain).
  3. If needed, update Google Sheets IDs or tabs in the nodes using exact IDs or expressions.

Step 4: Test and Activate

  1. Manually run the workflow once to check if it works and fix errors if any.
  2. If all runs fine, activate the workflow so it runs automatically every day at 6 AM.

When ready, let the workflow run and get audit reports automatically every morning.

If using self hosting n8n, check self-host n8n for help on setup.


Key Notes, Customizations & Troubleshooting

Customizations

  • Change company domain filter in “Has Shared with External Users” node to your domain.
  • Change audit time in the Schedule Trigger node if 6 AM is not ideal.
  • Add or remove Google Drive file types in the query step if you want to audit different files.
  • Add multiple email addresses in the Gmail node separated by commas.
  • Replace the email step with HTTP Request nodes to send audit data to other security tools.

Troubleshooting

  • If no files are returned from Google Drive, check the query formatting and permissions.
  • If emails fail to send, re-authenticate the Gmail node credentials.
  • If data doesn’t append correctly, verify spreadsheet ID and tab names used in the append node.

Summary

✓ Saves 2-3 hours every week by automating permission audits.

✓ Finds files shared with anyone or outside company domain fast.

✓ Creates daily audit sheets that show risky file sharing history.

✓ Sends timely email reports with quick links to risky files.

→ Helps keep sensitive company data safer without manual checks.

Frequently Asked Questions

Yes, by changing the Google Drive nodes to SharePoint connectors and adjusting the queries accordingly.
Yes, it calls Google Drive, Sheets, and Gmail APIs daily. Users should monitor API usage and quota in the Google Cloud Console.
Yes, OAuth2 credentials provide secure access. The workflow only reads metadata and sends data internally within your accounts.
Yes, the workflow uses batching nodes like SplitInBatches to process files in manageable chunks, reducing API rate limit issues.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free