Skip to main content
Glama

delete-execution

Remove a specific workflow execution by ID to manage n8n automation history and optimize system performance.

Instructions

Delete a specific execution by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • MCP tool handler for 'delete-execution' that retrieves the N8nClient instance and calls its deleteExecution method, handling errors and success responses.
    case "delete-execution": {
      const { clientId, id } = args as { clientId: string; id: number };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const execution = await client.deleteExecution(id);
        return {
          content: [{
            type: "text",
            text: `Successfully deleted execution:\n${JSON.stringify(execution, null, 2)}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • Core implementation in N8nClient class that performs the HTTP DELETE request to the n8n API endpoint /executions/{id}.
    async deleteExecution(id: number): Promise<N8nExecution> {
      return this.makeRequest<N8nExecution>(`/executions/${id}`, {
        method: 'DELETE',
      });
    }
  • src/index.ts:722-732 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
      name: "delete-execution",
      description: "Delete a specific execution by ID.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          id: { type: "number" }
        },
        required: ["clientId", "id"]
      }
    },
  • Input schema definition for the delete-execution tool, specifying clientId (string) and id (number) as required parameters.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" },
        id: { type: "number" }
      },
      required: ["clientId", "id"]
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/illuminaresolutions/n8n-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server