get-execution
Retrieve detailed execution data by ID from the N8N MCP server for specific workflow tracking and analysis.
Instructions
Retrieve a specific execution by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| id | Yes | ||
| includeData | No |
Implementation Reference
- src/index.ts:1629-1659 (handler)The main handler function for the 'get-execution' tool within the CallToolRequestSchema handler. It retrieves the N8nClient instance using the provided clientId, calls the client's getExecution method with the execution id and optional includeData flag, and returns the execution details as JSON or an error.case "get-execution": { const { clientId, id, includeData } = args as { clientId: string; id: number; includeData?: boolean }; 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.getExecution(id, includeData); return { content: [{ type: "text", text: JSON.stringify(execution, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
- src/index.ts:711-719 (schema)Input schema definition for the 'get-execution' tool, specifying required clientId and id (number), and optional includeData boolean.inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "number" }, includeData: { type: "boolean" } }, required: ["clientId", "id"] }
- src/index.ts:708-720 (registration)Tool registration entry in the listTools response, defining the name, description, and input schema for 'get-execution'.{ name: "get-execution", description: "Retrieve a specific execution by ID.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "number" }, includeData: { type: "boolean" } }, required: ["clientId", "id"] } },
- src/index.ts:285-290 (helper)Helper method in N8nClient class that performs the HTTP request to n8n's /executions/{id} endpoint, optionally appending includeData query parameter, using the shared makeRequest utility.async getExecution(id: number, includeData: boolean = false): Promise<N8nExecution> { const params = new URLSearchParams(); if (includeData) params.append('includeData', 'true'); return this.makeRequest<N8nExecution>(`/executions/${id}?${params.toString()}`); }