Tools / Backup Gitlab

Automated workflow for GitLab that backs up workflows and credentials on a schedule, ensuring data safety and easy recovery. Executes commands to export, commit, and push backups, providing peace of mind with regular updates.

7/8/2025
7 nodes
Simple
schedulesimpleexecutecommandautomation
Categories:
Schedule TriggeredSchedule TriggeredSimple WorkflowSimple Workflow
Integrations:
ExecuteCommand

Target Audience

Target Audience


- Developers: Those who need to regularly back up their workflows and credentials in GitLab.
- DevOps Engineers: Professionals responsible for maintaining CI/CD pipelines who require automated backups.
- Project Managers: Individuals overseeing projects that utilize n8n for automation and need assurance of data integrity.
- System Administrators: Personnel tasked with managing and securing workflows and credentials in production environments.

Problem Solved

Problem Solved


This workflow addresses the challenge of ensuring that workflows and credentials in n8n are automatically backed up at scheduled intervals. By automating the export and version control process, it mitigates the risk of data loss and provides an easy recovery option in case of failures or errors.

Workflow Steps

Workflow Steps


1. Scheduled Trigger: The workflow is initiated automatically at specified times: 0:00, 6:00, 12:00, and 18:00 hours.
2. Export Workflows: The first action exports all workflows to the repo/workflows/ directory, creating a backup of the current state.
3. Export Credentials: Following the workflow export, credentials are backed up to the repo/credentials/ directory.
4. Git Add: All newly exported files are staged for commit using git -C repo add ..
5. Git Commit: A commit is created with a message indicating the backup time, formatted as Auto backup (YYYY-MM-DDTHH:MM:SS.sssZ).
6. Git Push: Finally, the changes are pushed to the remote repository to ensure that backups are stored securely and can be accessed when needed.

Customization Guide

Customization Guide


- Change Backup Frequency: Modify the triggerTimes in the Cron node to adjust the schedule according to your needs.
- Alter Backup Locations: Update the output paths in the Export Workflows and Export Credentials nodes to change where backups are stored.
- Commit Message Customization: Adjust the commit message in the git commit node to include additional context or details relevant to your backups.
- Add Notifications: Integrate a notification node (e.g., email or Slack) to alert relevant team members upon successful completion of the backup process.