Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Create n8n Workflow

n8n_create_workflow

Create automated workflows in n8n by defining nodes, connections, and settings to streamline business processes and data integration.

Instructions

Create a new workflow in n8n.

Args:

  • name (string): Workflow name (required)

  • nodes (array): Array of node objects, each with:

    • name (string): Node display name

    • type (string): Node type (e.g., "n8n-nodes-base.httpRequest")

    • position ([x, y]): Canvas position

    • parameters (object): Node-specific parameters

    • credentials (object, optional): Credential mappings

  • connections (object): Node connections mapping

  • settings (object, optional): Workflow settings

  • tags (array, optional): Tag IDs to associate

Returns: The created workflow with its assigned ID.

Example node types:

  • n8n-nodes-base.manualTrigger - Manual trigger

  • n8n-nodes-base.scheduleTrigger - Scheduled trigger

  • n8n-nodes-base.webhook - Webhook trigger

  • n8n-nodes-base.httpRequest - HTTP Request

  • n8n-nodes-base.code - Custom JavaScript/Python

  • n8n-nodes-base.set - Set data

  • n8n-nodes-base.if - Conditional

  • n8n-nodes-base.merge - Merge data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesWorkflow name
nodesNoArray of workflow nodes
connectionsNoNode connections mapping
settingsNoWorkflow settings
staticDataNoStatic data for the workflow
tagsNoArray of tag IDs to associate

Implementation Reference

  • The handler function for 'n8n_create_workflow' which calls the 'post' utility to create a workflow in n8n.
    async (params: z.infer<typeof CreateWorkflowSchema>) => {
      const workflow = await post<N8nWorkflow>('/workflows', params);
      
      return {
        content: [{ type: 'text', text: `✅ Workflow created successfully!\n\n${formatWorkflow(workflow)}` }],
        structuredContent: workflow
      };
    }
  • Registration of the 'n8n_create_workflow' tool, including its schema and description.
      server.registerTool(
        'n8n_create_workflow',
        {
          title: 'Create n8n Workflow',
          description: `Create a new workflow in n8n.
    
    Args:
      - name (string): Workflow name (required)
      - nodes (array): Array of node objects, each with:
        - name (string): Node display name
        - type (string): Node type (e.g., "n8n-nodes-base.httpRequest")
        - position ([x, y]): Canvas position
        - parameters (object): Node-specific parameters
        - credentials (object, optional): Credential mappings
      - connections (object): Node connections mapping
      - settings (object, optional): Workflow settings
      - tags (array, optional): Tag IDs to associate
    
    Returns:
      The created workflow with its assigned ID.
    
    Example node types:
      - n8n-nodes-base.manualTrigger - Manual trigger
      - n8n-nodes-base.scheduleTrigger - Scheduled trigger
      - n8n-nodes-base.webhook - Webhook trigger
      - n8n-nodes-base.httpRequest - HTTP Request
      - n8n-nodes-base.code - Custom JavaScript/Python
      - n8n-nodes-base.set - Set data
      - n8n-nodes-base.if - Conditional
      - n8n-nodes-base.merge - Merge data`,
          inputSchema: CreateWorkflowSchema,
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: false
          }
        },
        async (params: z.infer<typeof CreateWorkflowSchema>) => {
          const workflow = await post<N8nWorkflow>('/workflows', params);
          
          return {
            content: [{ type: 'text', text: `✅ Workflow created successfully!\n\n${formatWorkflow(workflow)}` }],
            structuredContent: workflow
          };
        }
      );
  • Zod schema definition for 'CreateWorkflowSchema' used to validate inputs for 'n8n_create_workflow'.
    export const CreateWorkflowSchema = z.object({
      name: z.string().min(1).max(128)
        .describe('Workflow name'),
      nodes: z.array(NodeSchema).default([])
        .describe('Array of workflow nodes'),
      connections: z.record(z.record(z.array(z.array(ConnectionSchema)))).default({})
        .describe('Node connections mapping'),
      settings: WorkflowSettingsSchema.optional()
        .describe('Workflow settings'),
      staticData: z.record(z.unknown()).optional()
        .describe('Static data for the workflow'),
      tags: z.array(z.string()).optional()
        .describe('Array of tag IDs to associate')
    }).strict();
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 creation operation. The description adds minimal behavioral context beyond this—it mentions the return value ('assigned ID') but doesn't cover error conditions, rate limits, or authentication requirements. It doesn't contradict annotations, but adds limited value.

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 well-structured with clear sections (Args, Returns, Example node types) and avoids unnecessary verbosity. However, the 'Example node types' section is lengthy and could be condensed or moved to a separate reference, as it lists many examples without explaining their use cases.

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 complexity (6 parameters with nested objects) and lack of output schema, the description is moderately complete. It covers the basic creation process and return value but lacks details on error handling, validation rules (e.g., node type compatibility), or how 'connections' should be structured. The annotations provide safety context, but more behavioral guidance would help.

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?

With 100% schema description coverage, the schema fully documents all 6 parameters. The description adds some semantic clarification by listing example node types and noting that 'name' is required, but this is largely redundant with the schema. It doesn't explain complex structures like 'connections' mapping or 'settings' options beyond what the schema provides.

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 new workflow in n8n') and distinguishes it from sibling tools like 'n8n_update_workflow', 'n8n_duplicate_workflow', and 'n8n_import_workflow'. It specifies the exact resource being created (a workflow) with no ambiguity.

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?

The description provides no guidance on when to use this tool versus alternatives like 'n8n_import_workflow' (for importing existing workflows) or 'n8n_duplicate_workflow' (for copying). It also doesn't mention prerequisites, such as whether the user needs specific permissions or if certain node types require credentials.

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