n8n_update_workflow
Modify existing n8n workflows by updating their name, nodes, connections, settings, or tags. Provide complete arrays for nodes and connections to replace current configurations.
Instructions
Update an existing workflow. Can update name, nodes, connections, settings, or tags.
⚠️ IMPORTANT: When updating nodes or connections, you must provide the COMPLETE arrays. Partial updates are not supported - the provided values will replace existing ones.
Args:
id (string): Workflow ID to update (required)
name (string, optional): New workflow name
nodes (array, optional): Complete updated nodes array
connections (object, optional): Complete updated connections
settings (object, optional): Updated settings
tags (array, optional): Updated tag IDs
Returns: The updated workflow object.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow ID to update | |
| name | No | New workflow name | |
| nodes | No | Updated nodes array | |
| connections | No | Updated connections | |
| settings | No | Updated settings | |
| staticData | No | Updated static data | |
| tags | No | Updated tag IDs |
Implementation Reference
- src/tools/workflows.ts:182-218 (handler)The definition and handler implementation for the n8n_update_workflow tool. It uses the `put` utility to send a request to the n8n API.
server.registerTool( 'n8n_update_workflow', { title: 'Update n8n Workflow', description: `Update an existing workflow. Can update name, nodes, connections, settings, or tags. ⚠️ IMPORTANT: When updating nodes or connections, you must provide the COMPLETE arrays. Partial updates are not supported - the provided values will replace existing ones. Args: - id (string): Workflow ID to update (required) - name (string, optional): New workflow name - nodes (array, optional): Complete updated nodes array - connections (object, optional): Complete updated connections - settings (object, optional): Updated settings - tags (array, optional): Updated tag IDs Returns: The updated workflow object.`, inputSchema: UpdateWorkflowSchema, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false } }, async (params: z.infer<typeof UpdateWorkflowSchema>) => { const { id, ...updateData } = params; const workflow = await put<N8nWorkflow>(`/workflows/${id}`, updateData); return { content: [{ type: 'text', text: `✅ Workflow updated successfully!\n\n${formatWorkflow(workflow)}` }], structuredContent: workflow }; } );