Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Duplicate Workflow

n8n_duplicate_workflow

Create a copy of an existing n8n workflow by specifying its ID, with an optional new name for the duplicate.

Instructions

Create a copy of an existing workflow.

Args:

  • id (string): Workflow ID to duplicate

  • newName (string, optional): Name for the copy (default: "Copy of [original name]")

Returns: The duplicated workflow with its new ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkflow ID to duplicate
newNameNoName for the copy

Implementation Reference

  • The handler function for 'n8n_duplicate_workflow', which retrieves an existing workflow, prepares it for duplication (clearing ID/metadata), updates the name, sets it to inactive, and creates it as a new workflow via a POST request.
      server.registerTool(
        'n8n_duplicate_workflow',
        {
          title: 'Duplicate Workflow',
          description: `Create a copy of an existing workflow.
    
    Args:
      - id (string): Workflow ID to duplicate
      - newName (string, optional): Name for the copy (default: "Copy of [original name]")
    
    Returns:
      The duplicated workflow with its new ID.`,
          inputSchema: z.object({
            id: z.string().min(1).describe('Workflow ID to duplicate'),
            newName: z.string().optional().describe('Name for the copy')
          }).strict(),
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: false
          }
        },
        async (params: { id: string; newName?: string }) => {
          // Get the original workflow
          const original = await get<Record<string, unknown>>(`/workflows/${params.id}`);
          
          // Prepare copy
          const copy = { ...original };
          delete copy.id;
          delete copy.createdAt;
          delete copy.updatedAt;
          delete copy.versionId;
          copy.name = params.newName || `Copy of ${original.name}`;
          copy.active = false; // Always deactivate copies
          
          // Create the copy
          const newWorkflow = await post<Record<string, unknown>>('/workflows', copy);
          
          return {
            content: [{ type: 'text', text: `✅ Workflow duplicated!\n\n- Original ID: ${params.id}\n- New ID: ${newWorkflow.id}\n- New Name: ${newWorkflow.name}` }],
            structuredContent: newWorkflow
          };
        }
      );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate this is a non-readOnly, non-destructive, non-idempotent mutation tool. The description adds that it 'create[s] a copy' and returns 'the duplicated workflow with its new ID', providing useful context about the creation behavior and return structure. However, it doesn't mention permissions, rate limits, or side effects beyond what annotations cover.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by parameter and return sections. However, the 'Args' and 'Returns' labels are somewhat redundant given the schema, and the optional parameter's default value could be integrated more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter mutation tool with full schema coverage and annotations, the description adequately covers purpose, parameters, and return expectations. The lack of output schema is compensated by the return statement. Minor gaps include no error handling or permission context, but overall it's sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters clearly documented in the schema. The description's 'Args' section repeats the schema information without adding meaningful context like ID format examples or naming conventions. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Create a copy') and resource ('existing workflow'), distinguishing it from siblings like 'n8n_create_workflow' (creates new) and 'n8n_update_workflow' (modifies existing). The verb 'duplicate' is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing a copy of an existing workflow, but provides no explicit guidance on when to choose this over alternatives like 'n8n_create_workflow' or 'n8n_import_workflow'. No prerequisites, exclusions, or comparative context are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DrBalls/n8n-mcp-server-v2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server