Code
Node 22, no packages needed. Create an API key in n8n under Settings, API, then run the script with the execution id and the node name.
js
// Read one node's runs and errors from an n8n execution that is "too large to display".
// Usage: N8N_URL=YOUR_N8N_URL N8N_API_KEY=YOUR_API_KEY node read-node-error.mjs <executionId> ["Node name"]
import { createWriteStream } from "node:fs";
import { readFile } from "node:fs/promises";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";
const [id, nodeName] = process.argv.slice(2);
const base = (process.env.N8N_URL || "").replace(/\/+$/, "");
if (!id || !base || !process.env.N8N_API_KEY) throw new Error("Set N8N_URL, N8N_API_KEY and pass an execution id");
const url = `${base}/api/v1/executions/${encodeURIComponent(id)}?includeData=true&ignoreDataSizeLimit=true`;
const res = await fetch(url, { headers: { "X-N8N-API-KEY": process.env.N8N_API_KEY } });
if (!res.ok) {
const hint = res.status >= 502 ? " The proxy gave up on the full download; ask n8n support for this execution." : "";
throw new Error(`n8n API returned HTTP ${res.status}.${hint}`);
}
const file = `execution-${id}.json`; // keep a copy so you only download once
await pipeline(Readable.fromWeb(res.body), createWriteStream(file));
const exec = JSON.parse(await readFile(file, "utf8"));
if (exec.dataTooLargeToDisplay) throw new Error("Still too large: this n8n version ignores ignoreDataSizeLimit. Update n8n, or raise EXECUTIONS_DATA_MAX_DISPLAY_SIZE if you self-host.");
const runData = exec.data?.resultData?.runData ?? {};
const errorsOf = (run) => [
...(run.error ? [run.error] : []),
...(run.data?.main ?? []).flat().filter((item) => item?.json?.error).map((item) => item.json.error),
];
if (exec.data?.resultData?.error) console.log("Execution error:", exec.data.resultData.error.message);
if (!nodeName || !runData[nodeName]) {
if (nodeName) console.log(`No node named "${nodeName}" in this execution.`);
const failed = Object.entries(runData).filter(([, runs]) => runs.some((r) => errorsOf(r).length));
console.log("Nodes with errors:", failed.length ? failed.map(([name]) => name).join(", ") : "none");
process.exit(nodeName ? 1 : 0);
}
runData[nodeName].forEach((run, i) => {
const when = new Date(run.startTime).toISOString();
console.log(`Run ${i + 1}: ${when}, ${run.executionTime} ms, status ${run.executionStatus ?? "unknown"}`);
for (const err of errorsOf(run)) {
const msg = typeof err === "string" ? err : err.message;
console.log(" error:", msg, err.description ? `| ${err.description}` : "", err.httpCode ? `| HTTP ${err.httpCode}` : "");
}
});Why it happens
n8n has a size limit for showing execution data, set by EXECUTIONS_DATA_MAX_DISPLAY_SIZE (100 MB by default). Above it, n8n does not load the run data at all. The editor shows "too large to display" and the API returns an empty data with dataTooLargeToDisplay: true.
The data is still stored. Recent versions of the public API accept ignoreDataSizeLimit=true, which skips that limit for one request. The script uses it, writes the response to disk, and prints only the part you need.
Steps
- Set
N8N_URLto your instance address andN8N_API_KEYto the key. Keep the key in the environment, not in the file. - Run it with only the execution id first. It lists every node that has an error.
- Run it again with the node name. It prints each run: start time in UTC, duration in milliseconds, status, and every error.
- Errors come from two places.
run.erroris set when the node stopped the workflow. When the node is set to "Continue (using error output)", the error sits in an item on its error output instead, and the script reads those too. - The downloaded
execution-<id>.jsonstays in the folder, so you can search it again without another large request.
Pitfalls
- On an older n8n version the parameter is ignored and you get the same empty response. The script stops with a clear message in that case. Self-hosted users can raise
EXECUTIONS_DATA_MAX_DISPLAY_SIZEinstead. - A large download can time out at a proxy and come back as HTTP 502. If that happens on n8n Cloud, send the execution id and node name to n8n support.
- The saved error may only hold n8n's short message. For example, a 403 often appears as "Forbidden - perhaps check your credentials?". Look at
httpCodeanddescriptionfor more. - An Error Workflow only runs when the whole execution fails. With "Continue (using error output)" the run ends as a success, so send a small error record (node, item, message, time) from the error branch while the run is happening.
Seen on: n8n Community ·
Related service: n8n, Make and Zapier workflow automation