delete_execution
Delete a specific workflow execution by its ID to remove it from n8n execution history. Useful for cleaning up unfinished or failed runs.
Instructions
Delete an execution
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": {
"executionId": "<executionId>"
},
"name": "delete_execution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| executionId | Yes | The ID of the execution to delete |
Implementation Reference
- src/handlers.ts:126-129 (handler)Handler case in the tool dispatch switch. Validates args using ExecutionIdSchema (extracting executionId) and calls client.deleteExecution(executionId).
case "delete_execution": { const { executionId } = ExecutionIdSchema.parse(args); return await client.deleteExecution(executionId); } - src/handlers.ts:47-49 (schema)Zod schema used to validate the input arguments for delete_execution (and other execution-related tools). Expects a string 'executionId'.
const ExecutionIdSchema = z.object({ executionId: z.string(), }); - src/tools.ts:221-233 (registration)Tool definition/registration for 'delete_execution' with description and inputSchema requiring an 'executionId' string.
{ name: "delete_execution", description: "Delete an execution", inputSchema: { type: "object", properties: { executionId: { type: "string", description: "The ID of the execution to delete", }, }, required: ["executionId"], }, - src/n8n-client.ts:128-131 (helper)Actual API call to the n8n backend. Sends a DELETE request to /api/v1/executions/{id} and returns a success message.
async deleteExecution(id: string) { await this.client.delete(`/api/v1/executions/${id}`); return { success: true, message: `Execution ${id} deleted successfully` }; }