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
Automate Google Drive audit with n8n and Google Sheets

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

Learn how to Build this Workflow with AI:

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.

Automate Google Drive audit with n8n and Google Sheets

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.