What This Workflow Does
This automation solves the critical business problem of losing valuable n8n workflow configurations. It automatically backs up your selected workflows to GitLab, creating a version-controlled history of all changes. Unlike manual exports, this solution runs on a schedule and only backs up workflows with your specified tags, keeping your repository organized.
The workflow first fetches all your n8n workflows, filters them based on configured tags (like "production" or "finance"), then commits each as a separate JSON file to your GitLab repository. This ensures you always have recoverable copies of your most important automations while avoiding clutter from test workflows.
How It Works
1. Workflow Selection
The automation connects to your n8n instance and retrieves a list of all workflows. It then filters this list based on the tags you've configured (e.g., "critical", "marketing", "scheduled").
2. Backup Preparation
For each selected workflow, the system extracts the complete configuration including nodes, connections, and settings. It formats this data for clean version control tracking.
3. GitLab Integration
The workflow connects to your GitLab repository using API credentials. It creates a new commit with all changes, maintaining a clear history of who made changes and when.
Pro tip: Set different backup schedules for different tags - daily for finance workflows, weekly for others - by duplicating and modifying the template.
Who This Is For
This solution is ideal for businesses that rely heavily on n8n automations and need:
- Disaster recovery protection for critical workflows
- Team collaboration on automation development
- Compliance with change management policies
- Integration with existing DevOps processes
What You'll Need
- An n8n instance with workflows to backup
- GitLab account with repository access
- API credentials for both systems
- Tags applied to your important workflows
Quick Setup Guide
- Download the template and import into your n8n instance
- Configure your n8n API credentials in the first node
- Add your GitLab repository details and access token
- Set the tags you want to include in backups
- Schedule how often backups should run
Key Benefits
Never lose workflow configurations - Automatic backups ensure you can recover from accidental deletions or corruptions.
Track changes over time - GitLab's version history shows exactly when and why workflows were modified.
Selective backup strategy - Only back up workflows with specific tags, keeping your repository clean.
Enterprise-grade security - GitLab provides better protection than local file backups with access controls and audit logs.