N8N Workflow Backup to GitHub
detail.loadingPreview
Automate backing up your N8N workflows to a GitHub repository.
About This Workflow
This workflow automates the process of backing up your N8N workflows to a specified GitHub repository. It checks for existing workflow files in GitHub, compares them with the current N8N workflows, and either updates existing files or creates new ones, ensuring your workflow configurations are version-controlled.
Key Features
- Automated Backup: Schedule daily backups of your N8N workflows.
- Version Control: Store workflow JSON files in a GitHub repository.
- Conflict Detection: Compares existing GitHub files with N8N workflows to detect differences.
- Conditional Operations: Updates existing files if they differ or creates new ones if they don't exist.
- Configurable Repository: Easily set the GitHub owner, repository name, and path.
How To Use
- Manual Trigger or Schedule: The workflow can be triggered manually by clicking 'execute' or scheduled to run daily at 20:00.
- Set Globals: Configure the
Globalsnode with your GitHub repository details:repo.owner: The owner of the GitHub repository.repo.name: The name of the GitHub repository.repo.path: The path within the repository where workflows will be stored (e.g.,my-team/n8n/workflows/).
- Fetch N8N Workflows: The
N8N Workflowsnode fetches a list of all your N8N workflows from the local N8N instance. - Process Workflows Individually: The
dataArraynode restructures the fetched data, andOneAtATimeensures each workflow is processed individually. - Fetch GitHub File: The
GitHubnode attempts to retrieve the corresponding workflow file from your GitHub repository based on the workflow name. - Get N8N Workflow Detail: The
N8N Workflow Detailnode fetches the full details of the current N8N workflow. - Compare and Determine Status: The
isDiffOrNewfunction node compares the content of the GitHub file (if it exists) with the current N8N workflow data. It determines if the workflow issame,different, ornew. - Route Based on Status: The
github_statusswitch node directs the execution based on the comparison result:same: No action is taken (connected tosameNoOp node, which then proceeds toOneAtATimeto continue processing).different: TheGitHub Editnode is used to update the existing file in the GitHub repository.new: TheGitHub Createnode is used to create a new file in the GitHub repository.
- Execute GitHub Operation: The
GitHub EditorGitHub Createnodes perform the respective file operation in your GitHub repository. TheOneAtATimenode is then re-entered to continue processing the next workflow in the batch. - Credentials: Ensure you have configured your GitHub API credentials (named 'GitHub') in N8N.
Apps Used
Workflow JSON
{
"id": "c8fb7096-fd8f-4b83-be03-f9681f1db830",
"name": "N8N Workflow Backup to GitHub",
"nodes": 16,
"category": "Automation",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: c8fb7096-fd8f...
About the Author
Crypto_Watcher
Web3 Developer
Automated trading bots and blockchain monitoring workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated Google Drive Backup for n8n Workflows
Automatically back up n8n workflows to Google Drive on a schedule.
Generate Workflow for Notion Database
Automates the creation of an n8n workflow to interact with a specific Notion database, based on a provided URL.
Dynamic Prompt Generation from GitHub with Language Model Integration
Fetches prompts from a GitHub repository, substitutes variables, and processes them with an AI agent.