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[];
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the mutation action ('Update') and a critical format requirement ('compact, single-line JSON'), but fails to cover permissions, error handling, rate limits, or what happens to unspecified properties. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 with two sentences: the first states the purpose and usage, and the second provides a critical formatting requirement. It is front-loaded with essential information and avoids unnecessary details, though it could be slightly more structured.

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 the complexity (mutation tool with nested objects, 3 parameters, 0% schema coverage, no output schema, and no annotations), the description is incomplete. It lacks details on parameter meanings, behavioral traits like permissions or side effects, and expected outcomes, 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 'Arguments must be provided as compact, single-line JSON', which adds formatting context beyond the schema, but does not explain the purpose or semantics of the three required parameters (clientId, id, workflow). This partial compensation is insufficient for the coverage gap.

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 siblings like 'create-workflow' by focusing on existing workflows, though it doesn't explicitly contrast with all siblings like 'update-project'.

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

Usage Guidelines3/5

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

The description provides some guidance by mentioning 'Use after get-workflow', which implies a prerequisite and sequence. However, it lacks explicit alternatives (e.g., when to use 'create-workflow' instead) or exclusions (e.g., when not to use it), leaving usage context partially implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.