n8n_delete_workflow
Permanently delete a workflow from n8n. This action cannot be undone, so ensure you have the correct workflow ID before proceeding.
Instructions
Permanently delete a workflow.
⚠️ WARNING: This action cannot be undone!
Args:
id (string): Workflow ID to delete
Returns: Confirmation of deletion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique identifier of the resource |
Implementation Reference
- src/tools/workflows.ts:221-250 (handler)Implementation of the n8n_delete_workflow tool, which registers the tool with the MCP server and executes a DELETE request to remove the workflow.
server.registerTool( 'n8n_delete_workflow', { title: 'Delete n8n Workflow', description: `Permanently delete a workflow. ⚠️ WARNING: This action cannot be undone! Args: - id (string): Workflow ID to delete Returns: Confirmation of deletion.`, inputSchema: IdParamSchema, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false } }, async (params: z.infer<typeof IdParamSchema>) => { await del(`/workflows/${params.id}`); return { content: [{ type: 'text', text: `✅ Workflow ${params.id} deleted successfully.` }], structuredContent: { deleted: true, id: params.id } }; } );