Automated Daily n8n Workflow Backup to GitLab Repos

Automatically backs up self-hosted n8n workflows to GitLab by fetching, comparing JSON changes, and updating files via API for seamless version control.

n8n
Automated Daily n8n Workflow Backup to GitLab Repos

This workflow automates the daily backup of n8n workflows to a GitLab repository. It retrieves all workflows from the n8n REST API, loops through each one, fetches the corresponding file from GitLab, compares the JSON content, and commits updates only if differences are detected. This ensures your workflows are always version-controlled without manual effort.

Key benefits include robust version control for self-hosted n8n instances, automatic change detection to avoid unnecessary commits, and integration with GitLab's API for reliable storage. It saves significant time for developers and teams managing multiple workflows, preventing data loss and enabling easy rollback via Git history.

Ideal use cases: DevOps teams maintaining n8n automations, agencies handling client workflows, or any self-hosted n8n user needing backups. Schedule it daily via cron trigger for hands-off operation. Requires GitLab PAT with api/write_repository scopes and n8n API access.

Setup involves configuring credentials for GITLAB_TOKEN, REPO, BRANCH, and FILE_PATH_PREFIX in n8n environment variables. Uses HTTP Request nodes for APIs, Code nodes for diffing, and SplitInBatches for looping—highly efficient for large workflow sets.

$22.99
Last updated October 3, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related AI & Machine Learning workflows

More from Fred Garcia

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.