Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Import Workflow JSON

n8n_import_workflow

Import n8n workflows from JSON data to automate processes. Add workflows to your n8n instance by providing complete JSON definitions.

Instructions

Import a workflow from JSON.

Args:

  • workflowJson (object): Complete workflow JSON object with:

    • name (string): Workflow name

    • nodes (array): Workflow nodes

    • connections (object): Node connections

    • settings (object, optional): Workflow settings

Returns: The imported workflow with its new ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowJsonYesComplete workflow JSON object to import

Implementation Reference

  • The 'n8n_import_workflow' tool is registered and implemented in src/tools/audit-utils.ts. It takes a workflow JSON object as input and makes a POST request to the n8n API to import the workflow.
      server.registerTool(
        'n8n_import_workflow',
        {
          title: 'Import Workflow JSON',
          description: `Import a workflow from JSON.
    
    Args:
      - workflowJson (object): Complete workflow JSON object with:
        - name (string): Workflow name
        - nodes (array): Workflow nodes
        - connections (object): Node connections
        - settings (object, optional): Workflow settings
    
    Returns:
      The imported workflow with its new ID.`,
          inputSchema: z.object({
            workflowJson: z.record(z.unknown())
              .describe('Complete workflow JSON object to import')
          }).strict(),
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: false
          }
        },
        async (params: { workflowJson: Record<string, unknown> }) => {
          const workflow = await post<Record<string, unknown>>('/workflows', params.workflowJson);
          
          return {
            content: [{ type: 'text', text: `✅ Workflow imported!\n\n- ID: ${workflow.id}\n- Name: ${workflow.name}` }],
            structuredContent: workflow
          };
        }
      );
Behavior3/5

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

Annotations indicate this is a non-readOnly, non-destructive operation, which the description aligns with by implying creation ('imports'). It adds minimal behavioral context beyond annotations, such as mentioning the return includes a 'new ID', but doesn't cover error handling, validation, or side effects like overwriting existing workflows.

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 front-loaded with the main purpose, followed by structured Args and Returns sections. It's efficient with minimal fluff, though the Args details could be slightly condensed as they overlap with schema information.

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

Completeness3/5

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

Given the tool's moderate complexity (importing JSON with nested objects) and lack of output schema, the description is adequate but incomplete. It explains the input and return value but misses details on error cases, validation rules, or how it interacts with existing workflows, which could aid the agent.

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%, so the schema already documents the parameter. The description adds some semantics by detailing the JSON structure (name, nodes, connections, settings), but this is redundant with the schema's 'additionalProperties' and doesn't provide extra syntax or format details, meeting the baseline.

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

Purpose4/5

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

The description clearly states the action ('Import a workflow from JSON') and specifies the resource ('workflow'), which is distinct from siblings like 'create_workflow' or 'export_workflow'. However, it doesn't explicitly differentiate from 'duplicate_workflow' or 'transfer_workflow', which might involve similar import-like operations, keeping it from a perfect score.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'create_workflow' or 'duplicate_workflow'. The description lacks context about prerequisites, such as needing valid JSON or when import is preferred over creation, leaving the agent without usage direction.

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