Automated Workflow Backup and Version Control
detail.loadingPreview
This workflow automates the process of backing up your n8n workflows to a specified file location and then pushing these backups to a GitHub repository. It ensures your workflow configurations are safely stored and versioned, providing a crucial safety net against data loss or accidental changes.
About This Workflow
This n8n workflow is designed to provide robust backup and version control for your n8n workflows. It starts by defining a file path for storing local backups and then executes a command to export all workflows to this location. Subsequently, it reads the content of the exported backup file, calculates a SHA256 hash of its data, and then pushes this backup as a new file to a designated GitHub repository. The workflow also includes a mechanism to generate a hash for the existing workflow data by reading and hashing a separate file, allowing for potential future comparison or integrity checks. This comprehensive approach ensures that your n8n configurations are consistently backed up and safely stored in a remote, version-controlled environment, offering peace of mind and a reliable recovery option.
Key Features
- Scheduled Backups: Automatically backs up your n8n workflows on a recurring schedule (hourly in this snippet).
- GitHub Integration: Pushes workflow backups as versioned files to a GitHub repository.
- File Path Management: Dynamically sets and utilizes file paths for local backup storage.
- Data Hashing: Generates SHA256 hashes for workflow data for integrity verification.
- Command Execution: Leverages
n8n export:workflowcommand for efficient backup generation.
How To Use
- Schedule Trigger: Configure the 'Schedule Trigger' node to define the frequency of your backups (e.g., every hour).
- Set Workflow Path: Use the 'Set Workflow Path' node to specify the local directory where your workflow backups will be temporarily stored. Ensure this path is accessible by your n8n instance.
- Execute Workflow Backup: The 'Execute Workflow Backup' node runs the
n8n export:workflow --all --output=<your_file_path>command to create the local backup file. - GitHub Workflow Backup: Configure the 'GitHub Workflow Backup' node with your GitHub credentials, repository details, and the desired file path within your repository. The
fileContentparameter should reference the data from the preceding file read operation. - Credential Management (Optional): For backing up credentials, adapt the workflow to include nodes for fetching and hashing credential data and pushing it to a separate, secure location, potentially also on GitHub.
Apps Used
Workflow JSON
{
"id": "ceeaad15-ef1e-4dd4-89d5-40bbe04d6c72",
"name": "Automated Workflow Backup and Version Control",
"nodes": 10,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: ceeaad15-ef1e...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Robust Concurrency Control for n8n Workflows with Redis
Prevent simultaneous execution of critical n8n workflows or tasks using a centralized, Redis-backed locking mechanism. This reusable utility workflow ensures data integrity and resource management by allowing other workflows to acquire, check, and release locks.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.