Skip to main content
Glama

update-workflow

Modify and update an n8n workflow by altering its properties, nodes, or connections. Provide arguments as compact JSON to ensure precise adjustments.

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

  • Handler for the 'update-workflow' tool in the CallToolRequestSchema switch statement. Validates client existence, calls N8nClient.updateWorkflow, and returns success or error response.
    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
        };
      }
    }
  • src/index.ts:450-470 (registration)
    Registration of the 'update-workflow' tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.
      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"]
      }
    },
  • Core helper method in N8nClient class that performs the HTTP PUT request to update a workflow via the n8n API.
    async updateWorkflow(id: string, workflow: Partial<N8nWorkflow>): Promise<N8nWorkflow> {
      return this.makeRequest<N8nWorkflow>(`/workflows/${id}`, {
        method: 'PUT',
        body: JSON.stringify(workflow),
      });
    }
  • TypeScript interface defining the structure of an n8n workflow object, used in update-workflow operations.
    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?

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.

Install Server

Other Tools

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

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