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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The workflow ID to update | |
| name | No | New name for the workflow | |
| nodes | No | Updated array of nodes (replaces all existing nodes) | |
| connections | No | Updated connections object (replaces all existing connections) | |
| settings | No | Updated workflow settings |
Implementation Reference
- src/tools/workflow-tools.ts:274-310 (handler)The handler function that implements the core logic of the n8n_update_workflow tool. It validates input, constructs update data, calls the N8nApiClient to update the workflow, and returns a 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), }, ], }; },
- src/tools/workflow-tools.ts:87-116 (registration)The tool definition and registration entry in the workflowTools array, including the name, description, and detailed input schema for validation.{ 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/tools/workflow-tools.ts:90-114 (schema)The input schema definition for the n8n_update_workflow tool, specifying parameters and validation rules.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'],