update_node
Modify an existing node's configuration, parameters, or credentials within an n8n workflow to adapt automation processes as requirements change.
Instructions
Update an existing node in an n8n workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | ||
| nodeId | Yes | ||
| params | No | ||
| credentials | No | ||
| name | No | ||
| typeVersion | No |
Implementation Reference
- src/n8n-client.ts:426-439 (handler)Main handler function that performs the node update by fetching the current workflow, locating the target node by ID, merging provided updates to parameters, credentials, name, or typeVersion, and persisting the modified workflow using optimistic concurrency control.async updateNode(request: UpdateNodeRequest): Promise<UpdateNodeResponse> { await this.performWorkflowUpdate(request.workflowId, (workflow) => { const nodeIndex = workflow.nodes.findIndex((node) => node.id === request.nodeId); if (nodeIndex === -1) { throw new Error(`Node with id ${request.nodeId} not found in workflow ${request.workflowId}`); } const node = workflow.nodes[nodeIndex]; if (request.params !== undefined) node.parameters = { ...node.parameters, ...request.params }; if (request.credentials !== undefined) node.credentials = { ...node.credentials, ...request.credentials }; if (request.name !== undefined) node.name = request.name; if (request.typeVersion !== undefined) node.typeVersion = request.typeVersion; }); return { nodeId: request.nodeId }; }
- src/index.ts:553-562 (handler)MCP server handler for the 'update_node' tool call, which delegates to the N8nClient.updateNode method and formats the response.private async handleUpdateNode(args: UpdateNodeRequest) { const result = await this.n8nClient.updateNode(args); return { content: [ { type: 'text', text: JSON.stringify(jsonSuccess(result), null, 2), }, ], };
- src/index.ts:212-212 (registration)Tool registration in the MCP list_tools response, defining the name, description, and input schema.{ name: 'update_node', description: 'Update an existing node in an n8n workflow', inputSchema: { type: 'object', properties: { workflowId: { oneOf: [{ type: 'string' }, { type: 'number' }] }, nodeId: { type: 'string' }, params: { type: 'object' }, credentials: { type: 'object' }, name: { type: 'string' }, typeVersion: { type: 'number' } }, required: ['workflowId', 'nodeId'] } },
- src/types.ts:201-208 (schema)TypeScript interface defining the input parameters for the update_node tool.export interface UpdateNodeRequest { workflowId: string | number; nodeId: string; params?: Record<string, any>; credentials?: Record<string, string>; name?: string; typeVersion?: number; }
- src/index.ts:317-318 (registration)Dispatch case in the MCP CallToolRequest handler that routes 'update_node' calls to the specific handler method.case 'update_node': return await this.handleUpdateNode(request.params.arguments as unknown as UpdateNodeRequest);