n8n_update_workflow
Modify existing n8n workflows by updating nodes, connections, names, or activation status to adapt automation processes as requirements change.
Instructions
Update an existing workflow
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "n8n_update_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow ID | |
| name | No | New workflow name | |
| nodes | No | Updated nodes | |
| connections | No | Updated connections | |
| active | No | Active status |
Implementation Reference
- src/index.ts:82-89 (handler)Handler logic for 'n8n_update_workflow' in the MCP server request handler.
case 'n8n_update_workflow': { if (!args?.id) throw new Error('id is required'); const { id, ...data } = args; const result = await n8nClient.updateWorkflow(id as string, data); return { content: [{ type: 'text', text: formatResponse(result) }], }; } - src/index.ts:483-496 (registration)Tool registration and schema definition for 'n8n_update_workflow'.
name: 'n8n_update_workflow', description: 'Update an existing workflow', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Workflow ID' }, name: { type: 'string', description: 'New workflow name' }, nodes: { type: 'array', description: 'Updated nodes' }, connections: { type: 'object', description: 'Updated connections' }, active: { type: 'boolean', description: 'Active status' }, }, required: ['id'], }, }, - src/n8n-client.ts:66-69 (helper)The actual API client method that performs the HTTP PUT request to update the workflow.
async updateWorkflow(id: string, data: any): Promise<any> { const response = await this.client.put(`/workflows/${id}`, data); return response.data; }