n8n_delete_workflow
Permanently delete a workflow from the n8n automation platform. This action cannot be undone, so use it to remove unwanted or obsolete workflows.
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 implements the n8n_delete_workflow tool. It extracts the workflow ID from arguments, validates it, calls the N8nApiClient's deleteWorkflow method, and returns a success response.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 (schema)The tool definition including name, description, and input schema for validating the 'id' parameter.{ 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)The registration/dispatch logic in the MCP server that routes tool calls matching workflowToolHandlers (including n8n_delete_workflow) to the appropriate handler function.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }