@n8n/n8n-nodes-langchain 1.92.2 → 1.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js +5 -22
  2. package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js.map +1 -1
  3. package/dist/credentials/AzureOpenAiApi.credentials.js +1 -1
  4. package/dist/credentials/AzureOpenAiApi.credentials.js.map +1 -1
  5. package/dist/credentials/XAiApi.credentials.js +1 -1
  6. package/dist/credentials/XAiApi.credentials.js.map +1 -1
  7. package/dist/known/nodes.json +4 -0
  8. package/dist/nodes/ToolExecutor/ToolExecutor.node.js +105 -0
  9. package/dist/nodes/ToolExecutor/ToolExecutor.node.js.map +1 -0
  10. package/dist/nodes/ToolExecutor/ToolExecutor.node.json +17 -0
  11. package/dist/nodes/ToolExecutor/utils/convertToSchema.js +64 -0
  12. package/dist/nodes/ToolExecutor/utils/convertToSchema.js.map +1 -0
  13. package/dist/nodes/ToolExecutor/utils/executeTool.js +39 -0
  14. package/dist/nodes/ToolExecutor/utils/executeTool.js.map +1 -0
  15. package/dist/nodes/agents/Agent/Agent.node.js +19 -394
  16. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
  17. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +427 -0
  18. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -0
  19. package/dist/nodes/agents/Agent/V2/AgentV2.node.js +162 -0
  20. package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -0
  21. package/dist/nodes/agents/Agent/agents/ToolsAgent/{description.js → V1/description.js} +2 -34
  22. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/description.js.map +1 -0
  23. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js +119 -0
  24. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js.map +1 -0
  25. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +40 -0
  26. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -0
  27. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +139 -0
  28. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -0
  29. package/dist/nodes/agents/Agent/agents/ToolsAgent/{execute.js → common.js} +7 -97
  30. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -0
  31. package/dist/nodes/agents/Agent/agents/ToolsAgent/options.js +62 -0
  32. package/dist/nodes/agents/Agent/agents/ToolsAgent/options.js.map +1 -0
  33. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +69 -51
  34. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
  35. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +8 -0
  36. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -1
  37. package/dist/nodes/chains/ChainLLM/methods/config.js +5 -0
  38. package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -1
  39. package/dist/nodes/chains/ChainLLM/methods/processItem.js +66 -0
  40. package/dist/nodes/chains/ChainLLM/methods/processItem.js.map +1 -0
  41. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +71 -95
  42. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
  43. package/dist/nodes/chains/ChainRetrievalQA/constants.js +49 -0
  44. package/dist/nodes/chains/ChainRetrievalQA/constants.js.map +1 -0
  45. package/dist/nodes/chains/ChainRetrievalQA/processItem.js +91 -0
  46. package/dist/nodes/chains/ChainRetrievalQA/processItem.js.map +1 -0
  47. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js +3 -2
  48. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js.map +1 -1
  49. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +55 -78
  50. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -1
  51. package/dist/nodes/chains/ChainSummarization/V2/processItem.js +95 -0
  52. package/dist/nodes/chains/ChainSummarization/V2/processItem.js.map +1 -0
  53. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js +56 -33
  54. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js.map +1 -1
  55. package/dist/nodes/chains/InformationExtractor/constants.js +31 -0
  56. package/dist/nodes/chains/InformationExtractor/constants.js.map +1 -0
  57. package/dist/nodes/chains/InformationExtractor/processItem.js +50 -0
  58. package/dist/nodes/chains/InformationExtractor/processItem.js.map +1 -0
  59. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +198 -71
  60. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -1
  61. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +83 -54
  62. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -1
  63. package/dist/nodes/chains/TextClassifier/constants.js +29 -0
  64. package/dist/nodes/chains/TextClassifier/constants.js.map +1 -0
  65. package/dist/nodes/chains/TextClassifier/processItem.js +65 -0
  66. package/dist/nodes/chains/TextClassifier/processItem.js.map +1 -0
  67. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +5 -1
  68. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
  69. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +4 -1
  70. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -1
  71. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +6 -1
  72. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
  73. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +4 -1
  74. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -1
  75. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +4 -0
  76. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -1
  77. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +4 -0
  78. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
  79. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/N8nOAuth2TokenCredential.js +16 -2
  80. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/N8nOAuth2TokenCredential.js.map +1 -1
  81. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +3 -1
  82. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -1
  83. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +2 -0
  84. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -1
  85. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +3 -1
  86. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -1
  87. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +3 -1
  88. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js.map +1 -1
  89. package/dist/nodes/mcp/McpClientTool/loadOptions.js +2 -1
  90. package/dist/nodes/mcp/McpClientTool/loadOptions.js.map +1 -1
  91. package/dist/nodes/mcp/McpTrigger/McpServer.js +72 -48
  92. package/dist/nodes/mcp/McpTrigger/McpServer.js.map +1 -1
  93. package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js +2 -2
  94. package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js.map +1 -1
  95. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +1 -0
  96. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -1
  97. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +2 -1
  98. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
  99. package/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-white.svg +1 -1
  100. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js +6 -1
  101. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +1 -1
  102. package/dist/types/credentials.json +3 -3
  103. package/dist/types/nodes.json +13 -11
  104. package/dist/utils/helpers.js +1 -1
  105. package/dist/utils/helpers.js.map +1 -1
  106. package/dist/utils/httpProxyAgent.js +33 -0
  107. package/dist/utils/httpProxyAgent.js.map +1 -0
  108. package/dist/utils/sharedFields.js +29 -0
  109. package/dist/utils/sharedFields.js.map +1 -1
  110. package/package.json +13 -11
  111. package/dist/nodes/agents/Agent/agents/ToolsAgent/description.js.map +0 -1
  112. package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js.map +0 -1
