Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

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
          };
        }
      );

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