Skip to main content
Glama
nikolausm

n8n MCP Server

by nikolausm

create_workflow

Create automated workflows in n8n by providing a JSON definition with nodes, connections, and optional settings.

Instructions

Create a new n8n workflow from JSON definition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the workflow
nodesYesArray of workflow nodes
connectionsYesNode connections object
activeNoWhether to activate the workflow
settingsNoWorkflow settings
tagsNoTags for the workflow

Implementation Reference

  • Handler for create_workflow: parses args with CreateWorkflowSchema and delegates to client.createWorkflow()
    case "create_workflow": {
      const workflow = CreateWorkflowSchema.parse(args);
      return await client.createWorkflow(workflow);
    }
  • N8nClient.createWorkflow: sends POST /api/v1/workflows with workflow payload and validates response with WorkflowSchema
    async createWorkflow(workflow: any) {
      const response = await this.client.post("/api/v1/workflows", workflow);
      return WorkflowSchema.parse(response.data);
    }
  • CreateWorkflowSchema: Zod schema validating name (string, required), nodes (array), connections (record), active (boolean, default false), settings (record, optional), tags (array of strings, optional)
    const CreateWorkflowSchema = z.object({
      name: z.string(),
      nodes: z.array(z.any()),
      connections: z.record(z.any()),
      active: z.boolean().optional().default(false),
      settings: z.record(z.any()).optional(),
      tags: z.array(z.string()).optional(),
    });
  • src/tools.ts:44-79 (registration)
    Tool registration with name 'create_workflow', description, and inputSchema (JSON Schema) requiring name, nodes, connections
    {
      name: "create_workflow",
      description: "Create a new n8n workflow from JSON definition",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the workflow",
          },
          nodes: {
            type: "array",
            description: "Array of workflow nodes",
          },
          connections: {
            type: "object",
            description: "Node connections object",
          },
          active: {
            type: "boolean",
            description: "Whether to activate the workflow",
            default: false,
          },
          settings: {
            type: "object",
            description: "Workflow settings",
          },
          tags: {
            type: "array",
            items: { type: "string" },
            description: "Tags for the workflow",
          },
        },
        required: ["name", "nodes", "connections"],
      },
    },
  • src/index.ts:32-34 (registration)
    MCP server registers the tool list via ListToolsRequestSchema, making create_workflow discoverable
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior2/5

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

No annotations provided, so the description alone must disclose behaviors. It merely states 'create' (mutation) but does not mention authentication, validation of JSON, default values (e.g., active=false), or error handling.

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

Conciseness5/5

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

Single sentence, no unnecessary words. While concise, it effectively conveys the primary action and input format.

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

Completeness2/5

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

No output schema, no annotations, and the description lacks details on return values, side effects, or error conditions. For a creation tool with 6 parameters, more context is needed.

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 coverage is 100%, with each parameter having a description. The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

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 verb 'create', the resource 'n8n workflow', and the input format 'from JSON definition'. It effectively distinguishes this tool from siblings like activate_workflow or update_workflow.

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 on when to use this tool versus alternatives (e.g., update_workflow for modifications), nor any prerequisites or context about when the tool should not be used.

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/nikolausm/n8n-mcp-server'

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