Skip to main content
Glama

n8n_update_workflow

Modify existing n8n workflows by updating nodes, connections, settings, or renaming them through the Cursor IDE integration.

Instructions

Update an existing workflow. You can update name, nodes, connections, or settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe workflow ID to update
nameNoNew name for the workflow
nodesNoUpdated array of nodes (replaces all existing nodes)
connectionsNoUpdated connections object (replaces all existing connections)
settingsNoUpdated workflow settings

Implementation Reference

  • The main handler function that executes the n8n_update_workflow tool logic. It validates the workflow ID, constructs updateData from input arguments, calls the N8nApiClient.updateWorkflow method, and returns a formatted success response.
    n8n_update_workflow: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const id = args.id as string; if (!id) { throw new Error('Workflow ID is required'); } const updateData: Parameters<typeof client.updateWorkflow>[1] = {}; if (args.name !== undefined) updateData.name = args.name as string; if (args.nodes !== undefined) updateData.nodes = args.nodes as N8nNode[]; if (args.connections !== undefined) updateData.connections = args.connections as N8nConnections; if (args.settings !== undefined) updateData.settings = args.settings as N8nWorkflowSettings; const workflow = await client.updateWorkflow(id, updateData); return { content: [ { type: 'text' as const, text: JSON.stringify({ success: true, message: `Workflow "${workflow.name}" updated successfully`, workflow: { id: workflow.id, name: workflow.name, active: workflow.active, nodeCount: workflow.nodes.length, updatedAt: workflow.updatedAt, }, }, null, 2), }, ], }; },
  • The ToolDefinition object defining the input schema, description, and parameters validation for the n8n_update_workflow tool.
    { name: 'n8n_update_workflow', description: 'Update an existing workflow. You can update name, nodes, connections, or settings.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The workflow ID to update', }, name: { type: 'string', description: 'New name for the workflow', }, nodes: { type: 'array', description: 'Updated array of nodes (replaces all existing nodes)', }, connections: { type: 'object', description: 'Updated connections object (replaces all existing connections)', }, settings: { type: 'object', description: 'Updated workflow settings', }, }, required: ['id'], }, },
  • src/server.ts:60-64 (registration)
    MCP server registration for listing tools, returning allTools which includes the n8n_update_workflow schema definition.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
  • src/server.ts:122-125 (registration)
    Handler dispatch registration in MCP callTool request handler. Routes calls to n8n_update_workflow (and other workflow tools) by looking up in workflowToolHandlers object.
    if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }
  • Central aggregation of all tool schemas into allTools by spreading workflowTools (containing n8n_update_workflow definition).
    export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ];

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/alicankiraz1/cursor-n8n-builder'

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