This n8n workflow automates the task of backing up your n8n workflows and security audit data to Google Drive. It creates a backup system that runs on a schedule, organizing your backups by date and providing both workflow JSONs and security audit reports.
- Scheduled Backups: Automatically runs at a configurable time (default: 1:30 AM)
- Date-Based Organization: Creates dated folders in Google Drive for easy retrieval
- Workflow Backup: Exports all workflows from your n8n instance as JSON files
- Security Audit: Generates a security audit report of your n8n instance
- Markdown Conversion: Transforms security audit data into readable Markdown format
- Structured Storage: Organizes backups in a hierarchical folder structure
The workflow is divided into three main sections:
- A schedule trigger initiates the workflow at the specified time
- The current date and time are captured
- A new folder is created in Google Drive with the current date as its name
- Inside the date folder, a subfolder named "audit" is created
- The n8n security audit is generated
- The audit data (in JSON format) is converted to a well-formatted Markdown document
- The Markdown document is saved to the audit folder in Google Drive
- All workflows are retrieved from your n8n instance
- Each workflow's JSON data is converted to binary format
- The workflows are saved as individual JSON files in the date folder
- n8n instance with API access
- Google Drive account with OAuth2 authentication
- Proper credentials setup in n8n
- Import the workflow JSON into your n8n instance
- Configure Google Drive credentials
- Set up n8n API credentials
- Modify the Google Drive folder ID to match your desired backup location
- Adjust the schedule trigger time as needed
You can customize this workflow by:
- Changing the backup frequency in the Schedule Trigger node
- Modifying the folder structure in Google Drive
- Expanding the workflow to include additional backup types
- Adding notification nodes (e.g., Slack, Email) to alert upon completion
This workflow is modified from the template created by Phil (https://n8n.io/workflows/3112-backup-n8n-workflows-to-google-drive/) with additional features added.
This workflow is provided under the same license as n8n. Feel free to modify and share it according to your needs.
Ensure you have the correct permissions for your Google Drive account and n8n instance before implementing this workflow.