Use this robust n8n workflow to automatically backup and version your production n8n workflows to a secondary n8n instance using the n8n API. Includes rolling retention and Notion tracking.
Download this n8n workflow template and start using it instantly.
Maintaining reliable n8n operations often requires robust backup strategies. This sophisticated n8n workflow solves the complexity of backing up and versioning your mission-critical n8n workflow data by automating the transfer of all active n8n workflows from a source instance to a destination instance. It uses the n8n API to perform the migration, appending a date prefix (YYYY-MM-DD_) to each workflow's name on the destination, creating an easily searchable version history. Furthermore, this n8n template implements a rolling retention policy (default is 2 days of backup) and logs the execution statistics into Notion, providing comprehensive visibility and control over your deployment using specialized n8n node configurations.
The entire process is initiated by an n8n trigger (manual or scheduled):
todayprefix), and the date for deletion (two days prior) is calculated (yesterdayprefix).If n8n node checks Notion to see if a successful backup run was already executed today, preventing duplicate backups.Filter n8n node to identify and delete all workflows whose names start with the yesterdayprefix date, enforcing the rolling retention policy.todayprefix.Notion n8n node updates a tracking database with the current backup date and the total number of n8n workflows successfully copied, documenting the success of the n8n workflow execution.GET - Workflows).GET - Destination Workflows, CREATE - Workflow, and n8n_destination). These credentials must have read, create, and delete permissions for workflows.Notion n8n node with your credentials and link it to your target database. This database must contain fields for sequence, Value (date), and Comment (count).yesterday n8n node. Adjust the 'Duration' parameter if you wish to retain more or fewer days of backup versions (default: 2 days retention, meaning it deletes the workflow from 2 days ago).Limit n8n node before Split Out Workflows and set the limit to 1 to test the creation process on a single n8n workflow. Once satisfied, remove the limit or disable the n8n node. Manual Trigger (When clicking ‘Test workflow’): The starting n8n trigger for testing and initial setup. In production, this should be replaced with a Cron n8n trigger for scheduling.
n8n Node (GET - Workflows): Connects to the source n8n instance using API credentials to fetch all existing n8n workflow definitions.
n8n Node (GET - Destination Workflows): Connects to the destination n8n instance to fetch existing versions for retention management.
DateTime Node (todayprefix / yesterdayprefix): These critical date n8n nodes calculate the current backup date prefix (YYYY-MM-DD) and the deletion date prefix, respectively.
n8n Node (CREATE - Workflow): The core migration n8n node. It sends the source workflow data to the destination n8n instance, applying an expression to prepend the date prefix: {{ $('todayprefix').item.json.formattedDate + $json.name }}.
Filter Node (Filter): Used in the retention phase to isolate only the destination workflows that match the calculated deletion prefix (yesterdayprefix).
n8n Node (n8ndestination): Performs the delete operation on the destination instance for the specific workflows identified by the preceding Filter n8n node.
Notion Node (Notion): Updates the Notion database with the completion date and the count of processed n8n workflow items, providing an audit trail for the entire n8n workflow run.
Use this robust n8n workflow to automatically backup all your existing n8n workflow designs daily to Google Drive. This n8n template ensures essential system redundancy and disaster recovery.

A comprehensive n8n workflow to automate daily backups of all your n8n workflows to a Bitbucket repository, ensuring version control and rate limit compliance.

Use this powerful n8n workflow to automatically backup and delete inactive n8n templates. Clean your instance, save backups to Google Drive, and manage your n8n nodes efficiently.

Automate robust version control for your n8n instances. This n8n workflow uses an n8n trigger to fetch all active n8n templates and back them up securely to GitHub, ensuring data integrity and easy rollback.

Use this powerful n8n workflow to automatically backup all your decrypted n8n credentials to GitHub. Protect your data using this reliable n8n templates solution.








































