n8n_list_executions
Retrieve and filter workflow execution history by workflow ID and status to monitor performance and troubleshoot issues.
Instructions
List workflow executions. Can filter by workflow ID and status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | No | Filter executions by workflow ID | |
| status | No | Filter by execution status | |
| limit | No | Maximum number of executions to return (default: 20) | |
| includeData | No | Include execution data in response (default: false) |
Implementation Reference
- src/tools/execution-tools.ts:114-147 (handler)The main asynchronous handler function that executes the n8n_list_executions tool logic. It uses the N8nApiClient to fetch executions based on provided filters and returns a formatted JSON response.n8n_list_executions: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const result = await client.listExecutions({ workflowId: args.workflowId as string | undefined, status: args.status as 'success' | 'error' | 'waiting' | undefined, limit: (args.limit as number) || 20, includeData: args.includeData as boolean | undefined, }); const executions = result.data.map((e) => ({ id: e.id, workflowId: e.workflowId, status: e.status, mode: e.mode, startedAt: e.startedAt, stoppedAt: e.stoppedAt, finished: e.finished, })); return { content: [ { type: 'text' as const, text: JSON.stringify({ count: executions.length, executions, hasMore: !!result.nextCursor, }, null, 2), }, ], }; },
- src/tools/execution-tools.ts:14-39 (schema)The tool definition object containing the name, description, and input schema for validating arguments to n8n_list_executions.{ name: 'n8n_list_executions', description: 'List workflow executions. Can filter by workflow ID and status.', inputSchema: { type: 'object', properties: { workflowId: { type: 'string', description: 'Filter executions by workflow ID', }, status: { type: 'string', enum: ['success', 'error', 'waiting'], description: 'Filter by execution status', }, limit: { type: 'number', description: 'Maximum number of executions to return (default: 20)', }, includeData: { type: 'boolean', description: 'Include execution data in response (default: false)', }, }, }, },
- src/server.ts:59-64 (registration)MCP server handler for the listTools request, which returns allTools array including the definition for n8n_list_executions.// List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
- src/server.ts:127-131 (registration)Dispatch logic in the MCP tool call handler that routes calls to execution tools like n8n_list_executions to the appropriate handler function.// Execution tools if (name in executionToolHandlers) { const handler = executionToolHandlers[name as keyof typeof executionToolHandlers]; return handler(client, args); }