# Automated backup and sync of n8n workflows to GitHub
This scenario ensures version control and centralized storage of n8n workflows by automatically syncing them with a GitHub repository. It is ideal for teams requiring auditability, change tracking, and protection against workflow loss.
## Who it´s for
- DevOps engineers managing n8n workflow versions
- Developers using n8n in production environments
- Teams needing automated backup of workflows
- n8n administrators with centralized management needs
## What the automation does
- Periodically fetches all active workflows from a local n8n instance
- Retrieves current versions from a remote GitHub repository
- Compares content by decoding base64-encoded data
- Updates the file in the repo if differences are detected
- Creates a new JSON file if the workflow is missing in GitHub
- Commits all changes with the label [N8N Backup]
- Runs on a schedule (cron) or manually triggered
## What´s included
- Ready-to-use n8n workflow
- Trigger and handler logic
- Integrations with GitHub API and n8n REST API
- Basic text instructions for setup and adaptation
## Requirements for setup
- Access to a running n8n instance with REST API enabled
- GitHub account with permissions to create/edit a repository
- GitHub Personal Access Token (PAT) with required scopes
- Configured environment variables in n8n for secret storage
## Benefits and outcomes
- Protection against workflow loss during failures
- Full change history via Git
- Centralized storage of all workflows
- Fast recovery capability
- Support for team collaboration
- Automatic change logging without manual effort
## Important: template only
Important: you are purchasing a ready-made automation workflow template only. Rollout into your infrastructure, connecting specific accounts and services, 1:1 setup help, custom adjustments for non-standard stacks and any consulting support are provided as a separate paid service at an individual rate. To discuss custom work or 1:1 help, contact via chat
No feedback yet