Automate n8n Workflow Backups to GitHub
detail.loadingPreview
This workflow automates the daily backup of your n8n workflows to a GitHub repository. It fetches workflow data, retrieves raw content, and stores it as version-controlled JSON files, ensuring your automation configurations are always safe and accessible.
About This Workflow
This n8n workflow provides a robust solution for backing up your n8n automation configurations to GitHub. Triggered daily, it systematically retrieves all active workflows, fetches their detailed configurations, and then commits each workflow's JSON data as a separate file within a designated GitHub repository. This process ensures that your valuable automation logic is version-controlled, auditable, and protected against accidental loss. The workflow leverages GitHub's API to create or update files, maintaining a clear history of changes with informative commit messages that include the workflow name and backup date. This proactive approach to backup empowers users with peace of mind and simplifies disaster recovery or migration scenarios for their n8n instances.
Key Features
- Automated Daily Backups: Schedule your workflow backups to run automatically every day.
- Version Control with GitHub: Store all your n8n workflow configurations as version-controlled files in your GitHub repository.
- Dynamic File Naming: Each workflow is saved as a
.jsonfile named after the workflow itself, ensuring easy identification. - Descriptive Commit Messages: Commits are automatically generated with workflow names and backup dates for clear tracking.
- Flexible Configuration: Easily adapt the workflow to your specific n8n instance and GitHub repository details.
How To Use
- Set up the Cron Trigger: Configure the 'Daily at 23:59' node to set your desired backup schedule.
- Connect to n8n API: Use the 'Get workflows' and 'Get workflow data' nodes with your n8n instance's basic authentication to fetch workflow information.
- Transform Workflow Data: Utilize the 'transform' function node to prepare the fetched workflow list for further processing.
- Retrieve Raw Workflow Content: Employ the 'Download Raw Content' HTTP Request node to get the actual content of each workflow, using your GitHub token for authentication.
- Merge Data: Use the 'Merge' nodes to combine the workflow metadata and raw content.
- Configure GitHub Credentials: Set up your 'GitHub@harshil1712' and 'GitHub Token' credentials in n8n.
- Commit to GitHub: Configure the 'Create file' and 'GitHub Edit' nodes with your GitHub repository details (owner, repository name, file path) to push the workflow backups. Ensure
YOUR_USERNAME,REPO_NAME, andREPOare replaced with your actual GitHub username and repository names.
Apps Used
Workflow JSON
{
"id": "8c1542a0-1682-41a3-8f3f-94277fc701d2",
"name": "Automate n8n Workflow Backups to GitHub",
"nodes": 5,
"category": "DevOps",
"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: 8c1542a0-1682...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.