Skip to content

fix: load .node.ee.js enterprise nodes — restore Evaluation Trigger to the database#939

Merged
czlonkowski merged 1 commit into
mainfrom
fix/937-evaluation-trigger-loader
Jul 16, 2026
Merged

fix: load .node.ee.js enterprise nodes — restore Evaluation Trigger to the database#939
czlonkowski merged 1 commit into
mainfrom
fix/937-evaluation-trigger-loader

Conversation

@czlonkowski

Copy link
Copy Markdown
Owner

Fixes #937.

Problem

nodes-base.evaluationTrigger was missing from the bundled node database even though EvaluationTrigger.node.ee.js ships in n8n-nodes-base and is registered in its package.json. Agents could not discover or configure the Evaluation Trigger through search_nodes/get_node, and n8n_validate_workflow falsely rejected valid evaluation workflows with "Unknown node type: n8n-nodes-base.evaluationTrigger" — workflows a live n8n 2.30.6 instance accepts and runs.

Root cause

Two compounding defects in src/loaders/node-loader.ts:

  1. The node-name regex /\/([^\/]+)\.node\.(js|ts)$/ did not match n8n's enterprise .node.ee.js suffix, so the extracted node name was the garbage string EvaluationTrigger.node.ee.js and the named-export lookup missed.
  2. The export-resolution fallback took the module's first export (Object.values(nodeModule)[0]). EvaluationTrigger exports the numeric constant DEFAULT_STARTING_ROW before the class, so the "node class" passed downstream was the number 2; parsing threw and the node was dropped with only a build-log line. The sibling Evaluation.node.ee.js survived by luck — it has a single export.

Fix

  • The regex accepts an optional .ee segment: /\/([^\/]+)\.node(?:\.ee)?\.(js|ts)$/, so the class now resolves directly by name.
  • A shared resolveNodeClass helper (deduplicating the two manifest-format branches) only ever falls back to a function-typed export, so a leading constant can never be mistaken for a node class again.
  • nodes-base.evaluation and nodes-base.evaluationTrigger joined CANONICAL_CORE_NODES, so a future silent drop of either fails the rebuild loudly instead of shipping a broken database.
  • New fixture-based regression tests (tests/unit/loaders/node-loader-ee-nodes.test.ts) exercise the real loader against on-disk fixture packages mirroring the EvaluationTrigger export shape; all three failed before the fix.
  • Database rebuilt: 827 core nodes (677 n8n-nodes-base + 150 @n8n/n8n-nodes-langchain), community nodes preserved. README counts updated.

Verification

  • nodes-base.evaluationTrigger now in the DB with is_trigger=1, 14 properties, and mapped docs; FTS index finds it.
  • A minimal evaluationTrigger → evaluation workflow validates clean through WorkflowValidator (previously hard-errored).
  • Review sweep across all 561 installed node modules: every module resolves via default or the name-matched export, and old-vs-new fallback results are identical everywhere except the buggy case — no regression surface. These are the only two .ee.js entries in either package manifest.
  • Loader + core-node-check suites green (67 tests), full unit suite green, typecheck clean.

Conceived by Romuald Członkowski - www.aiadvisors.pl/en

🤖 Generated with Claude Code

…o the database (#937)

The loader's node-name regex only matched .node.js/.node.ts, so
EvaluationTrigger.node.ee.js produced a garbage node name, and the
export-resolution fallback took the module's first export — the numeric
constant DEFAULT_STARTING_ROW, not the node class — so parsing failed and
nodes-base.evaluationTrigger was silently dropped from every rebuild.
Agents could not discover it and validate_workflow falsely rejected valid
evaluation workflows with "Unknown node type".

- Accept an optional .ee segment in the node-name regex
- Resolve the node class only from function-typed exports (shared
  resolveNodeClass helper for both manifest formats)
- Add nodes-base.evaluation and nodes-base.evaluationTrigger to the
  canonical core-node completeness gate so a silent drop fails the build
- Add fixture-based regression tests exercising the real loader
- Rebuild the node database: 827 core nodes (677 n8n-nodes-base +
  150 @n8n/n8n-nodes-langchain)

Fixes #937

Conceived by Romuald Członkowski - www.aiadvisors.pl/en

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes node database rebuild so n8n enterprise node modules (*.node.ee.js) are correctly discovered and parsed, restoring nodes-base.evaluationTrigger so MCP node discovery and workflow validation no longer reject valid evaluation workflows.

Changes:

  • Update node loader to correctly extract node names from .node.ee.js paths and to avoid choosing non-class exports as the node class.
  • Add fixture-based regression tests covering .node.ee.js loading and “constant before class” export shapes.
  • Strengthen post-rebuild completeness gating by adding nodes-base.evaluation and nodes-base.evaluationTrigger to the canonical core-node list; bump version + update README/CHANGELOG counts.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/loaders/node-loader.test.ts Aligns mocked loader test logic with new .node.ee.js matching + safer export fallback.
tests/unit/loaders/node-loader-ee-nodes.test.ts Adds regression tests using on-disk fixture packages for enterprise node export shapes.
src/scripts/core-node-check.ts Adds evaluation + evaluationTrigger to canonical core-node completeness gate.
src/loaders/node-loader.ts Implements .node.ee.js node-name extraction and a shared resolveNodeClass helper.
README.md Updates total/core node counts after rebuild.
package.json Bumps package version to 2.65.1.
package-lock.json Updates lockfile version fields to 2.65.1.
CHANGELOG.md Documents the fix and rebuild result for 2.65.1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +136 to +142
private resolveNodeClass(nodeModule: any, nodeName: string): any {
return (
nodeModule.default ||
nodeModule[nodeName] ||
Object.values(nodeModule).find(exported => typeof exported === 'function')
);
}
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/loaders/node-loader.ts 75.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

Test Results Summary

📊 Artifacts


Generated at Thu, 16 Jul 2026 12:43:03 GMT
Commit: 46687c1
Run: #1320

@czlonkowski
czlonkowski merged commit 981f295 into main Jul 16, 2026
15 checks passed
@czlonkowski
czlonkowski deleted the fix/937-evaluation-trigger-loader branch July 16, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node DB missing nodes-base.evaluationTrigger (Evaluation Trigger)

2 participants