Skip to main content
Glama

create-workflow

Create new n8n workflows with nodes and connections. Set up automation processes through the MCP server interface.

Instructions

Create a new workflow in n8n. Use to set up a new workflow with optional nodes and connections. IMPORTANT: 1) Arguments must be provided as compact, single-line JSON without whitespace or newlines. 2) Must provide full workflow structure including nodes and connections arrays, even if empty. The 'active' property should not be included as it is read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
nameYes
nodesNo
connectionsNo

Implementation Reference

  • MCP tool handler for 'create-workflow' in the CallToolRequestSchema switch statement. Validates client, calls N8nClient.createWorkflow, and returns success or error response.
    case "create-workflow": {
      const { clientId, name, nodes = [], connections = {} } = args as {
        clientId: string;
        name: string;
        nodes?: any[];
        connections?: Record<string, any>;
      };
    
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const workflow = await client.createWorkflow(name, nodes, connections);
        return {
          content: [{
            type: "text",
            text: `Successfully created workflow:\n${JSON.stringify(workflow, null, 2)}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • Input schema definition for the 'create-workflow' tool, listed in the ListToolsRequestSchema response.
      name: "create-workflow",
      description: "Create a new workflow in n8n. Use to set up a new workflow with optional nodes and connections. IMPORTANT: 1) Arguments must be provided as compact, single-line JSON without whitespace or newlines. 2) Must provide full workflow structure including nodes and connections arrays, even if empty. The 'active' property should not be included as it is read-only.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          name: { type: "string" },
          nodes: { type: "array" },
          connections: { type: "object" }
        },
        required: ["clientId", "name"]
      }
    },
  • N8nClient.createWorkflow method: core implementation that sends POST request to n8n /api/v1/workflows endpoint with workflow data.
    async createWorkflow(name: string, nodes: any[] = [], connections: any = {}): Promise<N8nWorkflow> {
      return this.makeRequest<N8nWorkflow>('/workflows', {
        method: 'POST',
        body: JSON.stringify({
          name,
          nodes,
          connections,
          settings: {
            saveManualExecutions: true,
            saveExecutionProgress: true,
          },
        }),
      });
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the 'active' property is read-only, which is useful behavioral context. However, it lacks details on permissions, error handling, or what happens upon creation (e.g., whether the workflow is immediately active), leaving gaps for a mutation tool.

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 appropriately sized and front-loaded with the main purpose. The two IMPORTANT points are necessary but could be more integrated; overall, it's efficient with minimal waste.

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?

For a mutation tool with no annotations, 4 parameters (2 required), 0% schema coverage, and no output schema, the description is incomplete. It misses details on parameter meanings, expected outputs, error conditions, and usage context relative to siblings, making it inadequate for safe and effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'nodes' and 'connections' arrays and that 'active' should not be included, but doesn't explain the purpose or format of 'clientId' or 'name', nor does it clarify the structure of 'nodes' and 'connections'. This leaves key parameters undocumented.

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 verb ('Create') and resource ('new workflow in n8n'), and specifies it's for setting up workflows with optional nodes and connections. However, it doesn't explicitly differentiate from sibling tools like 'update-workflow' or 'get-workflow', which would be needed for a score of 5.

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 'update-workflow' or 'get-workflow', nor does it mention prerequisites or context for creation. It only includes technical formatting requirements, not usage context.

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

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