⚙️ Automated n8n workflows backup on GitLab with username organization

445 views · ⚙️ DevOps & CI/CD

Description

Overview

This solution ensures the secure backup and version control of your self-hosted n8n workflows by storing them in a GitLab repository. It compares current workflows with their GitLab counterparts, updates files when differences are detected, and organizes them in user-specific folders (e.g., repo -> username -> workflow.json). Backups are triggered manually or weekly, with a success notification sent via email.

Operational Process

Implementation Guide

  1. Import this solution into your n8n instance.
  2. Configure GitLab API credentials and specify the target repository.
  3. Set up n8n API access to enable workflow retrieval.
  4. Customize the Prepare Backup Metadata node to map users to folders as needed.
  5. Test the process using the Manual Backup Trigger to confirm GitLab integration.
  6. Schedule weekly backups via the Scheduled Weekly Backup node (recommended for Fridays).

Requirements

Customization Options

🔗 Nodes Used

Send Email, GitLab, n8n, Schedule Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup