You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix: n8n_executions reads AI sub-node data and every run of a node (v2.80.1) (#1058)
* fix: n8n_executions never reads ai_* connection data for AI Agent sub-nodes
The execution processor (preview/summary/filtered/full/error modes)
only inspected run.data.main when extracting node input/output data.
Regular nodes connect via `main`, but LangChain AI Agent sub-nodes
(Chat Model, Output Parser, Tool, Memory, Embeddings, etc.) connect to
their parent Agent via special ai_* connection types instead
(ai_languageModel, ai_outputParser, ai_tool, ai_memory, ...). Their
task data lives at run.data.ai_languageModel etc., so every mode
silently returned itemsInput: 0, itemsOutput: 0, data.output: [] for
these nodes regardless of flags.
Also fixes includeInputData, which read a nonexistent `inputData`
field on the run - n8n actually stores this as `inputOverride`, keyed
by connection type the same way `data` is. This made includeInputData
a no-op for every node type, not only AI sub-nodes.
Both files now merge over every connection-type key present (main and
any ai_*) rather than hardcoding `main`, mirroring the same fix
pattern already used elsewhere in this repo for disconnected-node
detection (dynamic iteration over connection types instead of a fixed
list).
Verified against a live n8n Cloud execution with Chat Model, Output
Parser, Tool, and Memory sub-nodes: all four now report correct
itemsInput/itemsOutput/data across preview, summary, filtered, full,
and error modes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 6191e99)
* fix: execution processor only returned the first run's data per node
Node-level summary counts (itemsInput/itemsOutput) already summed
across every run of a node - countItems() correctly loops over the
whole runData array. But the code building the actual returned
data.output/data.input arrays only ever read nodeData[0], the first
run. A node invoked more than once within a single execution (most
commonly an AI Agent's Chat Model: once to decide to call a tool,
again to produce the final answer) has one runData entry per
invocation, so every invocation after the first was silently dropped
from the response while still being counted in the totals.
Concretely: itemsOutput: 2 but data.output containing only 1 item -
and it was always the first, least useful one (the short
"I'll call a tool" turn), never the second (the actual answer,
sometimes truncated by a max_tokens ceiling).
Both execution-processor.ts and error-execution-processor.ts had this
pattern in multiple places (data extraction, item counts for preview/
execution-path, and error detection). Fixed by merging across every
run of a node - by branch/port index, in run order - instead of
reading index 0, so itemsLimit truncation now behaves as "first N
items across all invocations" rather than "first N items of the first
invocation only". Error detection was extended the same way: an error
on a later run (not just the first) is no longer invisible.
Verified against a live n8n Cloud execution with a multi-turn Chat
Model: the previously-hidden second generation (truncated at
finish_reason: length, 800 completion tokens) now returns correctly
across full/summary/filtered modes. Also surfaced a genuine,
previously-invisible error on a middle run of an Output Parser node
that error mode had never reported before this fix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit d227b54)
* fix: merge execution run data by connection type and bound inputs
Follow-ups on #965 after review:
- share the runData helpers between the two processors (src/services/execution-run-data.ts)
- merge branches keyed by connection type and port, so runs that populate different
types (main, ai_tool) no longer collapse into one index; null ports stay null
- append with a loop instead of push(...items): a 150k-item branch overflowed the call stack
- merge only up to the item limit in summary/filtered mode; totals come from the counts
- apply the item limit to inputs too and report inputMetadata, since AI sub-nodes carry
whole prompts in inputOverride
- preview reports the last failing run's error like the other modes; executionTime is the
sum across runs
Conceived by Romuald Członkowski - www.aiadvisors.pl/en
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmLW2QcubiwyuemrLs62d
* chore: release 2.80.1
Conceived by Romuald Członkowski - www.aiadvisors.pl/en
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmLW2QcubiwyuemrLs62d
---------
Co-authored-by: JohanDuque <johand.duque@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
## [2.80.1] - 2026-09-03
11
+
12
+
### Fixed
13
+
14
+
- **`n8n_executions` now returns the data of AI Agent sub-nodes and of every run of a node** ([#965](https://github.com/czlonkowski/n8n-mcp/pull/965)). The execution processors read only `runData[node][0].data.main`, so a Chat Model, Tool, Memory or Output Parser node, whose task data lives under `ai_*` connection types, showed no items, and a node invoked more than once in an execution (an agent's model, called once per tool round) lost every run after the first. Items are now merged across runs, keyed by connection type and output port, so a node whose runs populate different types keeps them apart, and a port n8n recorded as `null` stays `null`. The last failing run's error is reported in every mode, `executionTime` is the sum across runs, and `preview` mode reads the first item without merging. In `summary` and `filtered` modes only as many items as the limit are merged, and inputs (`includeInputData`), which for AI sub-nodes carry whole prompts, are truncated with the same limit and described by a new `inputMetadata` field. The error processor reads the same helpers, so `error` mode's upstream context and execution path include AI sub-nodes too.
nodeNames: {type: 'array',required: false,description: 'For action=get with mode=filtered: Filter to specific nodes by name'},
43
-
itemsLimit: {type: 'number',required: false,description: 'For action=get with mode=filtered: Items per node (0=structure, 2=default, -1=unlimited)'},
43
+
itemsLimit: {type: 'number',required: false,description: 'For action=get with mode=summary or filtered: Items per node (0=structure, 2=default, -1=unlimited); applies to input data too when includeInputData is set'},
44
44
includeInputData: {type: 'boolean',required: false,description: 'For action=get: Include input data in addition to output (default: false)'},
45
45
errorItemsLimit: {type: 'number',required: false,description: 'For action=get with mode=error: Sample items from upstream (default: 2, max: 100)'},
46
46
includeStackTrace: {type: 'boolean',required: false,description: 'For action=get with mode=error: Include full stack trace (default: false, shows truncated)'},
0 commit comments