Use this robust n8n workflow to automatically backup all new or updated n8n templates to a GitHub repository, create a Pull Request, and notify your team via Slack.
Download this n8n workflow template and start using it instantly.
n8n Administrators and DevOps Engineers who require version control for their n8n templates.
Teams needing reliable, automated backups for critical automation logic.
Users seeking a highly structured, merge-request-based approach to workflow changes.
Anyone wanting to ensure every change to an n8n workflow is tracked and reviewed.
Maintaining version control for your production n8n workflow environment is essential for stability and compliance. This comprehensive n8n workflow solves the problem of manual backups by integrating directly with your n8n instance's API and GitHub. The automation periodically checks for new n8n templates or updates to existing ones, compares the local state against the remote GitHub repository, and, if differences are detected, initiates a structured Git process. It leverages the power of the n8n node to fetch local data, ensures changes are committed to a feature branch, and automatically creates a Pull Request. Finally, a confirmation is sent via Slack, providing immediate visibility to your operations team. This system guarantees that all changes to any n8n workflow are recorded and subject to review before merging into main.
This automation is typically started using an n8n trigger set on a schedule, though it uses a manual trigger in the provided template for easy testing.
branch_name timestamped for the run.updatedAt timestamp (changed files).main branch via an HTTP Request n8n node, and then uses a second HTTP Request n8n node to create a new, temporary branch. This ensures changes are isolated.main.To deploy this powerful n8n workflow, follow these steps:
repo scope permissions. This credential must be linked to all GitHub and HTTP Request n8n nodes accessing the repository.githubowner and reponame assignments to match your specific repository configuration. Ensure the repository path exists on GitHub (e.g., workflows/). Click me to trigger (Manual Trigger): The starting n8n trigger point for the execution. Meant to be replaced by a Schedule n8n trigger for production.
Define Local Variables (Set): Initializes variables like branchname (timestamped), githubowner (e.g., duynb92), and repo_name (e.g., n8n-workflows). This simplifies configuration.
n8n (n8n node): Fetches a list of all current workflows present on the local n8n instance using the internal API.
Get all workflows on GitHub (GitHub): Fetches the current list of files (workflow backups) stored in the specified GitHub directory (workflows/).
Find new workflows & Find updated workflows (Merge): These Merge n8n nodes compare the local n8n templates against the remote files. They are critical for determining which workflows are new (based on ID) or modified (based on ID and updatedAt).
If there are any changes in workflows (If): A flow control n8n node that decides whether to proceed with the complex Git operation based on whether new or updated n8n workflow items were found.
Get latest commit SHA on main via GitHub API (HTTP Request): Retrieves the SHA needed to correctly create a new Git branch.
Create new commit to add/update workflow (GitHub): Executes the actual file creation and modification operations on the new Git branch, committing the latest n8n workflow JSON data.
Create new PR via GitHub API (HTTP Request): Final action creating the Pull Request for easy review of the automated backup changes.
Slack (Slack n8n node): Sends a successful completion notification, including a hyperlink to the newly generated PR.
Use this advanced n8n workflow to automatically backup and version control your n8n workflows to GitHub. Features intelligent change detection, rename support, and optional Telegram reports.

Use this robust n8n workflow template to schedule automatic, reliable backups of all your n8n workflow configurations directly to GitHub, ensuring version control and disaster recovery.

Use this robust n8n workflow to automatically back up all your n8n workflow configurations daily to Google Drive. Features include conditional logic, Gmail alerts, and Discord notifications. Get essential n8n templates here.

Use this robust n8n workflow template to automatically back up all your critical n8n workflows daily to Google Drive, including smart folder cleanup to manage storage space.

Use this robust n8n workflow to automatically backup all your running n8n templates to Google Drive every 4 hours. Includes Slack notifications for success and failure.









































