Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Code, Git & Developer Tools

Code, Git & Developer Tools

Back Up n8n Workflows to GitHub via Pull Requests

When you run it, it finds new and updated n8n workflows, commits them to GitHub, opens a pull request, and notifies Slack.

What it does

## 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

The steps

  1. n8n
  2. Find new workflows
  3. Find updated workflows
  4. Wait for GitHub create/edit file finished
  5. Create new PR via GitHub API
  6. Define Local Variables
  7. Get all workflows on GitHub
  8. Get content for each workflow
  9. Base64decode workflow content
  10. Wait for finished
  11. If there are any changes in workflows
  12. No Operation, do nothing
  13. Create new branch via GitHub API
  14. Get latest commit SHA on main via GitHub API

22 steps in total.

Similar automations