Skip to main content
Glama

update-workflow

Modify existing n8n workflows by updating properties, nodes, or connections. Use this tool after retrieving a workflow to apply changes to automation processes.

Instructions

Update an existing workflow in n8n. Use after get-workflow to modify a workflow's properties, nodes, or connections. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes
workflowYes

Implementation Reference

  • The MCP tool handler that processes the 'update-workflow' call, retrieves the N8nClient instance using clientId, and invokes the client's updateWorkflow method with the provided id and workflow updates.
    case "update-workflow": {
      const { clientId, id, workflow } = args as {
        clientId: string;
        id: string;
        workflow: Partial<N8nWorkflow>;
      };
    
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const updatedWorkflow = await client.updateWorkflow(id, workflow);
        return {
          content: [{
            type: "text",
            text: `Successfully updated workflow:\n${JSON.stringify(updatedWorkflow, null, 2)}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • The N8nClient class method that sends a PUT request to the n8n API endpoint `/workflows/{id}` with the partial workflow update data.
    async updateWorkflow(id: string, workflow: Partial<N8nWorkflow>): Promise<N8nWorkflow> {
      return this.makeRequest<N8nWorkflow>(`/workflows/${id}`, {
        method: 'PUT',
        body: JSON.stringify(workflow),
      });
    }
  • src/index.ts:450-470 (registration)
    The tool specification registered in the ListTools handler, defining the name, description, and input schema for 'update-workflow'.
      name: "update-workflow",
      description: "Update an existing workflow in n8n. Use after get-workflow to modify a workflow's properties, nodes, or connections. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          id: { type: "string" },
          workflow: {
            type: "object",
            properties: {
              name: { type: "string" },
              active: { type: "boolean" },
              nodes: { type: "array" },
              connections: { type: "object" },
              settings: { type: "object" }
            }
          }
        },
        required: ["clientId", "id", "workflow"]
      }
    },
  • TypeScript interface defining the structure of an n8n workflow object, used in the update-workflow tool's workflow parameter.
    interface N8nWorkflow {
      id: number;
      name: string;
      active: boolean;
      createdAt: string;
      updatedAt: string;
      tags: string[];
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses that this is a mutation tool ('Update'), mentions a behavioral constraint ('Arguments must be provided as compact, single-line JSON without whitespace or newlines'), and implies it modifies existing data. However, it lacks critical details: no information about permissions required, whether changes are reversible, error handling, or what the response contains. For a mutation tool with 3 parameters and no annotations, this is insufficient.

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?

Two sentences, front-loaded with core purpose, followed by an important behavioral note. Zero waste: every sentence provides essential information (usage context and input format constraint).

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?

Given complexity (mutation tool, 3 parameters with nested objects, 0% schema coverage, no annotations, no output schema), the description is incomplete. It covers purpose and a format constraint but lacks details on parameter meanings, behavioral traits (e.g., side effects, permissions), and expected outcomes. For a tool that modifies workflows, this leaves significant gaps.

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 0%, so the schema provides no parameter descriptions. The description adds some value by implying 'workflow' parameter includes properties, nodes, or connections to modify, and notes the JSON format requirement. However, it doesn't explain the semantics of clientId, id, or the nested workflow object fields (name, active, nodes, connections, settings), leaving most 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 ('Update') and resource ('an existing workflow in n8n'), and specifies what can be modified ('workflow's properties, nodes, or connections'). It distinguishes from create-workflow by mentioning 'existing workflow' and referencing get-workflow, but doesn't explicitly contrast with update-project or update-tag among siblings.

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

Usage Guidelines4/5

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

It provides clear context: 'Use after get-workflow to modify a workflow's properties, nodes, or connections.' This gives a specific prerequisite (get-workflow) and scope of modification. However, it doesn't explicitly state when NOT to use it (e.g., vs. create-workflow or deactivate-workflow) or name alternatives among siblings.

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