Learn how to use this robust n8n workflow template to automatically back up all your active n8n workflows daily to a dedicated GitHub repository using the internal n8n API node.
Download this n8n workflow template and start using it instantly.
n8n Users needing reliable disaster recovery and version control.
System Administrators managing a self-hosted n8n instance.
Developers who integrate n8n workflow designs into their CI/CD pipelines.
Anyone looking for advanced examples of using the internal n8n node.
Maintaining reliable backups of your automation logic is essential. This specialized n8n workflow provides a robust solution for developers and system administrators by automatically exporting every active n8n workflow definition and committing it to a specified GitHub repository.
Triggered by a regular schedule, this n8n automation ensures that all your critical n8n templates are version-controlled externally. It intelligently checks if a file already exists in GitHub, performing an 'Update file' (edit) operation if it does, or an 'Upload file' (create) operation if it is a new n8n workflow. This mechanism prevents duplicated files and keeps the repository clean, making this a crucial n8n workflow template for operational resilience.
The execution of this comprehensive n8n workflow follows a precise sequence to ensure accurate backup and version control:
Schedule Trigger n8n node, setting the frequency (e.g., daily) for the backup routine.n8n n8n node, which connects to the local API to retrieve the raw JSON data for every active n8n workflow on the instance.Set n8n node dynamically generates the file name (based on the workflow's name and tag) and the commit date, ensuring unique and descriptive entries.If n8n node compares the newly generated file name against the list of existing files retrieved in Step 2. This determines if the file needs to be updated or created.To deploy this automated n8n workflow backup solution, follow these steps:
Retrieve workflows n8n node uses the internal n8n API. If your instance requires authentication (which is highly recommended), you must set up an API Key credential for the n8n node itself.List files from repo, Update file, Upload file):repository).owner).Schedule Trigger n8n node is enabled and set to your desired execution frequency (e.g., once daily). Schedule Trigger (n8n trigger):
Function: Serves as the starting n8n trigger, initiating the backup routine on a recurring schedule.
Key Configuration: Set to run at a specific interval (e.g., every 24 hours).
List files from repo (GitHub n8n node):
Function: Retrieves the names of all files currently stored in the backup repository for comparison.
Key Configuration: Resource set to File, Operation set to List.
Aggregate (n8n node):
Function: Consolidates all the retrieved file names from GitHub into a single item list for efficient searching.
Retrieve workflows (n8n node):
Function: Uses the internal n8n API to fetch the JSON definition of every active n8n workflow instance.
Key Configuration: Resource set to Workflow, Operation set to Get All.
Json file & To base64 (n8n node):
Function: Converts the raw n8n workflow JSON data into a Base64 string, required for committing files via the GitHub API.
Commit date & file name (Set n8n node):
Function: Dynamically creates two variables: commitDate (for the message) and fileName (structured using expressions like {{ $().json.name.replace(/\s+/g, '-').toLowerCase() }}-{{ $().json.tags[0].name }}.json).
Check if file exists (If n8n node):
Function: Performs a crucial check to see if the dynamically generated fileName is present in the aggregated list of existing files.
Update file / Upload file (GitHub n8n node):
* Function: Handles the final commit to GitHub. 'Update file' modifies an existing backup; 'Upload file' creates a new backup for a new n8n workflow.
Use this comprehensive n8n workflow to automatically manage and refresh Zalo OA OAuth tokens. Securely cache tokens using n8n static data for reliable, persistent API access.

Use this powerful n8n workflow to automatically transcribe YouTube videos via Gemini AI and convert the output into structured, SEO-ready blog posts, complete with category and HTML formatting.

Use this powerful n8n workflow to automate scheduled YouTube video uploads (12-hour intervals) directly from your self-hosted environment. Ideal for consistent content publishing.

Secure your installation using this n8n workflow. Automatically export all decrypted n8n credentials using the Execute Command n8n node and store the backup safely in Google Drive.

Secure your critical n8n workflow assets with this robust, scheduled automation. It backs up all active n8n templates to GitHub and automatically handles deletion synchronization.









































