fix(core): Hide sub-workflow tool from agent tool selection (no-changelog) (#34336)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eugene 2026-07-16 14:59:45 +02:00 committed by GitHub
parent a871e2718f
commit ccbfe94a49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -1,8 +1,14 @@
import { AI_VENDOR_NODE_TYPES, CHAT_TOOL_NODE_TYPE } from 'n8n-workflow';
import {
AI_VENDOR_NODE_TYPES,
CHAT_TOOL_NODE_TYPE,
WORKFLOW_TOOL_LANGCHAIN_NODE_TYPE,
} from 'n8n-workflow';
export const AGENT_BUILDER_HIDDEN_AVAILABLE_TOOL_NODE_TYPES: readonly string[] = [
...AI_VENDOR_NODE_TYPES.map((nodeType) => `${nodeType}Tool`),
CHAT_TOOL_NODE_TYPE,
// Agents call workflows via native workflow tools, not the sub-workflow node
WORKFLOW_TOOL_LANGCHAIN_NODE_TYPE,
];
export const AGENT_BUILDER_AVAILABLE_AI_UTILITY_TOOL_NODE_TYPES = [

View File

@ -157,6 +157,10 @@ describe('AgentsToolsService', () => {
}
});
it('rejects the sub-workflow tool node', () => {
expect(isAgentToolNodeType('@n8n/n8n-nodes-langchain.toolWorkflow')).toBe(false);
});
it('allows shared AI utility tool node IDs', () => {
for (const nodeType of AGENT_BUILDER_AVAILABLE_AI_UTILITY_TOOL_NODE_TYPES) {
expect(isAgentToolNodeType(nodeType)).toBe(true);