has shared with external users and create google sheets and permissions to items
Configured with Aggregate, Filter, Gmail, Google Drive, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Routing
- Data store
- Transform
- Messaging
- Files / media
- Trigger
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Has Shared with External Users | Routing | Filter | See node parameters |
| Create New Sheet | Data store | Google Sheets | create |
| Normalise Fields | Transform | Edit Fields | See node parameters |
| For Each File | Routing | Loop Over Items | See node parameters |
| File Ref | Routing | No Op | See node parameters |
| Permissions To Items | Transform | Split Out | See node parameters |
| Aggregate | Transform | Aggregate | See node parameters |
| Flatten Rows | Transform | Edit Fields | See node parameters |
| Rows to Items | Transform | Split Out | See node parameters |
| Send Email Report (Execute Once) | Messaging | Gmail | See node parameters |
| Get Recently Active Documents | Files / media | Google Drive | fileFolder |
| Schedule Trigger | Trigger | Schedule Trigger | See node parameters |
| Filter Out Owner of Document | Routing | Filter | See node parameters |
| Append to New Sheet | Data store | Google Sheets | append |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
gmailOAuth2googleDriveOAuth2ApigoogleSheetsOAuth2Api
Workflow notes
1. Scheduled Trigger to Audit Everyday
1. Scheduled Trigger to Audit Everyday
Read more about the Scheduled Trigger node
The Scheduled Trigger is used to automate this workflow at a frequency which meets your data access auditing requirements. Here we've set it to run everyday and for each run a new Google Sheet is created to capture the results of the audit.
Check out the example Sheet here: https://docs.google.com/spreadsheets/d/REPLACE_WITH_DOCUMENT_ID/edit?gid=503992967
2. Identify Documents with Possible Access Control Risks
2. Identify Documents with Possible Access Control Risks
File Sharing is powerful in Google Drive but we may grant excess permissions or visibility out of habit or to overcome access challenges. Though sometimes justified, often we forget to go back and reduce the permission scopes once the access has served its purpose.
This workflow fetches recently modified documents and takes note of the current permissions assigned to them. Those which are set to allow for anyone with a link or shared with external users can be flagged for review.
3. Aggregate Results into Rows
3. Aggregate Results into Rows
Read more about the Split Out node
With our list, we just need to convert them to rows which we can add to our audit sheet. We can use a few of n8n's data transformation nodes to complete this task.
4. Logs Results and Send Audit Report via Email
4. Logs Results and Send Audit Report via Email
Read more about the Gmail node
Finally, we'll log the identified documents to our google sheet and send a report via email. Alternatively, you may send to other security observability software or your security team.
Try It Out!
Try It Out!
This n8n template reviews and audits recently active Google Drive files and reports on files with excessively open permissions. This shows how you can automate simple SecOp tasks for access control management.
File Sharing Permissions are routinely abused when access needs and scopes expand to many colleagues, clients and users. Often, granting excessively open permissions means you can get back to work rather than deal with numerous access request notifications. Whilst sometimes justified, the problem is that the permissions are rarely reverted to a safer setting at a later date when it is no longer needed.
This template serves to improve your security posture by giving frequent reminders of these open files so that they can be actioned and not forgotten about.
See example Audit Report here: https://docs.google.com/spreadsheets/d/REPLACE_WITH_DOCUMENT_ID/edit?gid=503992967
How it works
- A scheduled trigger runs everyday to generate a new audit report. A new sheet is created in a designated Google Sheets document to store the day's results.
- The Google Drive node is used with Advanced Search params to fetch recently modified files for the user with each file result containing the current permission settings.
- The results are filtered for those with publicly accessible "anyone with link" and sharing with external users via domain.
- The results are then manipulated into rows so that we can append them to the Sheet we created earlier.
- The audit Google Sheet is updated with the results and an audit report is sent to the user to action.
How to use
- Set the scheduled trigger to a more appropriate interval which works for you or your organisation.
- Consider using allowlists for organisations you frequently share with to reduce the number of false positives.
- The results can be forwarded to other security or analytical products as required.
Requirements
- Google Drive for Document Management
- Google Sheet for Reports and Data Collection
- Gmail to Email Reports
Customising the workflow
- Not using Google? Apply the same approach using Microsoft Sharepoint or Dropbox.
Need Help?
Join the Discord or ask in the Forum!
Happy Hacking!
has shared with external users and create google sheets and permissions to items
has shared with external users and create google sheets and permissions to items
Purpose and structure
This folder contains the has shared with external users and create google sheets and permissions to items workflow. Its executable nodes use aggregate, filter, gmail, googleDrive, googleSheets, noOp, scheduleTrigger, set, splitInBatches, splitOut. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Schedule Trigger
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Splitout/0854_Splitout_Filter_Create_Scheduled.json MIT; preserve source notices.