Clone n8n Workflows between Instances using n8n API

This workflow enables the automatic cloning and migration of workflows between different instances. By calling the API, users can batch retrieve the workflow list from the source instance and filter out workflows that do not exist in the target instance, creating and associating them sequentially with the specified project. This process supports flexible configuration of credentials and project names, ensuring accurate data migration, significantly enhancing the efficiency and security of workflow management, making it suitable for unified management and backup for multiple teams or enterprise-level users.

Workflow Diagram
Clone n8n Workflows between Instances using n8n API Workflow diagram

Workflow Name

Clone n8n Workflows between Instances using n8n API

Key Features and Highlights

This workflow enables automatic cloning of workflows across different n8n instances. By leveraging the n8n API, it batch retrieves the list of workflows from the source instance, filters out workflows that do not exist in the target instance, and sequentially creates new workflows associated with a specified project. It supports batch processing to ensure accurate data migration and allows flexible configuration of credentials and project names to seamlessly switch between source and target instances.

Core Problems Addressed

Manually copying and migrating workflows in a multi-instance n8n environment is cumbersome and prone to errors. This workflow automates the cloning and deployment of workflows across instances, addressing inefficiencies, repetitive tasks, and data consistency issues during migration. It significantly enhances the convenience and security of workflow management.

Use Cases

  • Unified management and migration of n8n workflows across multiple teams or environments
  • Rapid migration of designed workflows from testing to production environments after development
  • Enterprise-level users requiring cross-instance distribution and backup of workflows
  • Centralizing workflows within specific projects for unified management

Main Process Steps

  1. Manually trigger the workflow execution
  2. Retrieve all workflows from the source n8n instance via API
  3. Retrieve the existing workflows from the target n8n instance via API
  4. Compare the two lists and filter out workflows not present in the target instance
  5. Iterate over the filtered workflows and create new workflows in the target instance via API
  6. Retrieve the list of projects from the target instance and filter for the specified project
  7. Associate the newly created workflows with the designated target project
  8. Support batch processing to ensure efficient completion of the migration task

Involved Systems or Services

  • n8n API (for both source and target instances)
  • HTTP Request nodes for interaction with the n8n API
  • Manual Trigger node to initiate the process
  • Data processing nodes (SplitInBatches, Merge, Filter, Set, etc.) for data segmentation and filtering

Target Audience and Value

  • n8n platform administrators and advanced users
  • Enterprise automation teams managing multiple n8n instances centrally
  • Operations personnel seeking efficient workflow migration with reduced human error
  • Developers aiming to implement cross-instance workflow backup and distribution

This workflow empowers users to effortlessly replicate and manage workflows across instances, greatly improving workflow operation efficiency and management standardization.