Quick Overview
This workflow runs on a manual or daily schedule to inventory Google Cloud resources and IAM policy signals via Cloud Asset Inventory, store snapshots and change history in BigQuery, update a review-ready Google Sheets dashboard, and optionally email a digest with key changes and findings.
How it works
- Runs manually or every day at 03:15 and loads configuration such as GCP scope, BigQuery dataset location, Google Sheet ID, and email settings.
- Creates or reuses a BigQuery dataset and tables, and registers the scan as running in an n8n Data Table.
- Queries Google Cloud Asset Inventory to fetch all resources in the configured scope and normalizes the results into a canonical snapshot.
- Queries Cloud Asset Inventory IAM policy search to flag risky bindings (public access and basic roles) and evaluates governance rules like required labels and allowed locations.
- Writes the inventory snapshot and findings to BigQuery in batches, then compares the current snapshot to the previous completed run to record added/modified/removed assets and finalize the run status.
- Builds HTML and CSV exports and updates a multi-tab Google Sheets dashboard (Dashboard, Inventory, Findings, Changes, Scans) while preserving existing review checkboxes and notes.
- Sends an email digest via SMTP when configured to notify (baseline run, changes found, actionable findings, or IAM coverage issues), and records delivery status for the run.
Setup
- Create a copy of the provided Google Sheets dashboard template, keep the required tab names/headers intact, and share it with Editor access to the Google account/service account used by the workflow.
- Add Google API credentials with access to Cloud Asset Inventory (resource and IAM search), BigQuery (dataset/table creation and job execution), and Google Sheets (read/write), and enable the Cloud Asset, BigQuery, and Sheets APIs in your GCP project.
- In the Configuration step, set your scope (project/folder/org), billingProject, dataset, location, sheetId, emailTo, emailFrom, and adjust limits and governance rules (requiredLabels, labelAssetTypes, allowedLocations, reportChangeLimit, notifyEveryRun, and maxBytesBilled).
- Configure an SMTP credential for sending the optional digest email.
- Update the base n8n execution URL in the run initialization (used to build execution links) and optionally select an Error Workflow in n8n settings for failure handling.