Start with one saved execution
An Agent can show an empty observation even when a tool node appears to have produced output. Before changing a production build, inspect what the saved execution actually contains.
This script follows the saved Agent action reference to the exact recorded tool run. It reports indexes, output item counts and whether an error is present. It leaves out node names, call IDs, inputs, returned values and error text.
It reads a local JSON file and makes no network request. It does not run a workflow, change n8n or require a Keptick account.
Run the local check
- Save one execution response from your authorised n8n public API, with
includeData=true. This script expectsdata.resultData.runDatain the saved object. A list response or an export with another structure will not work. - Find the exact Agent node name and tool-call ID locally. Keep the original export on your computer.
- Download the script, put it beside the JSON file, and run the command below with Node.js 22 or later. Replace both quoted placeholders with the values from that execution.
node n8n-saved-tool-reference.mjs execution.json "AI Agent" "call_REPLACE_LOCALLY"The output is a small JSON summary. The original execution file is not modified. Invalid JSON or an unsupported input shape returns a generic error and a nonzero exit status.
Read the result carefully
Fictional result: one saved action points to tool run index 1, which contains one item in its main output.
{
"matchedSavedReferences": 1,
"rows": [{
"agentRunIndex": 0,
"referenceIndex": 0,
"referencedToolRunIndex": 1,
"actionItemIndex": 0,
"referencedToolRunPresent": true,
"mainItemCounts": [1],
"aiToolItemCounts": null,
"errorPresent": false
}]
}- Indexes start at zero. Tool run index 1 means the second recorded run. The script does not substitute the first run.
- Null means unavailable. A missing output array or recorded item index stays
null; it is not inferred as zero. - Zero matched references means no matching saved reference was found. Metadata can retain only the latest tool batch. Missing history does not prove that n8n filtered or lost a response.
- Saved nonempty output is an after-execution snapshot. It does not establish what the Agent could read at the moment it built the observation.
- Error presence is only a flag. The script does not include error text or decide whether the business work succeeded.
Compare a failing and a passing call
Run the check once for a failing call and once for a passing call. Review the small summaries before sharing them with whoever is investigating. Include the n8n version and describe the symptom separately. The full export stays local.
A missing reference, missing tool run or missing item index is useful to report as unavailable. Do not replace it with an assumption. For a timing or filtering diagnosis, an investigation may still need a controlled reproduction or instrumentation at the actual read boundary.
The existing N8N_LOG_LEVEL=debug setting enables logging that n8n already implements. It is not a promise that these action and observation fields will appear in the logs.
Use monitoring for expected work
This diagnostic investigates a saved execution. For scheduled workflows, Keptick can separately store outcome receipts and flag missing runs or counts below a chosen threshold. It does not trace Agent internals or fix an empty observation.
If that is the problem you need to monitor, read the monitoring setup guide. The first monitor can stay free within its allowance. For batch coverage, the record-reconciliation workflow compares expected and completed IDs.
Scope, tests and source
Checked against the saved-reference paths in n8n 2.34.5. Ten synthetic function checks and two separate command-line smoke checks passed on the exact download. These checks do not reproduce a reporter workflow, prove the root cause or establish a fix. Other versions and export formats may differ.
- Original diagnostic and discussion ↗
The request for investigation without patching production, the proposed script and its limits.
- Exact tool node and run lookup in n8n 2.34.5 ↗
Immutable release source; recorded output and runtime observation are different evidence.
- n8n public API documentation ↗
Use your existing authorised access. Never put an API key or full execution export into a public comment.
Made by Keptick with AI assistance. Not affiliated with n8n. This website counts guide visits and download clicks; the downloaded script sends no data.
Check one call at a time.
Keep the original export local. Start with a failing call and a passing call, then review only the small summaries.