n8n_list_executions
Retrieve recent n8n workflow executions. Filter by workflow ID, status (success, error, waiting), or limit results. Optionally include full execution data for diagnosing failures.
Instructions
List recent executions from a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Filter by workflowId, status (success|error|waiting), limit. Pass includeData: true to get the full execution body (large) — pair with n8n_explain_execution to diagnose a specific failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | No | Filter by workflow ID. | |
| status | No | Filter by status: success | error | waiting. | |
| limit | No | Page size (n8n default: 100, max: 250). | |
| includeData | No | Include full execution data (large). Default false — pair with n8n_explain_execution. |
Implementation Reference
- src/index.ts:88-93 (registration)Registration of the 'n8n_list_executions' tool in the tools array with its name, description, and inputSchema.
{ name: "n8n_list_executions", description: "List recent executions from a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Filter by workflowId, status (success|error|waiting), limit. Pass `includeData: true` to get the full execution body (large) — pair with n8n_explain_execution to diagnose a specific failure.", inputSchema: listExecutionsInputSchema, }, - src/tools/rest-api.ts:278-303 (handler)Handler function 'listExecutions' that executes the n8n_list_executions tool logic — parses arguments, builds query params, calls the n8n REST API GET /executions, and returns either full data or a summary.
export async function listExecutions(rawArgs: unknown) { const cfg = getConfig(); if ("error" in cfg) return textResult(cfg.error); const args = listExecutionsZod.parse(rawArgs ?? {}); const params = new URLSearchParams(); if (args.workflowId) params.set("workflowId", args.workflowId); if (args.status) params.set("status", args.status); if (args.limit) params.set("limit", String(args.limit)); if (args.includeData) params.set("includeData", "true"); const qs = params.toString() ? `?${params}` : ""; const r = await call(cfg, "GET", `/executions${qs}`); if (!r.ok) return textResult(r.error); if (args.includeData) return jsonResult(r.data); const data = r.data as { data?: unknown[] } | unknown[]; const arr = Array.isArray(data) ? data : data?.data ?? []; const summary = (arr as Array<Record<string, unknown>>).map((e) => ({ id: e.id, workflowId: e.workflowId, status: e.status, mode: e.mode, startedAt: e.startedAt, stoppedAt: e.stoppedAt, finished: e.finished, })); return jsonResult(summary); } - src/tools/rest-api.ts:271-276 (schema)Input schema (Zod) for validation of the listExecutions arguments: workflowId, status, limit, includeData.
const listExecutionsZod = z.object({ workflowId: z.string().optional(), status: z.enum(["success", "error", "waiting"]).optional(), limit: z.number().int().positive().max(250).optional(), includeData: z.boolean().optional(), }); - src/tools/rest-api.ts:250-269 (schema)JSON Schema input schema for listExecutions (used in MCP tool registration).
export const listExecutionsInputSchema = { type: "object", properties: { workflowId: { type: "string", description: "Filter by workflow ID." }, status: { type: "string", description: "Filter by status: success | error | waiting.", enum: ["success", "error", "waiting"], }, limit: { type: "number", description: "Page size (n8n default: 100, max: 250).", }, includeData: { type: "boolean", description: "Include full execution data (large). Default false — pair with n8n_explain_execution.", }, }, } as const; - src/index.ts:127-128 (registration)Case branch in the CallToolRequestSchema handler that dispatches to the listExecutions function.
case "n8n_list_executions": return listExecutions(args ?? {});