AI node SDK added as CLI dependency
Community nodes relying on @n8n/ai-node-sdk can now load correctly after the SDK was added as a dependency to the CLI package.
Community nodes built on n8n's AI SDK—packages like @basetenlabs/n8n-nodes-baseten—were failing to load with a cryptic "Cannot find module '@n8n/ai-node-sdk'" error. The root cause was straightforward: the SDK existed in the monorepo and was allowlisted for community imports, but it wasn't installed as a dependency of the CLI package where node loading happens.
When the initialization process sets NODE_PATH to include the CLI's module paths, the SDK simply wasn't there to find. The fix adds @n8n/ai-node-sdk to packages/cli/package.json, mirroring how @n8n/ai-utilities was already listed. Node authors building on the AI SDK no longer need workarounds to get their community nodes recognized.
A parallel change renames an API query parameter from maxAiNodeSdkVersion to maxAiNodeSdk. This serves as a compatibility gate: older n8n versions sending the old param name get zero AI nodes from the server, avoiding broken installs, while current versions receive the full catalog.
View Original GitHub Description
Summary
Community nodes that depend on @n8n/ai-node-sdk (e.g. @basetenlabs/n8n-nodes-baseten) fail to load with Cannot find module '@n8n/ai-node-sdk'.
Root cause: @n8n/ai-node-sdk exists in the monorepo and is allowlisted for community node imports, but it was not listed as a dependency of packages/cli. When LoadNodesAndCredentials.init() sets NODE_PATH to packages/cli's module paths, the SDK is absent from the resolution tree.
Fix:
- Added
@n8n/ai-node-sdkas a runtime dependency ofpackages/cli(mirrors how@n8n/ai-utilitiesis already listed). - Renamed the
maxAiNodeSdkVersionquery param tomaxAiNodeSdkin the Strapi community-nodes API calls. This acts as a compatibility gate: older n8n versions (without the SDK fix) send the old param name, which the server ignores, so they receive zero AI nodes and avoid broken installs.
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-4746
Review / Merge checklist
- PR title and summary are descriptive. (conventions)
- Docs updated or follow-up ticket created.
- Tests included.
- PR Labeled with
release/backport(if the PR is an urgent fix that needs to be backported)
Made with Cursor