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
- n8n
- Find new workflows
- Find updated workflows
- Wait for GitHub create/edit file finished
- Create new PR via GitHub API
- Define Local Variables
- Get all workflows on GitHub
- Get content for each workflow
- Base64decode workflow content
- Wait for finished
- If there are any changes in workflows
- No Operation, do nothing
- Create new branch via GitHub API
- Get latest commit SHA on main via GitHub API
22 steps in total.
Similar automations
Code, Git & Developer ToolsRestore n8n Workflows from Merged GitHub Pull Requests13 stepsCode, Git & Developer ToolsReview GitHub Pull Requests with OpenAI8 stepsCode, Git & Developer ToolsReview GitHub Pull Requests with OpenAI, Log to Sheets20 stepsCode, Git & Developer ToolsGenerate Unit Tests for GitHub Pull Requests with OpenAI20 steps