n8n_get_execution
Retrieve detailed information about a specific n8n workflow execution, including input and output data, to analyze performance and troubleshoot issues.
Instructions
Get detailed information about a specific execution including input/output data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The execution ID | |
| includeData | No | Include full execution data (default: true) |
Implementation Reference
- src/tools/execution-tools.ts:149-187 (handler)The main handler function that executes the tool logic: validates input, fetches execution data from N8n API client, formats response, handles errors.n8n_get_execution: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const id = args.id as string; if (!id) { throw new Error('Execution ID is required'); } const includeData = args.includeData !== false; // default true const execution = await client.getExecution(id, includeData); const response: Record<string, unknown> = { id: execution.id, workflowId: execution.workflowId, status: execution.status, mode: execution.mode, startedAt: execution.startedAt, stoppedAt: execution.stoppedAt, finished: execution.finished, }; if (includeData && execution.data) { response.data = execution.data; } if (execution.data?.resultData?.error) { response.error = execution.data.resultData.error; } return { content: [ { type: 'text' as const, text: JSON.stringify(response, null, 2), }, ], }; },
- src/tools/execution-tools.ts:40-57 (schema)Tool definition including name, description, input schema with required 'id' parameter and optional 'includeData'.{ name: 'n8n_get_execution', description: 'Get detailed information about a specific execution including input/output data.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The execution ID', }, includeData: { type: 'boolean', description: 'Include full execution data (default: true)', }, }, required: ['id'], }, },
- src/server.ts:127-131 (registration)Server-side dispatch logic that registers and routes calls to the n8n_get_execution handler (and other execution tools) based on tool name.// Execution tools if (name in executionToolHandlers) { const handler = executionToolHandlers[name as keyof typeof executionToolHandlers]; return handler(client, args); }
- src/tools/index.ts:12-16 (registration)Aggregation of all tool definitions including n8n_get_execution schema into the central allTools array used for MCP tool listing.export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ];