n8n_delete_workflow
Permanently delete a workflow from n8n. This action cannot be undone. Provide the workflow ID to remove it.
Instructions
Permanently delete a workflow. This action cannot be undone.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The workflow ID to delete |
Implementation Reference
- src/tools/workflow-tools.ts:312-334 (handler)The handler function that executes the n8n_delete_workflow tool. Validates the workflow ID from input arguments, calls the N8nApiClient's deleteWorkflow method, and returns a JSON success message.n8n_delete_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'); } await client.deleteWorkflow(id); return { content: [ { type: 'text' as const, text: JSON.stringify({ success: true, message: `Workflow ${id} deleted successfully`, }, null, 2), }, ], }; },
- src/tools/workflow-tools.ts:117-130 (registration)Tool registration entry in workflowTools array, defining the name, description, and input schema (requiring 'id' string) for MCP tool discovery and validation.{ name: 'n8n_delete_workflow', description: 'Permanently delete a workflow. This action cannot be undone.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The workflow ID to delete', }, }, required: ['id'], }, },
- src/server.ts:122-125 (registration)Handler dispatch logic in the MCP server that routes calls to workflowToolHandlers (including n8n_delete_workflow) when the tool name matches.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }
- src/tools/workflow-tools.ts:120-129 (schema)Input schema definition specifying the required 'id' parameter of type string for the n8n_delete_workflow tool.inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The workflow ID to delete', }, }, required: ['id'], },