Skip to main content

Automated workflow backups to GitHub with PR creation & Slack notifications

Workflow preview

Workflow preview
100%
Automated workflow backups to GitHub with PR creation & Slack notifications preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? This template is ideal for DevOps engineers, automation specialists, and n8n users who manage multiple workflows and want a reliable version control system for backups. It’s especi...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.n8n, n8n-nodes-base.merge, n8n-nodes-base.httprequest, n8n-nodes-base.set, n8n-nodes-base.github, n8n-nodes-base.if, n8n-nodes-base.noop, n8n-nodes-base.filter

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Bao Duy Nguyen.

Original n8n.io source

1.1 Workflow description

Title
Automated workflow backups to GitHub with PR creation & Slack notifications
Workflow name
Automated workflow backups to GitHub with PR creation & Slack notifications

Who is this for?

This template is ideal for DevOps engineers, automation specialists, and n8n users who manage multiple workflows and want a reliable version control system for backups. It’s especially useful for teams collaborating via GitHub.

What problem is this workflow solving?

Manually backing up n8n workflows to GitHub can be time-consuming and error-prone. This workflow solves that by automating the backup of new and updated n8n workflows, ensuring your GitHub repository always reflects the latest changes.

What this workflow does

  • Retrieves all workflows from your local n8n instance.
  • Decodes their content and compares it with existing GitHub files.
  • Detects newly created or updated workflows.
  • Creates a new Git branch and commits changes.
  • Opens a pull request (PR) to the main branch.
  • Sends a Slack notification when the PR is created.

The system uses GitHub API, n8n, Merge, Set, and Slack nodes for full automation.

Setup

  1. GitHub credentials: Add your GitHub API credentials in n8n.
  2. Slack integration: Connect your Slack Bot token if you want PR notifications.
  3. Repository details: Update github_owner, repo_name, and workflow directory path in the “Define Local Variables” node.
  4. n8n API key - Check this doc

How to customize this workflow to your needs

  • Change the workflow directory from workflows/ to a custom path.
  • Modify the Slack message or add email notification support.
  • Add filters to back up only specific workflows based on naming or tags.
  • Adjust branch naming conventions or use different GitHub base branches.

This workflow provides a seamless backup and versioning pipeline, minimizing manual Git interactions and supporting collaborative automation development.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - n8n

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 2 - Find new workflows

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 3 - Find updated workflows

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 4 - Wait for GitHub create/edit file finished

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 5 - Create new PR via GitHub API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Define Local Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Get all workflows on GitHub

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1.1

Block 8 - Get content for each workflow

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1.1

Block 9 - Base64decode workflow content

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Wait for finished

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 11 - If there are any changes in workflows

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 13 - Create new branch via GitHub API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Get latest commit SHA on main via GitHub API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Wait until branch created

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 16 - Wait until branch created1

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 17 - Filter empty data

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 18 - Filter empty data1

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 19 - Create new commit to add new workflow

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1.1

Block 20 - Create new commit to update changed workflow

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1.1

Block 21 - Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 22 - Click me to trigger

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 23 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated workflow backups to GitHub with PR creation & Slack notifications
Complexity advanced
Nodes 23
Categories DevOps
Author Bao Duy Nguyen
Published 28 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4463/4463.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated workflow backups to GitHub with PR creation & Slack notifications do?

Who is this for? This template is ideal for DevOps engineers, automation specialists, and n8n users who manage multiple workflows and want a reliable version control system for backups. It’s especi...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.