@@ -48,7 +48,7 @@ class AzureEntraCognitiveServicesOAuth2Api {
48
48
  name: "apiVersion",
49
49
  type: "string",
50
50
  required: true,
51
- default: "2024-12-01-preview"
51
+ default: "2025-03-01-preview"
52
52
  },
53
53
  {
54
54
  displayName: "Endpoint",
@@ -68,31 +68,14 @@ class AzureEntraCognitiveServicesOAuth2Api {
68
68
  {
69
69
  displayName: "Authorization URL",
70
70
  name: "authUrl",
71
- type: "string",
72
- default: "https://login.microsoftonline.com/$TENANT_ID/oauth2/authorize"
71
+ type: "hidden",
72
+ default: '=https://login.microsoftonline.com/{{$self["tenantId"]}}/oauth2/authorize'
73
73
  },
74
74
  {
75
75
  displayName: "Access Token URL",
76
76
  name: "accessTokenUrl",
77
- type: "string",
78
- default: "https://login.microsoftonline.com/$TENANT_ID/oauth2/token"
79
- },
80
- {
81
- displayName: "Client ID",
82
- name: "clientId",
83
- type: "string",
84
- required: true,
85
- default: "",
86
- description: "Client ID obtained from the Azure AD App Registration"
87
- },
88
- {
89
- displayName: "Client Secret",
90
- name: "clientSecret",
91
- type: "string",
92
- required: true,
93
- typeOptions: { password: true },
94
- default: "",
95
- description: "Client Secret obtained from the Azure AD App Registration"
77
+ type: "hidden",
78
+ default: '=https://login.microsoftonline.com/{{$self["tenantId"]}}/oauth2/token'
96
79
  },
97
80
  {
98
81
  displayName: "Additional Body Properties",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.ts"],"sourcesContent":["import type { ICredentialType, INodeProperties } from 'n8n-workflow';\n\nconst defaultScopes = ['openid', 'offline_access'];\n\nexport class AzureEntraCognitiveServicesOAuth2Api implements ICredentialType {\n\tname = 'azureEntraCognitiveServicesOAuth2Api';\n\n\t// eslint-disable-next-line n8n-nodes-base/cred-class-field-display-name-missing-oauth2\n\tdisplayName = 'Azure Entra ID (Azure Active Directory) API';\n\n\textends = ['oAuth2Api'];\n\n\tdocumentationUrl = 'azureEntraCognitiveServicesOAuth2Api';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Grant Type',\n\t\t\tname: 'grantType',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'authorizationCode',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Resource Name',\n\t\t\tname: 'resourceName',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'API Version',\n\t\t\tname: 'apiVersion',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '2024-12-01-preview',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Endpoint',\n\t\t\tname: 'endpoint',\n\t\t\ttype: 'string',\n\t\t\tdefault: undefined,\n\t\t\tplaceholder: 'https://westeurope.api.cognitive.microsoft.com',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Tenant ID',\n\t\t\tname: 'tenantId',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'common',\n\t\t\tdescription:\n\t\t\t\t'Enter your Azure Tenant ID (Directory ID) or keep \"common\" for multi-tenant apps. Using a specific Tenant ID is generally recommended and required for certain authentication flows.',\n\t\t\tplaceholder: 'e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authorization URL',\n\t\t\tname: 'authUrl',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'https://login.microsoftonline.com/$TENANT_ID/oauth2/authorize',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Access Token URL',\n\t\t\tname: 'accessTokenUrl',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'https://login.microsoftonline.com/$TENANT_ID/oauth2/token',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Client ID',\n\t\t\tname: 'clientId',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t\tdescription: 'Client ID obtained from the Azure AD App Registration',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Client Secret',\n\t\t\tname: 'clientSecret',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\ttypeOptions: { password: true },\n\t\t\tdefault: '',\n\t\t\tdescription: 'Client Secret obtained from the Azure AD App Registration',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Additional Body Properties',\n\t\t\tname: 'additionalBodyProperties',\n\t\t\ttype: 'hidden',\n\t\t\tdefault:\n\t\t\t\t'{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: 'authentication',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'body',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Custom Scopes',\n\t\t\tname: 'customScopes',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription:\n\t\t\t\t'Define custom scopes. You might need this if the default scopes are not sufficient or if you want to minimize permissions. Ensure you include \"openid\" and \"offline_access\".',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Auth URI Query Parameters',\n\t\t\tname: 'authQueryParameters',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '',\n\t\t\tdescription:\n\t\t\t\t'For some services additional query parameters have to be set which can be defined here',\n\t\t\tplaceholder: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Enabled Scopes',\n\t\t\tname: 'enabledScopes',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tcustomScopes: [true],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefault: defaultScopes.join(' '),\n\t\t\tplaceholder: 'openid offline_access',\n\t\t\tdescription: 'Space-separated list of scopes to request.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Scope',\n\t\t\tname: 'scope',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '={{ $self.customScopes ? $self.enabledScopes : \"' + defaultScopes.join(' ') + '\"}}',\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,gBAAgB,CAAC,UAAU,gBAAgB;AAE1C,MAAM,qCAAgE;AAAA,EAAtE;AACN,gBAAO;AAGP;AAAA,uBAAc;AAEd,mBAAU,CAAC,WAAW;AAEtB,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,aAAa,EAAE,UAAU,KAAK;AAAA,QAC9B,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,gBAAgB;AAAA,UACf,MAAM;AAAA,YACL,cAAc,CAAC,IAAI;AAAA,UACpB;AAAA,QACD;AAAA,QACA,SAAS,cAAc,KAAK,GAAG;AAAA,QAC/B,aAAa;AAAA,QACb,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS,qDAAqD,cAAc,KAAK,GAAG,IAAI;AAAA,MACzF;AAAA,IACD;AAAA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.ts"],"sourcesContent":["import type { ICredentialType, INodeProperties } from 'n8n-workflow';\n\nconst defaultScopes = ['openid', 'offline_access'];\n\nexport class AzureEntraCognitiveServicesOAuth2Api implements ICredentialType {\n\tname = 'azureEntraCognitiveServicesOAuth2Api';\n\n\t// eslint-disable-next-line n8n-nodes-base/cred-class-field-display-name-missing-oauth2\n\tdisplayName = 'Azure Entra ID (Azure Active Directory) API';\n\n\textends = ['oAuth2Api'];\n\n\tdocumentationUrl = 'azureEntraCognitiveServicesOAuth2Api';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Grant Type',\n\t\t\tname: 'grantType',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'authorizationCode',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Resource Name',\n\t\t\tname: 'resourceName',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'API Version',\n\t\t\tname: 'apiVersion',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '2025-03-01-preview',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Endpoint',\n\t\t\tname: 'endpoint',\n\t\t\ttype: 'string',\n\t\t\tdefault: undefined,\n\t\t\tplaceholder: 'https://westeurope.api.cognitive.microsoft.com',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Tenant ID',\n\t\t\tname: 'tenantId',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'common',\n\t\t\tdescription:\n\t\t\t\t'Enter your Azure Tenant ID (Directory ID) or keep \"common\" for multi-tenant apps. Using a specific Tenant ID is generally recommended and required for certain authentication flows.',\n\t\t\tplaceholder: 'e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authorization URL',\n\t\t\tname: 'authUrl',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/authorize',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Access Token URL',\n\t\t\tname: 'accessTokenUrl',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/token',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Additional Body Properties',\n\t\t\tname: 'additionalBodyProperties',\n\t\t\ttype: 'hidden',\n\t\t\tdefault:\n\t\t\t\t'{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: 'authentication',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'body',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Custom Scopes',\n\t\t\tname: 'customScopes',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription:\n\t\t\t\t'Define custom scopes. You might need this if the default scopes are not sufficient or if you want to minimize permissions. Ensure you include \"openid\" and \"offline_access\".',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Auth URI Query Parameters',\n\t\t\tname: 'authQueryParameters',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '',\n\t\t\tdescription:\n\t\t\t\t'For some services additional query parameters have to be set which can be defined here',\n\t\t\tplaceholder: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Enabled Scopes',\n\t\t\tname: 'enabledScopes',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tcustomScopes: [true],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefault: defaultScopes.join(' '),\n\t\t\tplaceholder: 'openid offline_access',\n\t\t\tdescription: 'Space-separated list of scopes to request.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Scope',\n\t\t\tname: 'scope',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '={{ $self.customScopes ? $self.enabledScopes : \"' + defaultScopes.join(' ') + '\"}}',\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,gBAAgB,CAAC,UAAU,gBAAgB;AAE1C,MAAM,qCAAgE;AAAA,EAAtE;AACN,gBAAO;AAGP;AAAA,uBAAc;AAEd,mBAAU,CAAC,WAAW;AAEtB,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,gBAAgB;AAAA,UACf,MAAM;AAAA,YACL,cAAc,CAAC,IAAI;AAAA,UACpB;AAAA,QACD;AAAA,QACA,SAAS,cAAc,KAAK,GAAG;AAAA,QAC/B,aAAa;AAAA,QACb,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS,qDAAqD,cAAc,KAAK,GAAG,IAAI;AAAA,MACzF;AAAA,IACD;AAAA;AACD;","names":[]}
@@ -47,7 +47,7 @@ class AzureOpenAiApi {
47
47
  name: "apiVersion",
48
48
  type: "string",
49
49
  required: true,
50
- default: "2023-07-01-preview"
50
+ default: "2025-03-01-preview"
51
51
  },
52
52
  {
53
53
  displayName: "Endpoint",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../credentials/AzureOpenAiApi.credentials.ts"],"sourcesContent":["import type { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';\n\nexport class AzureOpenAiApi implements ICredentialType {\n\tname = 'azureOpenAiApi';\n\n\tdisplayName = 'Azure Open AI';\n\n\tdocumentationUrl = 'azureopenai';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'API Key',\n\t\t\tname: 'apiKey',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: { password: true },\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Resource Name',\n\t\t\tname: 'resourceName',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'API Version',\n\t\t\tname: 'apiVersion',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '2023-07-01-preview',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Endpoint',\n\t\t\tname: 'endpoint',\n\t\t\ttype: 'string',\n\t\t\tdefault: undefined,\n\t\t\tplaceholder: 'https://westeurope.api.cognitive.microsoft.com',\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\t'api-key': '={{$credentials.apiKey}}',\n\t\t\t},\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,eAA0C;AAAA,EAAhD;AACN,gBAAO;AAEP,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,aAAa,EAAE,UAAU,KAAK;AAAA,QAC9B,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,IACD;AAEA,wBAAqC;AAAA,MACpC,MAAM;AAAA,MACN,YAAY;AAAA,QACX,SAAS;AAAA,UACR,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACD;AAAA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../credentials/AzureOpenAiApi.credentials.ts"],"sourcesContent":["import type { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';\n\nexport class AzureOpenAiApi implements ICredentialType {\n\tname = 'azureOpenAiApi';\n\n\tdisplayName = 'Azure Open AI';\n\n\tdocumentationUrl = 'azureopenai';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'API Key',\n\t\t\tname: 'apiKey',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: { password: true },\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Resource Name',\n\t\t\tname: 'resourceName',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'API Version',\n\t\t\tname: 'apiVersion',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '2025-03-01-preview',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Endpoint',\n\t\t\tname: 'endpoint',\n\t\t\ttype: 'string',\n\t\t\tdefault: undefined,\n\t\t\tplaceholder: 'https://westeurope.api.cognitive.microsoft.com',\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\t'api-key': '={{$credentials.apiKey}}',\n\t\t\t},\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,eAA0C;AAAA,EAAhD;AACN,gBAAO;AAEP,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,aAAa,EAAE,UAAU,KAAK;AAAA,QAC9B,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,IACD;AAEA,wBAAqC;AAAA,MACpC,MAAM;AAAA,MACN,YAAY;AAAA,QACX,SAAS;AAAA,UACR,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACD;AAAA;AACD;","names":[]}
@@ -25,7 +25,7 @@ class XAiApi {
25
25
  constructor() {
26
26
  this.name = "xAiApi";
27
27
  this.displayName = "xAi";
28
- this.documentationUrl = "xAi";
28
+ this.documentationUrl = "xai";
29
29
  this.properties = [
30
30
  {
31
31
  displayName: "API Key",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../credentials/XAiApi.credentials.ts"],"sourcesContent":["import type {\n\tIAuthenticateGeneric,\n\tICredentialTestRequest,\n\tICredentialType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nexport class XAiApi implements ICredentialType {\n\tname = 'xAiApi';\n\n\tdisplayName = 'xAi';\n\n\tdocumentationUrl = 'xAi';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'API Key',\n\t\t\tname: 'apiKey',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: { password: true },\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Base URL',\n\t\t\tname: 'url',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'https://api.x.ai/v1',\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\tAuthorization: '=Bearer {{$credentials.apiKey}}',\n\t\t\t},\n\t\t},\n\t};\n\n\ttest: ICredentialTestRequest = {\n\t\trequest: {\n\t\t\tbaseURL: '={{ $credentials.url }}',\n\t\t\turl: '/models',\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,MAAM,OAAkC;AAAA,EAAxC;AACN,gBAAO;AAEP,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,aAAa,EAAE,UAAU,KAAK;AAAA,QAC9B,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,IACD;AAEA,wBAAqC;AAAA,MACpC,MAAM;AAAA,MACN,YAAY;AAAA,QACX,SAAS;AAAA,UACR,eAAe;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAEA,gBAA+B;AAAA,MAC9B,SAAS;AAAA,QACR,SAAS;AAAA,QACT,KAAK;AAAA,MACN;AAAA,IACD;AAAA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../credentials/XAiApi.credentials.ts"],"sourcesContent":["import type {\n\tIAuthenticateGeneric,\n\tICredentialTestRequest,\n\tICredentialType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nexport class XAiApi implements ICredentialType {\n\tname = 'xAiApi';\n\n\tdisplayName = 'xAi';\n\n\tdocumentationUrl = 'xai';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'API Key',\n\t\t\tname: 'apiKey',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: { password: true },\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Base URL',\n\t\t\tname: 'url',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'https://api.x.ai/v1',\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\tAuthorization: '=Bearer {{$credentials.apiKey}}',\n\t\t\t},\n\t\t},\n\t};\n\n\ttest: ICredentialTestRequest = {\n\t\trequest: {\n\t\t\tbaseURL: '={{ $credentials.url }}',\n\t\t\turl: '/models',\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,MAAM,OAAkC;AAAA,EAAxC;AACN,gBAAO;AAEP,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,aAAa,EAAE,UAAU,KAAK;AAAA,QAC9B,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,IACD;AAEA,wBAAqC;AAAA,MACpC,MAAM;AAAA,MACN,YAAY;AAAA,QACX,SAAS;AAAA,UACR,eAAe;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAEA,gBAA+B;AAAA,MAC9B,SAAS;AAAA,QACR,SAAS;AAAA,QACT,KAAK;AAAA,MACN;AAAA,IACD;AAAA;AACD;","names":[]}
@@ -350,5 +350,9 @@
350
350
  "vectorStoreZepLoad": {
351
351
  "className": "VectorStoreZepLoad",
352
352
  "sourcePath": "dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js"
353
+ },
354
+ "toolExecutor": {
355
+ "className": "ToolExecutor",
356
+ "sourcePath": "dist/nodes/ToolExecutor/ToolExecutor.node.js"
353
357
  }
354
358
  }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var ToolExecutor_node_exports = {};
20
+ __export(ToolExecutor_node_exports, {
21
+ ToolExecutor: () => ToolExecutor
22
+ });
23
+ module.exports = __toCommonJS(ToolExecutor_node_exports);
24
+ var import_tools = require("@langchain/core/tools");
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_executeTool = require("./utils/executeTool");
27
+ class ToolExecutor {
28
+ constructor() {
29
+ this.description = {
30
+ displayName: "Tool Executor",
31
+ name: "toolExecutor",
32
+ version: 1,
33
+ defaults: {
34
+ name: "Tool Executor"
35
+ },
36
+ hidden: true,
37
+ inputs: [import_n8n_workflow.NodeConnectionTypes.Main, import_n8n_workflow.NodeConnectionTypes.AiTool],
38
+ outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
39
+ properties: [
40
+ {
41
+ displayName: "Query",
42
+ name: "query",
43
+ type: "json",
44
+ default: "{}",
45
+ description: "Parameters to pass to the tool as JSON or string"
46
+ },
47
+ {
48
+ displayName: "Tool Name",
49
+ name: "toolName",
50
+ type: "string",
51
+ default: "",
52
+ description: "Name of the tool to execute if the connected tool is a toolkit"
53
+ }
54
+ ],
55
+ group: ["transform"],
56
+ description: "Node to execute tools without an AI Agent"
57
+ };
58
+ }
59
+ async execute() {
60
+ const query = this.getNodeParameter("query", 0, {});
61
+ const toolName = this.getNodeParameter("toolName", 0, "");
62
+ let parsedQuery;
63
+ try {
64
+ parsedQuery = typeof query === "string" ? JSON.parse(query) : query;
65
+ } catch (error) {
66
+ parsedQuery = query;
67
+ }
68
+ const resultData = [];
69
+ const toolInputs = await this.getInputConnectionData(import_n8n_workflow.NodeConnectionTypes.AiTool, 0);
70
+ if (!toolInputs || !Array.isArray(toolInputs)) {
71
+ throw new import_n8n_workflow.NodeOperationError(this.getNode(), "No tool inputs found");
72
+ }
73
+ try {
74
+ for (const tool of toolInputs) {
75
+ if (tool && typeof tool.getTools === "function") {
76
+ const toolsInToolkit = tool.getTools();
77
+ for (const toolkitTool of toolsInToolkit) {
78
+ if (toolkitTool instanceof import_tools.Tool || toolkitTool instanceof import_tools.StructuredTool) {
79
+ if (toolName === toolkitTool.name) {
80
+ const result = await (0, import_executeTool.executeTool)(toolkitTool, parsedQuery);
81
+ resultData.push(result);
82
+ }
83
+ }
84
+ }
85
+ } else {
86
+ if (!toolName || toolName === tool.name) {
87
+ const result = await (0, import_executeTool.executeTool)(tool, parsedQuery);
88
+ resultData.push(result);
89
+ }
90
+ }
91
+ }
92
+ } catch (error) {
93
+ throw new import_n8n_workflow.NodeOperationError(
94
+ this.getNode(),
95
+ `Error executing tool: ${error.message}`
96
+ );
97
+ }
98
+ return [resultData];
99
+ }
100
+ }
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ ToolExecutor
104
+ });
105
+ //# sourceMappingURL=ToolExecutor.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/ToolExecutor/ToolExecutor.node.ts"],"sourcesContent":["import { Tool, StructuredTool } from '@langchain/core/tools';\nimport type { Toolkit } from 'langchain/agents';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\n\nimport { executeTool } from './utils/executeTool';\n\nexport class ToolExecutor implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Tool Executor',\n\t\tname: 'toolExecutor',\n\t\tversion: 1,\n\t\tdefaults: {\n\t\t\tname: 'Tool Executor',\n\t\t},\n\t\thidden: true,\n\t\tinputs: [NodeConnectionTypes.Main, NodeConnectionTypes.AiTool],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Query',\n\t\t\t\tname: 'query',\n\t\t\t\ttype: 'json',\n\t\t\t\tdefault: '{}',\n\t\t\t\tdescription: 'Parameters to pass to the tool as JSON or string',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Tool Name',\n\t\t\t\tname: 'toolName',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Name of the tool to execute if the connected tool is a toolkit',\n\t\t\t},\n\t\t],\n\t\tgroup: ['transform'],\n\t\tdescription: 'Node to execute tools without an AI Agent',\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst query = this.getNodeParameter('query', 0, {}) as string | object;\n\t\tconst toolName = this.getNodeParameter('toolName', 0, '') as string;\n\n\t\tlet parsedQuery: string | object;\n\n\t\ttry {\n\t\t\tparsedQuery = typeof query === 'string' ? JSON.parse(query) : query;\n\t\t} catch (error) {\n\t\t\tparsedQuery = query;\n\t\t}\n\n\t\tconst resultData: INodeExecutionData[] = [];\n\t\tconst toolInputs = await this.getInputConnectionData(NodeConnectionTypes.AiTool, 0);\n\n\t\tif (!toolInputs || !Array.isArray(toolInputs)) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'No tool inputs found');\n\t\t}\n\n\t\ttry {\n\t\t\tfor (const tool of toolInputs) {\n\t\t\t\t// Handle toolkits\n\t\t\t\tif (tool && typeof (tool as Toolkit).getTools === 'function') {\n\t\t\t\t\tconst toolsInToolkit = (tool as Toolkit).getTools();\n\t\t\t\t\tfor (const toolkitTool of toolsInToolkit) {\n\t\t\t\t\t\tif (toolkitTool instanceof Tool || toolkitTool instanceof StructuredTool) {\n\t\t\t\t\t\t\tif (toolName === toolkitTool.name) {\n\t\t\t\t\t\t\t\tconst result = await executeTool(toolkitTool, parsedQuery);\n\t\t\t\t\t\t\t\tresultData.push(result);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Handle single tool\n\t\t\t\t\tif (!toolName || toolName === (tool as Tool).name) {\n\t\t\t\t\t\tconst result = await executeTool(tool as Tool, parsedQuery);\n\t\t\t\t\t\tresultData.push(result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`Error executing tool: ${(error as Error).message}`,\n\t\t\t);\n\t\t}\n\t\treturn [resultData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAQrC,0BAAwD;AAExD,yBAA4B;AAErB,MAAM,aAAkC;AAAA,EAAxC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,QAAQ;AAAA,MACR,QAAQ,CAAC,wCAAoB,MAAM,wCAAoB,MAAM;AAAA,MAC7D,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,MACD;AAAA,MACA,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,IACd;AAAA;AAAA,EAEA,MAAM,UAAkE;AACvE,UAAM,QAAQ,KAAK,iBAAiB,SAAS,GAAG,CAAC,CAAC;AAClD,UAAM,WAAW,KAAK,iBAAiB,YAAY,GAAG,EAAE;AAExD,QAAI;AAEJ,QAAI;AACH,oBAAc,OAAO,UAAU,WAAW,KAAK,MAAM,KAAK,IAAI;AAAA,IAC/D,SAAS,OAAO;AACf,oBAAc;AAAA,IACf;AAEA,UAAM,aAAmC,CAAC;AAC1C,UAAM,aAAa,MAAM,KAAK,uBAAuB,wCAAoB,QAAQ,CAAC;AAElF,QAAI,CAAC,cAAc,CAAC,MAAM,QAAQ,UAAU,GAAG;AAC9C,YAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,sBAAsB;AAAA,IACpE;AAEA,QAAI;AACH,iBAAW,QAAQ,YAAY;AAE9B,YAAI,QAAQ,OAAQ,KAAiB,aAAa,YAAY;AAC7D,gBAAM,iBAAkB,KAAiB,SAAS;AAClD,qBAAW,eAAe,gBAAgB;AACzC,gBAAI,uBAAuB,qBAAQ,uBAAuB,6BAAgB;AACzE,kBAAI,aAAa,YAAY,MAAM;AAClC,sBAAM,SAAS,UAAM,gCAAY,aAAa,WAAW;AACzD,2BAAW,KAAK,MAAM;AAAA,cACvB;AAAA,YACD;AAAA,UACD;AAAA,QACD,OAAO;AAEN,cAAI,CAAC,YAAY,aAAc,KAAc,MAAM;AAClD,kBAAM,SAAS,UAAM,gCAAY,MAAc,WAAW;AAC1D,uBAAW,KAAK,MAAM;AAAA,UACvB;AAAA,QACD;AAAA,MACD;AAAA,IACD,SAAS,OAAO;AACf,YAAM,IAAI;AAAA,QACT,KAAK,QAAQ;AAAA,QACb,yBAA0B,MAAgB,OAAO;AAAA,MAClD;AAAA,IACD;AACA,WAAO,CAAC,UAAU;AAAA,EACnB;AACD;","names":[]}
@@ -0,0 +1,17 @@
1
+ {
2
+ "node": "n8n-nodes-base.toolExecutor",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "details": "Can execute tools by simulating an agent function call with a given query.",
6
+ "categories": ["Core Nodes"],
7
+ "resources": {
8
+ "primaryDocumentation": [
9
+ {
10
+ "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.editimage/"
11
+ }
12
+ ]
13
+ },
14
+ "subcategories": {
15
+ "Core Nodes": ["Helpers"]
16
+ }
17
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var convertToSchema_exports = {};
20
+ __export(convertToSchema_exports, {
21
+ convertObjectBySchema: () => convertObjectBySchema,
22
+ convertValueBySchema: () => convertValueBySchema
23
+ });
24
+ module.exports = __toCommonJS(convertToSchema_exports);
25
+ var import_zod = require("zod");
26
+ const convertValueBySchema = (value, schema) => {
27
+ if (!schema || !value) return value;
28
+ if (typeof value === "string") {
29
+ if (schema instanceof import_zod.z.ZodNumber) {
30
+ return Number(value);
31
+ } else if (schema instanceof import_zod.z.ZodBoolean) {
32
+ return value.toLowerCase() === "true";
33
+ } else if (schema instanceof import_zod.z.ZodObject) {
34
+ try {
35
+ const parsed = JSON.parse(value);
36
+ return convertValueBySchema(parsed, schema);
37
+ } catch {
38
+ return value;
39
+ }
40
+ }
41
+ }
42
+ if (schema instanceof import_zod.z.ZodObject && typeof value === "object" && value !== null) {
43
+ const result = {};
44
+ for (const [key, val] of Object.entries(value)) {
45
+ const fieldSchema = schema.shape[key];
46
+ if (fieldSchema) {
47
+ result[key] = convertValueBySchema(val, fieldSchema);
48
+ } else {
49
+ result[key] = val;
50
+ }
51
+ }
52
+ return result;
53
+ }
54
+ return value;
55
+ };
56
+ const convertObjectBySchema = (obj, schema) => {
57
+ return convertValueBySchema(obj, schema);
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ convertObjectBySchema,
62
+ convertValueBySchema
63
+ });
64
+ //# sourceMappingURL=convertToSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/ToolExecutor/utils/convertToSchema.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const convertValueBySchema = (value: unknown, schema: any): unknown => {\n\tif (!schema || !value) return value;\n\n\tif (typeof value === 'string') {\n\t\tif (schema instanceof z.ZodNumber) {\n\t\t\treturn Number(value);\n\t\t} else if (schema instanceof z.ZodBoolean) {\n\t\t\treturn value.toLowerCase() === 'true';\n\t\t} else if (schema instanceof z.ZodObject) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(value);\n\t\t\t\treturn convertValueBySchema(parsed, schema);\n\t\t\t} catch {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (schema instanceof z.ZodObject && typeof value === 'object' && value !== null) {\n\t\tconst result: any = {};\n\t\tfor (const [key, val] of Object.entries(value)) {\n\t\t\tconst fieldSchema = schema.shape[key];\n\t\t\tif (fieldSchema) {\n\t\t\t\tresult[key] = convertValueBySchema(val, fieldSchema);\n\t\t\t} else {\n\t\t\t\tresult[key] = val;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\treturn value;\n};\n\nexport const convertObjectBySchema = (obj: any, schema: any): any => {\n\treturn convertValueBySchema(obj, schema);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAEX,MAAM,uBAAuB,CAAC,OAAgB,WAAyB;AAC7E,MAAI,CAAC,UAAU,CAAC,MAAO,QAAO;AAE9B,MAAI,OAAO,UAAU,UAAU;AAC9B,QAAI,kBAAkB,aAAE,WAAW;AAClC,aAAO,OAAO,KAAK;AAAA,IACpB,WAAW,kBAAkB,aAAE,YAAY;AAC1C,aAAO,MAAM,YAAY,MAAM;AAAA,IAChC,WAAW,kBAAkB,aAAE,WAAW;AACzC,UAAI;AACH,cAAM,SAAS,KAAK,MAAM,KAAK;AAC/B,eAAO,qBAAqB,QAAQ,MAAM;AAAA,MAC3C,QAAQ;AACP,eAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAEA,MAAI,kBAAkB,aAAE,aAAa,OAAO,UAAU,YAAY,UAAU,MAAM;AACjF,UAAM,SAAc,CAAC;AACrB,eAAW,CAAC,KAAK,GAAG,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC/C,YAAM,cAAc,OAAO,MAAM,GAAG;AACpC,UAAI,aAAa;AAChB,eAAO,GAAG,IAAI,qBAAqB,KAAK,WAAW;AAAA,MACpD,OAAO;AACN,eAAO,GAAG,IAAI;AAAA,MACf;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEO,MAAM,wBAAwB,CAAC,KAAU,WAAqB;AACpE,SAAO,qBAAqB,KAAK,MAAM;AACxC;","names":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var executeTool_exports = {};
20
+ __export(executeTool_exports, {
21
+ executeTool: () => executeTool
22
+ });
23
+ module.exports = __toCommonJS(executeTool_exports);
24
+ var import_convertToSchema = require("./convertToSchema");
25
+ async function executeTool(tool, query) {
26
+ let convertedQuery = query;
27
+ if ("schema" in tool && tool.schema) {
28
+ convertedQuery = (0, import_convertToSchema.convertObjectBySchema)(query, tool.schema);
29
+ }
30
+ const result = await tool.invoke(convertedQuery);
31
+ return {
32
+ json: result
33
+ };
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ executeTool
38
+ });
39
+ //# sourceMappingURL=executeTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/ToolExecutor/utils/executeTool.ts"],"sourcesContent":["import type { StructuredTool } from 'langchain/tools';\nimport { type IDataObject, type INodeExecutionData } from 'n8n-workflow';\n\nimport { convertObjectBySchema } from './convertToSchema';\n\nexport async function executeTool(\n\ttool: StructuredTool,\n\tquery: string | object,\n): Promise<INodeExecutionData> {\n\tlet convertedQuery: string | object = query;\n\tif ('schema' in tool && tool.schema) {\n\t\tconvertedQuery = convertObjectBySchema(query, tool.schema);\n\t}\n\n\tconst result = await tool.invoke(convertedQuery);\n\n\treturn {\n\t\tjson: result as IDataObject,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,6BAAsC;AAEtC,eAAsB,YACrB,MACA,OAC8B;AAC9B,MAAI,iBAAkC;AACtC,MAAI,YAAY,QAAQ,KAAK,QAAQ;AACpC,yBAAiB,8CAAsB,OAAO,KAAK,MAAM;AAAA,EAC1D;AAEA,QAAM,SAAS,MAAM,KAAK,OAAO,cAAc;AAE/C,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;","names":[]}