Overview
The n8n Restore node enables restoring n8n workflows from backups stored in a GitHub repository. It supports multiple restore modes, allowing users to:
- Restore the latest full backup of all workflows.
- Restore workflows from a backup on a specific date.
- Restore individual workflows by specifying their names.
This node is useful for scenarios such as disaster recovery, migrating workflows between environments, or selectively restoring workflows after accidental deletion or modification. For example, a user can restore all workflows from the most recent backup after a system failure, or selectively restore only certain workflows that were changed or lost.
Properties
| Name | Meaning |
|---|---|
| Restore Mode | Choose how to restore workflows: - Latest Backup: Restore from the latest full backup. - Specific Date: Restore from backup on a specific date. - Individual Workflows: Restore specific workflows by name. |
| Backup Date | (Shown if "Specific Date" mode selected) The date of the backup to restore. |
| Workflow Names | (Shown if "Individual Workflows" mode selected) Comma-separated list of workflow names to restore. |
| GitHub Repository | Source GitHub repository in format owner/repository-name where backups are stored. |
| Branch Name | Git branch to restore from (default is main). |
| Conflict Resolution | How to handle workflows that already exist: - Skip: Do not restore existing workflows. - Rename: Auto-rename restored workflows to avoid conflicts. - Overwrite: Replace existing workflows with restored ones. |
| Activate After Restore | Whether to activate workflows immediately after restoring them (true/false). |
Output
The node outputs a JSON object summarizing the restore operation with the following structure:
success: Boolean indicating overall success of the restore operation.message: Summary message describing how many workflows were restored, skipped, or failed.repository: The GitHub repository used as source.branch: The Git branch used.restoreMode: The selected restore mode.restored: Array of objects representing workflows successfully created or updated, each with:id: Workflow ID in n8n.name: Workflow name.action: Either"created"or"updated".
skipped: Array of objects for workflows skipped due to conflict resolution, each with:name: Workflow name.reason: Reason for skipping (e.g., "Workflow already exists").
errors: Array of objects for workflows that failed to restore, each with:workflow: Workflow name.error: Error message.
totalProcessed: Total number of workflows processed from the backup.
If no workflows are found to restore, the output indicates failure with an appropriate message.
The node does not output binary data.
Dependencies
- Requires access to a GitHub repository containing workflow backups.
- Needs credentials for:
- GitHub API authentication to fetch backups.
- n8n API authentication to create, update, and activate workflows.
- The node uses helper classes (GitHubHelper and N8nHelper) internally to interact with GitHub and n8n APIs.
Troubleshooting
- No workflows found to restore: This occurs if the specified backup or workflows do not exist in the GitHub repository. Verify the repository, branch, backup date, and workflow names.
- Unsupported restore mode error: Happens if an invalid restore mode is provided. Ensure the restore mode parameter is one of the supported options.
- Conflict resolution issues: If workflows already exist and conflict resolution is set to skip, those workflows will not be restored. To overwrite or rename, adjust the conflict resolution setting accordingly.
- API authentication errors: Make sure valid API credentials are configured for both GitHub and n8n.
- Partial failures: Some workflows may fail to restore due to invalid data or API errors; these are reported individually in the errors array.
To resolve errors, check input parameters, verify API credentials, and ensure the GitHub repository contains valid backups.