@n8n/n8n-nodes-langchain 1.92.2 → 1.93.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.
@@ -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",
@@ -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;AAA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ACpB;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: '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;AA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A,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":[]}
@@ -41,7 +41,8 @@ async function getTools() {
41
41
  return tools.map((tool) => ({
42
42
  name: tool.name,
43
43
  value: tool.name,
44
- description: tool.description
44
+ description: tool.description,
45
+ inputSchema: tool.inputSchema
45
46
  }));
46
47
  }
47
48
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/mcp/McpClientTool/loadOptions.ts"],"sourcesContent":["import {\n\ttype ILoadOptionsFunctions,\n\ttype INodePropertyOptions,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport type { McpAuthenticationOption } from './types';\nimport { connectMcpClient, getAllTools, getAuthHeaders } from './utils';\n\nexport async function getTools(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {\n\tconst authentication = this.getNodeParameter('authentication') as McpAuthenticationOption;\n\tconst sseEndpoint = this.getNodeParameter('sseEndpoint') as string;\n\tconst node = this.getNode();\n\tconst { headers } = await getAuthHeaders(this, authentication);\n\tconst client = await connectMcpClient({\n\t\tsseEndpoint,\n\t\theaders,\n\t\tname: node.type,\n\t\tversion: node.typeVersion,\n\t});\n\n\tif (!client.ok) {\n\t\tthrow new NodeOperationError(this.getNode(), 'Could not connect to your MCP server');\n\t}\n\n\tconst tools = await getAllTools(client.result);\n\treturn tools.map((tool) => ({\n\t\tname: tool.name,\n\t\tvalue: tool.name,\n\t\tdescription: tool.description,\n\t}));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAIO;AAGP,mBAA8D;AAE9D,eAAsB,WAAuE;AAC5F,QAAM,iBAAiB,KAAK,iBAAiB,gBAAgB;AAC7D,QAAM,cAAc,KAAK,iBAAiB,aAAa;AACvD,QAAM,OAAO,KAAK,QAAQ;AAC1B,QAAM,EAAE,QAAQ,IAAI,UAAM,6BAAe,MAAM,cAAc;AAC7D,QAAM,SAAS,UAAM,+BAAiB;AAAA,IACrC;AAAA,IACA;AAAA,IACA,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,EACf,CAAC;AAED,MAAI,CAAC,OAAO,IAAI;AACf,UAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,sCAAsC;AAAA,EACpF;AAEA,QAAM,QAAQ,UAAM,0BAAY,OAAO,MAAM;AAC7C,SAAO,MAAM,IAAI,CAAC,UAAU;AAAA,IAC3B,MAAM,KAAK;AAAA,IACX,OAAO,KAAK;AAAA,IACZ,aAAa,KAAK;AAAA,EACnB,EAAE;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/mcp/McpClientTool/loadOptions.ts"],"sourcesContent":["import {\n\ttype ILoadOptionsFunctions,\n\ttype INodePropertyOptions,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport type { McpAuthenticationOption } from './types';\nimport { connectMcpClient, getAllTools, getAuthHeaders } from './utils';\n\nexport async function getTools(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {\n\tconst authentication = this.getNodeParameter('authentication') as McpAuthenticationOption;\n\tconst sseEndpoint = this.getNodeParameter('sseEndpoint') as string;\n\tconst node = this.getNode();\n\tconst { headers } = await getAuthHeaders(this, authentication);\n\tconst client = await connectMcpClient({\n\t\tsseEndpoint,\n\t\theaders,\n\t\tname: node.type,\n\t\tversion: node.typeVersion,\n\t});\n\n\tif (!client.ok) {\n\t\tthrow new NodeOperationError(this.getNode(), 'Could not connect to your MCP server');\n\t}\n\n\tconst tools = await getAllTools(client.result);\n\treturn tools.map((tool) => ({\n\t\tname: tool.name,\n\t\tvalue: tool.name,\n\t\tdescription: tool.description,\n\t\tinputSchema: tool.inputSchema,\n\t}));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAIO;AAGP,mBAA8D;AAE9D,eAAsB,WAAuE;AAC5F,QAAM,iBAAiB,KAAK,iBAAiB,gBAAgB;AAC7D,QAAM,cAAc,KAAK,iBAAiB,aAAa;AACvD,QAAM,OAAO,KAAK,QAAQ;AAC1B,QAAM,EAAE,QAAQ,IAAI,UAAM,6BAAe,MAAM,cAAc;AAC7D,QAAM,SAAS,UAAM,+BAAiB;AAAA,IACrC;AAAA,IACA;AAAA,IACA,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,EACf,CAAC;AAED,MAAI,CAAC,OAAO,IAAI;AACf,UAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,sCAAsC;AAAA,EACpF;AAEA,QAAM,QAAQ,UAAM,0BAAY,OAAO,MAAM;AAC7C,SAAO,MAAM,IAAI,CAAC,UAAU;AAAA,IAC3B,MAAM,KAAK;AAAA,IACX,OAAO,KAAK;AAAA,IACZ,aAAa,KAAK;AAAA,IAClB,aAAa,KAAK;AAAA,EACnB,EAAE;AACH;","names":[]}
@@ -44,6 +44,15 @@ function wasToolCall(body) {
44
44
  return false;
45
45
  }
46
46
  }
47
+ function getRequestId(body) {
48
+ try {
49
+ const message = JSON.parse(body);
50
+ const parsedMessage = import_types.JSONRPCMessageSchema.parse(message);
51
+ return "id" in parsedMessage ? String(parsedMessage.id) : void 0;
52
+ } catch {
53
+ return void 0;
54
+ }
55
+ }
47
56
  class McpServer {
48
57
  constructor(logger) {
49
58
  this.servers = {};
@@ -62,7 +71,6 @@ class McpServer {
62
71
  resp.on("close", async () => {
63
72
  this.logger.debug(`Deleting transport for ${sessionId}`);
64
73
  delete this.tools[sessionId];
65
- delete this.resolveFunctions[sessionId];
66
74
  delete this.transports[sessionId];
67
75
  delete this.servers[sessionId];
68
76
  });
@@ -74,13 +82,19 @@ class McpServer {
74
82
  async handlePostMessage(req, resp, connectedTools) {
75
83
  const sessionId = req.query.sessionId;
76
84
  const transport = this.transports[sessionId];
77
- this.tools[sessionId] = connectedTools;
78
85
  if (transport) {
79
- await new Promise(async (resolve) => {
80
- this.resolveFunctions[sessionId] = resolve;
81
- await transport.handlePostMessage(req, resp, req.rawBody.toString());
82
- });
83
- delete this.resolveFunctions[sessionId];
86
+ const bodyString = req.rawBody.toString();
87
+ const messageId = getRequestId(bodyString);
88
+ const callId = messageId ? `${sessionId}_${messageId}` : sessionId;
89
+ this.tools[sessionId] = connectedTools;
90
+ try {
91
+ await new Promise(async (resolve) => {
92
+ this.resolveFunctions[callId] = resolve;
93
+ await transport.handlePostMessage(req, resp, bodyString);
94
+ });
95
+ } finally {
96
+ delete this.resolveFunctions[callId];
97
+ }
84
98
  } else {
85
99
  this.logger.warn(`No transport found for session ${sessionId}`);
86
100
  resp.status(401).send("No transport found for sessionId");
@@ -88,7 +102,6 @@ class McpServer {
88
102
  if (resp.flush) {
89
103
  resp.flush();
90
104
  }
91
- delete this.tools[sessionId];
92
105
  return wasToolCall(req.rawBody.toString());
93
106
  }
94
107
  setUpServer() {
@@ -101,50 +114,61 @@ class McpServer {
101
114
  capabilities: { tools: {} }
102
115
  }
103
116
  );
104
- server.setRequestHandler(import_types.ListToolsRequestSchema, async (_, extra) => {
105
- if (!extra.sessionId) {
106
- throw new import_n8n_workflow.OperationalError("Require a sessionId for the listing of tools");
107
- }
108
- return {
109
- tools: this.tools[extra.sessionId].map((tool) => {
110
- return {
111
- name: tool.name,
112
- description: tool.description,
113
- // Allow additional properties on tool call input
114
- inputSchema: (0, import_zod_to_json_schema.zodToJsonSchema)(tool.schema, { removeAdditionalStrategy: "strict" })
115
- };
116
- })
117
- };
118
- });
119
- server.setRequestHandler(import_types.CallToolRequestSchema, async (request, extra) => {
120
- if (!request.params?.name || !request.params?.arguments) {
121
- throw new import_n8n_workflow.OperationalError("Require a name and arguments for the tool call");
122
- }
123
- if (!extra.sessionId) {
124
- throw new import_n8n_workflow.OperationalError("Require a sessionId for the tool call");
125
- }
126
- const requestedTool = this.tools[extra.sessionId].find(
127
- (tool) => tool.name === request.params.name
128
- );
129
- if (!requestedTool) {
130
- throw new import_n8n_workflow.OperationalError("Tool not found");
117
+ server.setRequestHandler(
118
+ import_types.ListToolsRequestSchema,
119
+ async (_, extra) => {
120
+ if (!extra.sessionId) {
121
+ throw new import_n8n_workflow.OperationalError("Require a sessionId for the listing of tools");
122
+ }
123
+ return {
124
+ tools: this.tools[extra.sessionId].map((tool) => {
125
+ return {
126
+ name: tool.name,
127
+ description: tool.description,
128
+ // Allow additional properties on tool call input
129
+ inputSchema: (0, import_zod_to_json_schema.zodToJsonSchema)(tool.schema, { removeAdditionalStrategy: "strict" })
130
+ };
131
+ })
132
+ };
131
133
  }
132
- try {
133
- const result = await requestedTool.invoke(request.params.arguments);
134
- this.resolveFunctions[extra.sessionId]();
135
- this.logger.debug(`Got request for ${requestedTool.name}, and executed it.`);
136
- if (typeof result === "object") {
137
- return { content: [{ type: "text", text: JSON.stringify(result) }] };
134
+ );
135
+ server.setRequestHandler(
136
+ import_types.CallToolRequestSchema,
137
+ async (request, extra) => {
138
+ if (!request.params?.name || !request.params?.arguments) {
139
+ throw new import_n8n_workflow.OperationalError("Require a name and arguments for the tool call");
138
140
  }
139
- if (typeof result === "string") {
140
- return { content: [{ type: "text", text: result }] };
141
+ if (!extra.sessionId) {
142
+ throw new import_n8n_workflow.OperationalError("Require a sessionId for the tool call");
143
+ }
144
+ const callId = extra.requestId ? `${extra.sessionId}_${extra.requestId}` : extra.sessionId;
145
+ const requestedTool = this.tools[extra.sessionId].find(
146
+ (tool) => tool.name === request.params.name
147
+ );
148
+ if (!requestedTool) {
149
+ throw new import_n8n_workflow.OperationalError("Tool not found");
150
+ }
151
+ try {
152
+ const result = await requestedTool.invoke(request.params.arguments);
153
+ if (this.resolveFunctions[callId]) {
154
+ this.resolveFunctions[callId]();
155
+ } else {
156
+ this.logger.warn(`No resolve function found for ${callId}`);
157
+ }
158
+ this.logger.debug(`Got request for ${requestedTool.name}, and executed it.`);
159
+ if (typeof result === "object") {
160
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
161
+ }
162
+ if (typeof result === "string") {
163
+ return { content: [{ type: "text", text: result }] };
164
+ }
165
+ return { content: [{ type: "text", text: String(result) }] };
166
+ } catch (error) {
167
+ this.logger.error(`Error while executing Tool ${requestedTool.name}: ${error}`);
168
+ return { isError: true, content: [{ type: "text", text: `Error: ${error.message}` }] };
141
169
  }
142
- return { content: [{ type: "text", text: String(result) }] };
143
- } catch (error) {
144
- this.logger.error(`Error while executing Tool ${requestedTool.name}: ${error}`);
145
- return { isError: true, content: [{ type: "text", text: `Error: ${error.message}` }] };
146
170
  }
147
- });
171
+ );
148
172
  server.onclose = () => {
149
173
  this.logger.debug("Closing MCP Server");
150
174
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/mcp/McpTrigger/McpServer.ts"],"sourcesContent":["import type { Tool } from '@langchain/core/tools';\nimport { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport {\n\tJSONRPCMessageSchema,\n\tListToolsRequestSchema,\n\tCallToolRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport type * as express from 'express';\nimport { OperationalError, type Logger } from 'n8n-workflow';\nimport { zodToJsonSchema } from 'zod-to-json-schema';\n\nimport { FlushingSSEServerTransport } from './FlushingSSEServerTransport';\nimport type { CompressionResponse } from './FlushingSSEServerTransport';\n\n/**\n * Parses the JSONRPC message and checks whether the method used was a tool\n * call. This is necessary in order to not have executions for listing tools\n * and other commands sent by the MCP client\n */\nfunction wasToolCall(body: string) {\n\ttry {\n\t\tconst message: unknown = JSON.parse(body);\n\t\tconst parsedMessage: JSONRPCMessage = JSONRPCMessageSchema.parse(message);\n\t\treturn (\n\t\t\t'method' in parsedMessage &&\n\t\t\t'id' in parsedMessage &&\n\t\t\tparsedMessage?.method === CallToolRequestSchema.shape.method.value\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport class McpServer {\n\tservers: { [sessionId: string]: Server } = {};\n\n\ttransports: { [sessionId: string]: FlushingSSEServerTransport } = {};\n\n\tlogger: Logger;\n\n\tprivate tools: { [sessionId: string]: Tool[] } = {};\n\n\tprivate resolveFunctions: { [sessionId: string]: CallableFunction } = {};\n\n\tconstructor(logger: Logger) {\n\t\tthis.logger = logger;\n\t\tthis.logger.debug('MCP Server created');\n\t}\n\n\tasync connectTransport(postUrl: string, resp: CompressionResponse): Promise<void> {\n\t\tconst transport = new FlushingSSEServerTransport(postUrl, resp);\n\t\tconst server = this.setUpServer();\n\t\tconst { sessionId } = transport;\n\t\tthis.transports[sessionId] = transport;\n\t\tthis.servers[sessionId] = server;\n\n\t\tresp.on('close', async () => {\n\t\t\tthis.logger.debug(`Deleting transport for ${sessionId}`);\n\t\t\tdelete this.tools[sessionId];\n\t\t\tdelete this.resolveFunctions[sessionId];\n\t\t\tdelete this.transports[sessionId];\n\t\t\tdelete this.servers[sessionId];\n\t\t});\n\n\t\tawait server.connect(transport);\n\n\t\t// Make sure we flush the compression middleware, so that it's not waiting for more content to be added to the buffer\n\t\tif (resp.flush) {\n\t\t\tresp.flush();\n\t\t}\n\t}\n\n\tasync handlePostMessage(req: express.Request, resp: CompressionResponse, connectedTools: Tool[]) {\n\t\tconst sessionId = req.query.sessionId as string;\n\t\tconst transport = this.transports[sessionId];\n\t\tthis.tools[sessionId] = connectedTools;\n\t\tif (transport) {\n\t\t\t// We need to add a promise here because the `handlePostMessage` will send something to the\n\t\t\t// MCP Server, that will run in a different context. This means that the return will happen\n\t\t\t// almost immediately, and will lead to marking the sub-node as \"running\" in the final execution\n\t\t\tawait new Promise(async (resolve) => {\n\t\t\t\tthis.resolveFunctions[sessionId] = resolve;\n\t\t\t\tawait transport.handlePostMessage(req, resp, req.rawBody.toString());\n\t\t\t});\n\t\t\tdelete this.resolveFunctions[sessionId];\n\t\t} else {\n\t\t\tthis.logger.warn(`No transport found for session ${sessionId}`);\n\t\t\tresp.status(401).send('No transport found for sessionId');\n\t\t}\n\n\t\tif (resp.flush) {\n\t\t\tresp.flush();\n\t\t}\n\n\t\tdelete this.tools[sessionId]; // Clean up to avoid keeping all tools in memory\n\n\t\treturn wasToolCall(req.rawBody.toString());\n\t}\n\n\tsetUpServer(): Server {\n\t\tconst server = new Server(\n\t\t\t{\n\t\t\t\tname: 'n8n-mcp-server',\n\t\t\t\tversion: '0.1.0',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcapabilities: { tools: {} },\n\t\t\t},\n\t\t);\n\n\t\tserver.setRequestHandler(ListToolsRequestSchema, async (_, extra: RequestHandlerExtra) => {\n\t\t\tif (!extra.sessionId) {\n\t\t\t\tthrow new OperationalError('Require a sessionId for the listing of tools');\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttools: this.tools[extra.sessionId].map((tool) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: tool.name,\n\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\t// Allow additional properties on tool call input\n\t\t\t\t\t\tinputSchema: zodToJsonSchema(tool.schema, { removeAdditionalStrategy: 'strict' }),\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t};\n\t\t});\n\n\t\tserver.setRequestHandler(CallToolRequestSchema, async (request, extra: RequestHandlerExtra) => {\n\t\t\tif (!request.params?.name || !request.params?.arguments) {\n\t\t\t\tthrow new OperationalError('Require a name and arguments for the tool call');\n\t\t\t}\n\t\t\tif (!extra.sessionId) {\n\t\t\t\tthrow new OperationalError('Require a sessionId for the tool call');\n\t\t\t}\n\n\t\t\tconst requestedTool: Tool | undefined = this.tools[extra.sessionId].find(\n\t\t\t\t(tool) => tool.name === request.params.name,\n\t\t\t);\n\t\t\tif (!requestedTool) {\n\t\t\t\tthrow new OperationalError('Tool not found');\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst result = await requestedTool.invoke(request.params.arguments);\n\n\t\t\t\tthis.resolveFunctions[extra.sessionId]();\n\n\t\t\t\tthis.logger.debug(`Got request for ${requestedTool.name}, and executed it.`);\n\n\t\t\t\tif (typeof result === 'object') {\n\t\t\t\t\treturn { content: [{ type: 'text', text: JSON.stringify(result) }] };\n\t\t\t\t}\n\t\t\t\tif (typeof result === 'string') {\n\t\t\t\t\treturn { content: [{ type: 'text', text: result }] };\n\t\t\t\t}\n\t\t\t\treturn { content: [{ type: 'text', text: String(result) }] };\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error(`Error while executing Tool ${requestedTool.name}: ${error}`);\n\t\t\t\treturn { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] };\n\t\t\t}\n\t\t});\n\n\t\tserver.onclose = () => {\n\t\t\tthis.logger.debug('Closing MCP Server');\n\t\t};\n\t\tserver.onerror = (error: unknown) => {\n\t\t\tthis.logger.error(`MCP Error: ${error}`);\n\t\t};\n\t\treturn server;\n\t}\n}\n\n/**\n * This singleton is shared across the instance, making sure we only have one server to worry about.\n * It needs to stay in memory to keep track of the long-lived connections.\n * It requires a logger at first creation to set everything up.\n */\nexport class McpServerSingleton {\n\tstatic #instance: McpServerSingleton;\n\n\tprivate _serverData: McpServer;\n\n\tprivate constructor(logger: Logger) {\n\t\tthis._serverData = new McpServer(logger);\n\t}\n\n\tstatic instance(logger: Logger): McpServer {\n\t\tif (!McpServerSingleton.#instance) {\n\t\t\tMcpServerSingleton.#instance = new McpServerSingleton(logger);\n\t\t\tlogger.debug('Created singleton for MCP Servers');\n\t\t}\n\n\t\treturn McpServerSingleton.#instance.serverData;\n\t}\n\n\tget serverData() {\n\t\treturn this._serverData;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AAGvB,mBAIO;AAEP,0BAA8C;AAC9C,gCAAgC;AAEhC,wCAA2C;AAb3C;AAqBA,SAAS,YAAY,MAAc;AAClC,MAAI;AACH,UAAM,UAAmB,KAAK,MAAM,IAAI;AACxC,UAAM,gBAAgC,kCAAqB,MAAM,OAAO;AACxE,WACC,YAAY,iBACZ,QAAQ,iBACR,eAAe,WAAW,mCAAsB,MAAM,OAAO;AAAA,EAE/D,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AAEO,MAAM,UAAU;AAAA,EAWtB,YAAY,QAAgB;AAV5B,mBAA2C,CAAC;AAE5C,sBAAkE,CAAC;AAInE,SAAQ,QAAyC,CAAC;AAElD,SAAQ,mBAA8D,CAAC;AAGtE,SAAK,SAAS;AACd,SAAK,OAAO,MAAM,oBAAoB;AAAA,EACvC;AAAA,EAEA,MAAM,iBAAiB,SAAiB,MAA0C;AACjF,UAAM,YAAY,IAAI,6DAA2B,SAAS,IAAI;AAC9D,UAAM,SAAS,KAAK,YAAY;AAChC,UAAM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AO,MAAM,EAAE,CAAC,EAAE;AAAA,MAC5D,SAAS,OAAO;AACf,aAAK,OAAO,MAAM,8BAA8B,cAAc,IAAI,KAAK,KAAK,EAAE;AAC9E,eAAO,EAAE,SAAS,MAAM,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,UAAU,MAAM,OAAO,GAAG,CAAC,EAAE;AAAA,MACtF;AAAA,IACD,CAAC;AAED,WAAO,UAAU,MAAM;AACtB,WAAK,OAAO,MAAM,oBAAoB;AAAA,IACvC;AACA,WAAO,UAAU,CAAC,UAAmB;AACpC,WAAK,OAAO,MAAM,cAAc,KAAK,EAAE;AAAA,IACxC;AACA,WAAO;AAAA,EACR;AACD;AAOO,MAAM,sBAAN,MAAM,oBAAmB;AAAA,EAKvB,YAAY,QAAgB;AACnC,SAAK,cAAc,IAAI,UAAU,MAAM;AAAA,EACxC;AAAA,EAEA,OAAO,SAAS,QAA2B;AAC1C,QAAI,CAAC,kCAAmB,YAAW;AAClC,wCAAmB,WAAY,IAAI,oBAAmB,MAAM;AAC5D,aAAO,MAAM,mCAAmC;AAAA,IACjD;AAEA,WAAO,kCAAmB,WAAU;AAAA,EACrC;AAAA,EAEA,IAAI,aAAa;AAChB,WAAO,KAAK;AAAA,EACb;AACD;AApBQ;AAAP,aADY,qBACL;AADD,IAAM,qBAAN;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/mcp/McpTrigger/McpServer.ts"],"sourcesContent":["import type { Tool } from '@langchain/core/tools';\nimport { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';\nimport type {\n\tJSONRPCMessage,\n\tServerRequest,\n\tServerNotification,\n} from '@modelcontextprotocol/sdk/types.js';\nimport {\n\tJSONRPCMessageSchema,\n\tListToolsRequestSchema,\n\tCallToolRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport type * as express from 'express';\nimport { OperationalError, type Logger } from 'n8n-workflow';\nimport { zodToJsonSchema } from 'zod-to-json-schema';\n\nimport { FlushingSSEServerTransport } from './FlushingSSEServerTransport';\nimport type { CompressionResponse } from './FlushingSSEServerTransport';\n\n/**\n * Parses the JSONRPC message and checks whether the method used was a tool\n * call. This is necessary in order to not have executions for listing tools\n * and other commands sent by the MCP client\n */\nfunction wasToolCall(body: string) {\n\ttry {\n\t\tconst message: unknown = JSON.parse(body);\n\t\tconst parsedMessage: JSONRPCMessage = JSONRPCMessageSchema.parse(message);\n\t\treturn (\n\t\t\t'method' in parsedMessage &&\n\t\t\t'id' in parsedMessage &&\n\t\t\tparsedMessage?.method === CallToolRequestSchema.shape.method.value\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Extracts the request ID from a JSONRPC message\n * Returns undefined if the message doesn't have an ID or can't be parsed\n */\nfunction getRequestId(body: string): string | undefined {\n\ttry {\n\t\tconst message: unknown = JSON.parse(body);\n\t\tconst parsedMessage: JSONRPCMessage = JSONRPCMessageSchema.parse(message);\n\t\treturn 'id' in parsedMessage ? String(parsedMessage.id) : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport class McpServer {\n\tservers: { [sessionId: string]: Server } = {};\n\n\ttransports: { [sessionId: string]: FlushingSSEServerTransport } = {};\n\n\tlogger: Logger;\n\n\tprivate tools: { [sessionId: string]: Tool[] } = {};\n\n\tprivate resolveFunctions: { [callId: string]: CallableFunction } = {};\n\n\tconstructor(logger: Logger) {\n\t\tthis.logger = logger;\n\t\tthis.logger.debug('MCP Server created');\n\t}\n\n\tasync connectTransport(postUrl: string, resp: CompressionResponse): Promise<void> {\n\t\tconst transport = new FlushingSSEServerTransport(postUrl, resp);\n\t\tconst server = this.setUpServer();\n\t\tconst { sessionId } = transport;\n\t\tthis.transports[sessionId] = transport;\n\t\tthis.servers[sessionId] = server;\n\n\t\tresp.on('close', async () => {\n\t\t\tthis.logger.debug(`Deleting transport for ${sessionId}`);\n\t\t\tdelete this.tools[sessionId];\n\t\t\tdelete this.transports[sessionId];\n\t\t\tdelete this.servers[sessionId];\n\t\t});\n\n\t\tawait server.connect(transport);\n\n\t\t// Make sure we flush the compression middleware, so that it's not waiting for more content to be added to the buffer\n\t\tif (resp.flush) {\n\t\t\tresp.flush();\n\t\t}\n\t}\n\n\tasync handlePostMessage(req: express.Request, resp: CompressionResponse, connectedTools: Tool[]) {\n\t\tconst sessionId = req.query.sessionId as string;\n\t\tconst transport = this.transports[sessionId];\n\t\tif (transport) {\n\t\t\t// We need to add a promise here because the `handlePostMessage` will send something to the\n\t\t\t// MCP Server, that will run in a different context. This means that the return will happen\n\t\t\t// almost immediately, and will lead to marking the sub-node as \"running\" in the final execution\n\t\t\tconst bodyString = req.rawBody.toString();\n\t\t\tconst messageId = getRequestId(bodyString);\n\n\t\t\t// Use session & message ID if available, otherwise fall back to sessionId\n\t\t\tconst callId = messageId ? `${sessionId}_${messageId}` : sessionId;\n\t\t\tthis.tools[sessionId] = connectedTools;\n\n\t\t\ttry {\n\t\t\t\tawait new Promise(async (resolve) => {\n\t\t\t\t\tthis.resolveFunctions[callId] = resolve;\n\t\t\t\t\tawait transport.handlePostMessage(req, resp, bodyString);\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tdelete this.resolveFunctions[callId];\n\t\t\t}\n\t\t} else {\n\t\t\tthis.logger.warn(`No transport found for session ${sessionId}`);\n\t\t\tresp.status(401).send('No transport found for sessionId');\n\t\t}\n\n\t\tif (resp.flush) {\n\t\t\tresp.flush();\n\t\t}\n\n\t\treturn wasToolCall(req.rawBody.toString());\n\t}\n\n\tsetUpServer(): Server {\n\t\tconst server = new Server(\n\t\t\t{\n\t\t\t\tname: 'n8n-mcp-server',\n\t\t\t\tversion: '0.1.0',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcapabilities: { tools: {} },\n\t\t\t},\n\t\t);\n\n\t\tserver.setRequestHandler(\n\t\t\tListToolsRequestSchema,\n\t\t\tasync (_, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => {\n\t\t\t\tif (!extra.sessionId) {\n\t\t\t\t\tthrow new OperationalError('Require a sessionId for the listing of tools');\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\ttools: this.tools[extra.sessionId].map((tool) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname: tool.name,\n\t\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\t\t// Allow additional properties on tool call input\n\t\t\t\t\t\t\tinputSchema: zodToJsonSchema(tool.schema, { removeAdditionalStrategy: 'strict' }),\n\t\t\t\t\t\t};\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\t\t},\n\t\t);\n\n\t\tserver.setRequestHandler(\n\t\t\tCallToolRequestSchema,\n\t\t\tasync (request, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => {\n\t\t\t\tif (!request.params?.name || !request.params?.arguments) {\n\t\t\t\t\tthrow new OperationalError('Require a name and arguments for the tool call');\n\t\t\t\t}\n\t\t\t\tif (!extra.sessionId) {\n\t\t\t\t\tthrow new OperationalError('Require a sessionId for the tool call');\n\t\t\t\t}\n\n\t\t\t\tconst callId = extra.requestId ? `${extra.sessionId}_${extra.requestId}` : extra.sessionId;\n\n\t\t\t\tconst requestedTool: Tool | undefined = this.tools[extra.sessionId].find(\n\t\t\t\t\t(tool) => tool.name === request.params.name,\n\t\t\t\t);\n\t\t\t\tif (!requestedTool) {\n\t\t\t\t\tthrow new OperationalError('Tool not found');\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await requestedTool.invoke(request.params.arguments);\n\t\t\t\t\tif (this.resolveFunctions[callId]) {\n\t\t\t\t\t\tthis.resolveFunctions[callId]();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.logger.warn(`No resolve function found for ${callId}`);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.logger.debug(`Got request for ${requestedTool.name}, and executed it.`);\n\n\t\t\t\t\tif (typeof result === 'object') {\n\t\t\t\t\t\treturn { content: [{ type: 'text', text: JSON.stringify(result) }] };\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof result === 'string') {\n\t\t\t\t\t\treturn { content: [{ type: 'text', text: result }] };\n\t\t\t\t\t}\n\t\t\t\t\treturn { content: [{ type: 'text', text: String(result) }] };\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.logger.error(`Error while executing Tool ${requestedTool.name}: ${error}`);\n\t\t\t\t\treturn { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] };\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\tserver.onclose = () => {\n\t\t\tthis.logger.debug('Closing MCP Server');\n\t\t};\n\t\tserver.onerror = (error: unknown) => {\n\t\t\tthis.logger.error(`MCP Error: ${error}`);\n\t\t};\n\t\treturn server;\n\t}\n}\n\n/**\n * This singleton is shared across the instance, making sure we only have one server to worry about.\n * It needs to stay in memory to keep track of the long-lived connections.\n * It requires a logger at first creation to set everything up.\n */\nexport class McpServerSingleton {\n\tstatic #instance: McpServerSingleton;\n\n\tprivate _serverData: McpServer;\n\n\tprivate constructor(logger: Logger) {\n\t\tthis._serverData = new McpServer(logger);\n\t}\n\n\tstatic instance(logger: Logger): McpServer {\n\t\tif (!McpServerSingleton.#instance) {\n\t\t\tMcpServerSingleton.#instance = new McpServerSingleton(logger);\n\t\t\tlogger.debug('Created singleton for MCP Servers');\n\t\t}\n\n\t\treturn McpServerSingleton.#instance.serverData;\n\t}\n\n\tget serverData() {\n\t\treturn this._serverData;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAuB;AAOvB,mBAIO;AAEP,0BAA8C;AAC9C,gCAAgC;AAEhC,wCAA2C;AAjB3C;AAyBA,SAAS,YAAY,MAAc;AAClC,MAAI;AACH,UAAM,UAAmB,KAAK,MAAM,IAAI;AACxC,UAAM,gBAAgC,kCAAqB,MAAM,OAAO;AACxE,WACC,YAAY,iBACZ,QAAQ,iBACR,eAAe,WA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A,WAAO,UAAU,CAAC,UAAmB;AACpC,WAAK,OAAO,MAAM,cAAc,KAAK,EAAE;AAAA,IACxC;AACA,WAAO;AAAA,EACR;AACD;AAOO,MAAM,sBAAN,MAAM,oBAAmB;AAAA,EAKvB,YAAY,QAAgB;AACnC,SAAK,cAAc,IAAI,UAAU,MAAM;AAAA,EACxC;AAAA,EAEA,OAAO,SAAS,QAA2B;AAC1C,QAAI,CAAC,kCAAmB,YAAW;AAClC,wCAAmB,WAAY,IAAI,oBAAmB,MAAM;AAC5D,aAAO,MAAM,mCAAmC;AAAA,IACjD;AAEA,WAAO,kCAAmB,WAAU;AAAA,EACrC;AAAA,EAEA,IAAI,aAAa;AAChB,WAAO,KAAK;AAAA,EACb;AACD;AApBQ;AAAP,aADY,qBACL;AADD,IAAM,qBAAN;","names":[]}
@@ -1 +1 @@
1
- <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 360"><defs><style>.cls-1{fill:#fff;}</style></defs><title>milvus-icon-white</title><path class="cls-1" d="M168.50983,63.3293c31.95671.507,59.93559,11.11286,83.27686,33.18535,18.7006,17.68407,30.22667,39.32512,34.81328,64.64452A105.32115,105.32115,0,0,1,288.30948,182.05c-.56967,28.47039-9.94153,53.66667-28.65343,75.19713-18.13667,20.86872-40.90888,34.11493-68.05469,39.10222-36.61066,6.7263-69.82614-1.44613-99.22656-24.47337-6.10735-4.78341-11.40667-10.44927-16.92918-15.86568q-17.83359-17.49069-35.625-35.0246Q23.68152,205.12557,7.53535,189.27287c-4.99811-4.92643-5.00166-11.76177-.00618-16.68775q16.58239-16.35193,33.222-32.64579c10.415-10.22513,20.7782-20.50417,31.27381-30.64606,6.968-6.73308,13.5621-13.8667,21.20515-19.88878a119.68976,119.68976,0,0,1,51.34517-23.68667,121.162,121.162,0,0,1,23.93459-2.38869Zm92.371,117.69085a91.99822,91.99822,0,0,0-1.48906-15.09071c-4.6589-24.42132-17.48944-43.49544-38.23938-56.98664-20.01283-13.01188-42.00792-17.05568-65.46628-12.61428a85.61952,85.61952,0,0,0-44.01862,22.6468c-8.21582,7.84726-16.269,15.86505-24.38163,23.82013q-16.31332,15.99666-32.59837,32.0219c-3.75,3.69749-3.73394,8.52908-.01266,12.20989,5.32758,5.2695,10.69285,10.50085,16.03635,15.75429q19.54138,19.21189,39.08246,38.424,28.33431,27.75336,67.98,25.94035a83.03279,83.03279,0,0,0,39.17421-11.52729c28.23729-16.81519,42.66039-41.87957,43.93305-74.59841Zm58.23612-.07522a171.37566,171.37566,0,0,0-4.09075-38.11425,11.73723,11.73723,0,0,1-.20111-1.1565,2.63478,2.63478,0,0,1,1.27481-2.74752,2.67092,2.67092,0,0,1,3.16194.02147,9.13711,9.13711,0,0,1,1.18864,1.0856q16.15512,16.14834,32.305,32.30226c5.30658,5.3075,5.2967,12.06515-.02255,17.38455q-16.09957,16.10016-32.1997,32.19985c-.277.27695-.54682.56179-.83445.82717a2.73085,2.73085,0,0,1-3.50192.44023,2.6834,2.6834,0,0,1-1.351-3.11577c1.13192-5.20587,2.10232-10.43969,2.798-15.72573a164.22388,164.22388,0,0,0,1.46944-18.85586c.0238-1.5147.00355-3.03034.00355-4.54551Z"/><path class="cls-1" d="M232.20625,180.965a70.48931,70.48931,0,1,0-.00015,0Z"/></svg>
1
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 360"><defs><style>.cls-1{fill:#fff;}</style></defs><title>milvus-icon-white</title><path class="cls-1" d="M169.11689,299.04939c-27.78535-.02915-51.298-8.31411-72.45031-23.69338a122.33707,122.33707,0,0,1-14.00922-12.00616q-16.556-16.35613-33.14895-32.67482Q35.31712,216.704,21.10726,202.7519c-4.27753-4.20375-8.581-8.38131-12.83638-12.60737-5.78529-5.74539-5.692-12.21736.17135-17.91294,4.35916-4.23447,8.6808-8.50759,13.01531-12.76743q21.09033-20.727,42.18351-41.45112c7.82349-7.66748,15.53733-15.458,23.59542-22.87264A117.61725,117.61725,0,0,1,142.926,66.46075,112.79714,112.79714,0,0,1,167.7708,63.678c27.822.22006,53.14231,8.0315,75.21837,25.35039a117.49179,117.49179,0,0,1,33.56725,40.74071,111.30862,111.30862,0,0,1,11.18191,37.59258c3.75648,35.37535-6.093,66.46091-30.10087,92.86236a114.32952,114.32952,0,0,1-57.75872,34.79075A132.31853,132.31853,0,0,1,169.11689,299.04939Zm5.35425-31.43461a85.592,85.592,0,0,0,8.90555-.52289c1.86733-.18941,3.736-.42361,5.58158-.7604,22.43092-4.09372,40.60221-15.4505,54.49679-33.26538,13.51833-17.33245,18.827-37.40452,17.16875-59.24969a82.75341,82.75341,0,0,0-9.27492-31.89563c-9.21938-17.8418-23.47591-30.41362-41.44061-38.92072-16.12138-7.6342-33.07061-9.547-50.63693-6.8248a85.52038,85.52038,0,0,0-47.48221,23.39486c-12.62025,12.19885-25.1024,24.54066-37.63746,36.82758-6.28192,6.15757-12.51006,12.37048-18.83189,18.48667-4.04633,3.91467-4.21333,8.6494-.20763,12.6018q11.8256,11.66819,23.69873,23.28819c10.60865,10.42576,21.17268,20.89736,31.83058,31.27252C128.07334,259.01635,148.957,267.6,174.47114,267.61478Z"/><path class="cls-1" d="M357.01654,180.71583a12.11267,12.11267,0,0,1-3.67773,9.07927q-16.50428,16.58232-33.07758,33.09591c-1.20808,1.20715-2.42168,1.44863-3.67166.79033-1.35017-.71105-1.82827-1.79263-1.442-3.56058a187.7592,187.7592,0,0,0,3.66284-23.911,178.77219,178.77219,0,0,0,.42091-21.92036,170.04764,170.04764,0,0,0-3.96975-31.1,3.757,3.757,0,0,1,.24665-3.12677,2.86044,2.86044,0,0,1,4.014-.76856,9.243,9.243,0,0,1,1.2578,1.10625q15.99768,15.98621,31.98832,31.97946C355.28369,174.89374,357.02471,177.76063,357.01654,180.71583Z"/><path class="cls-1" d="M232.52066,181.32156a58.91788,58.91788,0,0,1-59.06395,59.10475c-34.72229-.0744-59.571-28.74548-58.99573-60.0188a59.03419,59.03419,0,0,1,118.05968.91405Z"/></svg>
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {"name":"anthropicApi","displayName":"Anthropic","documentationUrl":"anthropic","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"string","default":"https://api.anthropic.com","description":"Override the default base URL for the API"}],"authenticate":{"type":"generic","properties":{"headers":{"x-api-key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials?.url}}","url":"/v1/messages","method":"POST","headers":{"anthropic-version":"2023-06-01"},"body":{"model":"claude-3-haiku-20240307","messages":[{"role":"user","content":"Hey"}],"max_tokens":1}}},"supportedNodes":["lmChatAnthropic"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LMChatAnthropic/anthropic.svg"},
3
- {"name":"azureOpenAiApi","displayName":"Azure Open AI","documentationUrl":"azureopenai","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Resource Name","name":"resourceName","type":"string","required":true,"default":""},{"displayName":"API Version","name":"apiVersion","type":"string","required":true,"default":"2023-07-01-preview"},{"displayName":"Endpoint","name":"endpoint","type":"string","placeholder":"https://westeurope.api.cognitive.microsoft.com"}],"authenticate":{"type":"generic","properties":{"headers":{"api-key":"={{$credentials.apiKey}}"}}},"supportedNodes":["embeddingsAzureOpenAi","lmChatAzureOpenAi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsAzureOpenAi/azure.svg"},
4
- {"name":"azureEntraCognitiveServicesOAuth2Api","displayName":"Azure Entra ID (Azure Active Directory) API","extends":["oAuth2Api"],"documentationUrl":"azureEntraCognitiveServicesOAuth2Api","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Resource Name","name":"resourceName","type":"string","required":true,"default":""},{"displayName":"API Version","name":"apiVersion","type":"string","required":true,"default":"2024-12-01-preview"},{"displayName":"Endpoint","name":"endpoint","type":"string","placeholder":"https://westeurope.api.cognitive.microsoft.com"},{"displayName":"Tenant ID","name":"tenantId","type":"string","default":"common","description":"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.","placeholder":"e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common"},{"displayName":"Authorization URL","name":"authUrl","type":"string","default":"https://login.microsoftonline.com/$TENANT_ID/oauth2/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"string","default":"https://login.microsoftonline.com/$TENANT_ID/oauth2/token"},{"displayName":"Client ID","name":"clientId","type":"string","required":true,"default":"","description":"Client ID obtained from the Azure AD App Registration"},{"displayName":"Client Secret","name":"clientSecret","type":"string","required":true,"typeOptions":{"password":true},"default":"","description":"Client Secret obtained from the Azure AD App Registration"},{"displayName":"Additional Body Properties","name":"additionalBodyProperties","type":"hidden","default":"{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}"},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"},{"displayName":"Custom Scopes","name":"customScopes","type":"boolean","default":false,"description":"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\"."},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"","description":"For some services additional query parameters have to be set which can be defined here","placeholder":""},{"displayName":"Enabled Scopes","name":"enabledScopes","type":"string","displayOptions":{"show":{"customScopes":[true]}},"default":"openid offline_access","placeholder":"openid offline_access","description":"Space-separated list of scopes to request."},{"displayName":"Scope","name":"scope","type":"hidden","default":"={{ $self.customScopes ? $self.enabledScopes : \"openid offline_access\"}}"}],"supportedNodes":["lmChatAzureOpenAi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAzureOpenAi/azure.svg"},
3
+ {"name":"azureOpenAiApi","displayName":"Azure Open AI","documentationUrl":"azureopenai","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Resource Name","name":"resourceName","type":"string","required":true,"default":""},{"displayName":"API Version","name":"apiVersion","type":"string","required":true,"default":"2025-03-01-preview"},{"displayName":"Endpoint","name":"endpoint","type":"string","placeholder":"https://westeurope.api.cognitive.microsoft.com"}],"authenticate":{"type":"generic","properties":{"headers":{"api-key":"={{$credentials.apiKey}}"}}},"supportedNodes":["embeddingsAzureOpenAi","lmChatAzureOpenAi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsAzureOpenAi/azure.svg"},
4
+ {"name":"azureEntraCognitiveServicesOAuth2Api","displayName":"Azure Entra ID (Azure Active Directory) API","extends":["oAuth2Api"],"documentationUrl":"azureEntraCognitiveServicesOAuth2Api","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Resource Name","name":"resourceName","type":"string","required":true,"default":""},{"displayName":"API Version","name":"apiVersion","type":"string","required":true,"default":"2025-03-01-preview"},{"displayName":"Endpoint","name":"endpoint","type":"string","placeholder":"https://westeurope.api.cognitive.microsoft.com"},{"displayName":"Tenant ID","name":"tenantId","type":"string","default":"common","description":"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.","placeholder":"e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common"},{"displayName":"Authorization URL","name":"authUrl","type":"string","default":"https://login.microsoftonline.com/$TENANT_ID/oauth2/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"string","default":"https://login.microsoftonline.com/$TENANT_ID/oauth2/token"},{"displayName":"Client ID","name":"clientId","type":"string","required":true,"default":"","description":"Client ID obtained from the Azure AD App Registration"},{"displayName":"Client Secret","name":"clientSecret","type":"string","required":true,"typeOptions":{"password":true},"default":"","description":"Client Secret obtained from the Azure AD App Registration"},{"displayName":"Additional Body Properties","name":"additionalBodyProperties","type":"hidden","default":"{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}"},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"},{"displayName":"Custom Scopes","name":"customScopes","type":"boolean","default":false,"description":"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\"."},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"","description":"For some services additional query parameters have to be set which can be defined here","placeholder":""},{"displayName":"Enabled Scopes","name":"enabledScopes","type":"string","displayOptions":{"show":{"customScopes":[true]}},"default":"openid offline_access","placeholder":"openid offline_access","description":"Space-separated list of scopes to request."},{"displayName":"Scope","name":"scope","type":"hidden","default":"={{ $self.customScopes ? $self.enabledScopes : \"openid offline_access\"}}"}],"supportedNodes":["lmChatAzureOpenAi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAzureOpenAi/azure.svg"},
5
5
  {"name":"cohereApi","displayName":"CohereApi","documentationUrl":"cohere","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.cohere.ai","url":"/v1/models?page_size=1"}},"supportedNodes":["embeddingsCohere","lmCohere"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsCohere/cohere.dark.svg"}},
6
6
  {"name":"deepSeekApi","displayName":"DeepSeek","documentationUrl":"deepseek","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"hidden","default":"https://api.deepseek.com"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/models"}},"supportedNodes":["lmChatDeepSeek"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatDeepSeek/deepseek.svg"},
7
7
  {"name":"googlePalmApi","displayName":"Google Gemini(PaLM) Api","documentationUrl":"google","properties":[{"displayName":"Host","name":"host","required":true,"type":"string","default":"https://generativelanguage.googleapis.com"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.host}}/v1beta/models"}},"supportedNodes":["embeddingsGoogleGemini","lmChatGoogleGemini"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsGoogleGemini/google.svg"},
@@ -17,7 +17,7 @@
17
17
  {"name":"searXngApi","displayName":"SearXNG","documentationUrl":"searxng","properties":[{"displayName":"API URL","name":"apiUrl","type":"string","default":"","required":true}],"supportedNodes":["toolSearXng"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolSearXng/searXng.svg"},
18
18
  {"name":"serpApi","displayName":"SerpAPI","documentationUrl":"serp","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"api_key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://serpapi.com","url":"/account.json "}},"supportedNodes":["toolSerpApi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolSerpApi/serpApi.svg"},
19
19
  {"name":"wolframAlphaApi","displayName":"WolframAlphaApi","documentationUrl":"wolframalpha","properties":[{"displayName":"App ID","name":"appId","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"api_key":"={{$credentials.appId}}"}}},"test":{"request":{"baseURL":"https://api.wolframalpha.com/v1","url":"=/simple","qs":{"i":"How much is 1 1","appid":"={{$credentials.appId}}"}}},"supportedNodes":["toolWolframAlpha"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolWolframAlpha/wolfram-alpha.svg"},
20
- {"name":"xAiApi","displayName":"xAi","documentationUrl":"xAi","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"hidden","default":"https://api.x.ai/v1"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/models"}},"supportedNodes":["lmChatXAiGrok"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatXAiGrok/logo.dark.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatXAiGrok/logo.svg"}},
20
+ {"name":"xAiApi","displayName":"xAi","documentationUrl":"xai","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"hidden","default":"https://api.x.ai/v1"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/models"}},"supportedNodes":["lmChatXAiGrok"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatXAiGrok/logo.dark.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatXAiGrok/logo.svg"}},
21
21
  {"name":"xataApi","displayName":"Xata Api","documentationUrl":"xata","properties":[{"displayName":"Database Endpoint","name":"databaseEndpoint","required":true,"type":"string","default":"","placeholder":"https://{workspace}.{region}.xata.sh/db/{database}"},{"displayName":"Branch","name":"branch","required":true,"type":"string","default":"main"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.databaseEndpoint}}:{{$credentials.branch}}"}},"supportedNodes":["memoryXata"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/memory/MemoryXata/xata.svg"},
22
22
  {"name":"zepApi","displayName":"Zep Api","documentationUrl":"zep","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":false,"default":""},{"displayName":"Cloud","description":"Whether you are adding credentials for Zep Cloud instead of Zep Open Source","name":"cloud","type":"boolean","default":false},{"displayName":"API URL","name":"apiUrl","required":false,"type":"string","default":"http://localhost:8000","displayOptions":{"show":{"cloud":[false]}}}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"={{$credentials.apiKey && !$credentials.cloud ? \"Bearer \" + $credentials.apiKey : \"Api-Key \" + $credentials.apiKey }}"}}},"test":{"request":{"baseURL":"={{!$credentials.cloud ? $credentials.apiUrl : \"https://api.getzep.com\"}}","url":"={{!$credentials.cloud ? \"/api/v1/collection\" : \"/api/v2/collections\"}}"}},"supportedNodes":["memoryZep","vectorStoreZep","vectorStoreZepInsert","vectorStoreZepLoad"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/memory/MemoryZep/zep.png"}
23
23
  ]
@@ -88,5 +88,6 @@
88
88
  {"displayName":"Supabase: Load","name":"vectorStoreSupabaseLoad","hidden":true,"group":["transform"],"version":1,"description":"Load data from Supabase Vector Store index","defaults":{"name":"Supabase: Load"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabase/"}]}},"credentials":[{"name":"supabaseApi","required":true}],"inputs":[{"displayName":"Embedding","maxConnections":1,"type":"ai_embedding","required":true}],"outputs":["ai_vectorStore"],"outputNames":["Vector Store"],"properties":[{"displayName":"Table Name","name":"tableName","type":"resourceLocator","default":{"mode":"list","value":""},"required":true,"modes":[{"displayName":"From List","name":"list","type":"list","typeOptions":{"searchListMethod":"supabaseTableNameSearch"}},{"displayName":"ID","name":"id","type":"string"}]},{"displayName":"Query Name","name":"queryName","type":"string","default":"match_documents","required":true,"description":"Name of the query to use for matching documents"},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Metadata Filter","name":"metadata","type":"fixedCollection","description":"Metadata to filter the document by","typeOptions":{"multipleValues":true},"default":{},"placeholder":"Add filter field","options":[{"name":"metadataValues","displayName":"Fields to Set","values":[{"displayName":"Name","name":"name","type":"string","default":"","required":true},{"displayName":"Value","name":"value","type":"string","default":""}]}]}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreSupabaseLoad/supabase.svg"},
89
89
  {"displayName":"Zep Vector Store","name":"vectorStoreZep","description":"Work with your data in Zep Vector Store","group":["transform"],"version":[1,1.1],"defaults":{"name":"Zep Vector Store"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores","Tools","Root Nodes"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezep/"}]}},"credentials":[{"name":"zepApi","required":true}],"inputs":"={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"ai_embedding\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn inputs;\n\t\t\t\t}\n\n\t\t\t\tif (['insert', 'load', 'update'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"\", type: \"main\"})\n\t\t\t\t}\n\n\t\t\t\tif (['insert'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"Document\", type: \"ai_document\", required: true, maxConnections: 1})\n\t\t\t\t}\n\t\t\t\treturn inputs\n\t\t\t})($parameter)\n\t\t}}","outputs":"={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode ?? 'retrieve';\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn [{ displayName: \"Tool\", type: \"ai_tool\"}]\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve') {\n\t\t\t\t\treturn [{ displayName: \"Vector Store\", type: \"ai_vectorStore\"}]\n\t\t\t\t}\n\t\t\t\treturn [{ displayName: \"\", type: \"main\"}]\n\t\t\t})($parameter)\n\t\t}}","properties":[{"displayName":"Operation Mode","name":"mode","type":"options","noDataExpression":true,"default":"retrieve","options":[{"name":"Get Many","value":"load","description":"Get many ranked documents from vector store for query","action":"Get ranked documents from vector store"},{"name":"Insert Documents","value":"insert","description":"Insert documents into vector store","action":"Add documents to vector store"},{"name":"Retrieve Documents (As Vector Store for Chain/Tool)","value":"retrieve","description":"Retrieve documents from vector store to be used as vector store with AI nodes","action":"Retrieve documents for Chain/Tool as Vector Store","outputConnectionType":"ai_vectorStore"},{"name":"Retrieve Documents (As Tool for AI Agent)","value":"retrieve-as-tool","description":"Retrieve documents from vector store to be used as tool with AI nodes","action":"Retrieve documents for AI Agent as Tool","outputConnectionType":"ai_tool"}]},{"displayName":"This node must be connected to a vector store retriever. <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='ai_retriever'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"},"displayOptions":{"show":{"mode":["retrieve"]}}},{"displayName":"Name","name":"toolName","type":"string","default":"","required":true,"description":"Name of the vector store","placeholder":"e.g. company_knowledge_base","validateType":"string-alphanumeric","displayOptions":{"show":{"mode":["retrieve-as-tool"]}}},{"displayName":"Description","name":"toolDescription","type":"string","default":"","required":true,"typeOptions":{"rows":2},"description":"Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often","placeholder":"e.g. Work with your data in Zep Vector Store","displayOptions":{"show":{"mode":["retrieve-as-tool"]}}},{"displayName":"Collection Name","name":"collectionName","type":"string","default":"","required":true},{"displayName":"Embedding Batch Size","name":"embeddingBatchSize","type":"number","default":200,"description":"Number of documents to embed in a single batch","displayOptions":{"show":{"mode":["insert"],"@version":[{"_cnd":{"gte":1.1}}]}}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Embedding Dimensions","name":"embeddingDimensions","type":"number","default":1536,"description":"Whether to allow using characters from the Unicode surrogate blocks"},{"displayName":"Is Auto Embedded","name":"isAutoEmbedded","type":"boolean","default":true,"description":"Whether to automatically embed documents when they are added"}],"displayOptions":{"show":{"mode":["insert"]}}},{"displayName":"Prompt","name":"prompt","type":"string","default":"","required":true,"description":"Search prompt to retrieve matching documents from the vector store using similarity-based ranking","displayOptions":{"show":{"mode":["load"]}}},{"displayName":"Limit","name":"topK","type":"number","default":4,"description":"Number of top results to fetch from vector store","displayOptions":{"show":{"mode":["load","retrieve-as-tool"]}}},{"displayName":"Include Metadata","name":"includeDocumentMetadata","type":"boolean","default":true,"description":"Whether or not to include document metadata","displayOptions":{"show":{"mode":["load","retrieve-as-tool"]}}},{"displayName":"ID","name":"id","type":"string","default":"","required":true,"description":"ID of an embedding entry","displayOptions":{"show":{"mode":["update"]}}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Embedding Dimensions","name":"embeddingDimensions","type":"number","default":1536,"description":"Whether to allow using characters from the Unicode surrogate blocks"},{"displayName":"Metadata Filter","name":"metadata","type":"fixedCollection","description":"Metadata to filter the document by","typeOptions":{"multipleValues":true},"default":{},"placeholder":"Add filter field","options":[{"name":"metadataValues","displayName":"Fields to Set","values":[{"displayName":"Name","name":"name","type":"string","default":"","required":true},{"displayName":"Value","name":"value","type":"string","default":""}]}]}],"displayOptions":{"show":{"mode":["load","retrieve-as-tool"]}}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Embedding Dimensions","name":"embeddingDimensions","type":"number","default":1536,"description":"Whether to allow using characters from the Unicode surrogate blocks"},{"displayName":"Metadata Filter","name":"metadata","type":"fixedCollection","description":"Metadata to filter the document by","typeOptions":{"multipleValues":true},"default":{},"placeholder":"Add filter field","options":[{"name":"metadataValues","displayName":"Fields to Set","values":[{"displayName":"Name","name":"name","type":"string","default":"","required":true},{"displayName":"Value","name":"value","type":"string","default":""}]}]}],"displayOptions":{"show":{"mode":["retrieve"]}}}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreZep/zep.png"},
90
90
  {"displayName":"Zep Vector Store: Insert","name":"vectorStoreZepInsert","hidden":true,"group":["transform"],"version":1,"description":"Insert data into Zep Vector Store index","defaults":{"name":"Zep: Insert"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezep/"}]}},"credentials":[{"name":"zepApi","required":true}],"inputs":["main",{"displayName":"Document","maxConnections":1,"type":"ai_document","required":true},{"displayName":"Embedding","maxConnections":1,"type":"ai_embedding","required":true}],"outputs":["main"],"properties":[{"displayName":"Collection Name","name":"collectionName","type":"string","default":"","required":true},{"displayName":"Specify the document to load in the document loader sub-node","name":"notice","type":"notice","default":""},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Embedding Dimensions","name":"embeddingDimensions","type":"number","default":1536,"description":"Whether to allow using characters from the Unicode surrogate blocks"},{"displayName":"Is Auto Embedded","name":"isAutoEmbedded","type":"boolean","default":true,"description":"Whether to automatically embed documents when they are added"}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreZepInsert/zep.png"},
91
- {"displayName":"Zep Vector Store: Load","name":"vectorStoreZepLoad","hidden":true,"group":["transform"],"version":1,"description":"Load data from Zep Vector Store index","defaults":{"name":"Zep: Load"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezep/"}]}},"credentials":[{"name":"zepApi","required":true}],"inputs":[{"displayName":"Embedding","maxConnections":1,"type":"ai_embedding","required":true}],"outputs":["ai_vectorStore"],"outputNames":["Vector Store"],"properties":[{"displayName":"Collection Name","name":"collectionName","type":"string","default":"","required":true},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Embedding Dimensions","name":"embeddingDimensions","type":"number","default":1536,"description":"Whether to allow using characters from the Unicode surrogate blocks"},{"displayName":"Metadata Filter","name":"metadata","type":"fixedCollection","description":"Metadata to filter the document by","typeOptions":{"multipleValues":true},"default":{},"placeholder":"Add filter field","options":[{"name":"metadataValues","displayName":"Fields to Set","values":[{"displayName":"Name","name":"name","type":"string","default":"","required":true},{"displayName":"Value","name":"value","type":"string","default":""}]}]}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreZepLoad/zep.png"}
91
+ {"displayName":"Zep Vector Store: Load","name":"vectorStoreZepLoad","hidden":true,"group":["transform"],"version":1,"description":"Load data from Zep Vector Store index","defaults":{"name":"Zep: Load"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorezep/"}]}},"credentials":[{"name":"zepApi","required":true}],"inputs":[{"displayName":"Embedding","maxConnections":1,"type":"ai_embedding","required":true}],"outputs":["ai_vectorStore"],"outputNames":["Vector Store"],"properties":[{"displayName":"Collection Name","name":"collectionName","type":"string","default":"","required":true},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Embedding Dimensions","name":"embeddingDimensions","type":"number","default":1536,"description":"Whether to allow using characters from the Unicode surrogate blocks"},{"displayName":"Metadata Filter","name":"metadata","type":"fixedCollection","description":"Metadata to filter the document by","typeOptions":{"multipleValues":true},"default":{},"placeholder":"Add filter field","options":[{"name":"metadataValues","displayName":"Fields to Set","values":[{"displayName":"Name","name":"name","type":"string","default":"","required":true},{"displayName":"Value","name":"value","type":"string","default":""}]}]}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreZepLoad/zep.png"},
92
+ {"displayName":"Tool Executor","name":"toolExecutor","version":1,"defaults":{"name":"Tool Executor"},"hidden":true,"inputs":["main","ai_tool"],"outputs":["main"],"properties":[{"displayName":"Query","name":"query","type":"json","default":"{}","description":"Parameters to pass to the tool as JSON or string"},{"displayName":"Tool Name","name":"toolName","type":"string","default":"","description":"Name of the tool to execute if the connected tool is a toolkit"}],"group":["transform"],"description":"Node to execute tools without an AI Agent","codex":{"categories":["Core Nodes"],"subcategories":{"Core Nodes":["Helpers"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.editimage/"}]}}}
92
93
  ]
@@ -174,7 +174,7 @@ function unwrapNestedOutput(output) {
174
174
  return output;
175
175
  }
176
176
  function nodeNameToToolName(node) {
177
- return node.name.replace(/ /g, "_");
177
+ return node.name.replace(/[\s.?!=+#@&*()[\]{}:;,<>\/\\'"^%$]/g, "_").replace(/_+/g, "_");
178
178
  }
179
179
  // Annotate the CommonJS export names for ESM import in node:
180
180
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../utils/helpers.ts"],"sourcesContent":["import type { BaseChatMessageHistory } from '@langchain/core/chat_history';\nimport type { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseLLM } from '@langchain/core/language_models/llms';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport type { Tool } from '@langchain/core/tools';\nimport { Toolkit } from 'langchain/agents';\nimport type { BaseChatMemory } from 'langchain/memory';\nimport { NodeConnectionTypes, NodeOperationError, jsonStringify } from 'n8n-workflow';\nimport type {\n\tAiEvent,\n\tINode,\n\tIDataObject,\n\tIExecuteFunctions,\n\tISupplyDataFunctions,\n\tIWebhookFunctions,\n} from 'n8n-workflow';\n\nimport { N8nTool } from './N8nTool';\n\nfunction hasMethods<T>(obj: unknown, ...methodNames: Array<string | symbol>): obj is T {\n\treturn methodNames.every(\n\t\t(methodName) =>\n\t\t\ttypeof obj === 'object' &&\n\t\t\tobj !== null &&\n\t\t\tmethodName in obj &&\n\t\t\ttypeof (obj as Record<string | symbol, unknown>)[methodName] === 'function',\n\t);\n}\n\nexport function getMetadataFiltersValues(\n\tctx: IExecuteFunctions | ISupplyDataFunctions,\n\titemIndex: number,\n): Record<string, never> | undefined {\n\tconst options = ctx.getNodeParameter('options', itemIndex, {});\n\n\tif (options.metadata) {\n\t\tconst { metadataValues: metadata } = options.metadata as {\n\t\t\tmetadataValues: Array<{\n\t\t\t\tname: string;\n\t\t\t\tvalue: string;\n\t\t\t}>;\n\t\t};\n\t\tif (metadata.length > 0) {\n\t\t\treturn metadata.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n\t\t}\n\t}\n\n\tif (options.searchFilterJson) {\n\t\treturn ctx.getNodeParameter('options.searchFilterJson', itemIndex, '', {\n\t\t\tensureType: 'object',\n\t\t}) as Record<string, never>;\n\t}\n\n\treturn undefined;\n}\n\nexport function isBaseChatMemory(obj: unknown) {\n\treturn hasMethods<BaseChatMemory>(obj, 'loadMemoryVariables', 'saveContext');\n}\n\nexport function isBaseChatMessageHistory(obj: unknown) {\n\treturn hasMethods<BaseChatMessageHistory>(obj, 'getMessages', 'addMessage');\n}\n\nexport function isChatInstance(model: unknown): model is BaseChatModel {\n\tconst namespace = (model as BaseLLM)?.lc_namespace ?? [];\n\n\treturn namespace.includes('chat_models');\n}\n\nexport function isToolsInstance(model: unknown): model is Tool {\n\tconst namespace = (model as Tool)?.lc_namespace ?? [];\n\n\treturn namespace.includes('tools');\n}\n\nexport function getPromptInputByType(options: {\n\tctx: IExecuteFunctions;\n\ti: number;\n\tpromptTypeKey: string;\n\tinputKey: string;\n}) {\n\tconst { ctx, i, promptTypeKey, inputKey } = options;\n\tconst prompt = ctx.getNodeParameter(promptTypeKey, i) as string;\n\n\tlet input;\n\tif (prompt === 'auto') {\n\t\tinput = ctx.evaluateExpression('{{ $json[\"chatInput\"] }}', i) as string;\n\t} else {\n\t\tinput = ctx.getNodeParameter(inputKey, i) as string;\n\t}\n\n\tif (input === undefined) {\n\t\tthrow new NodeOperationError(ctx.getNode(), 'No prompt specified', {\n\t\t\tdescription:\n\t\t\t\t\"Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter\",\n\t\t});\n\t}\n\n\treturn input;\n}\n\nexport function getSessionId(\n\tctx: ISupplyDataFunctions | IWebhookFunctions,\n\titemIndex: number,\n\tselectorKey = 'sessionIdType',\n\tautoSelect = 'fromInput',\n\tcustomKey = 'sessionKey',\n) {\n\tlet sessionId = '';\n\tconst selectorType = ctx.getNodeParameter(selectorKey, itemIndex) as string;\n\n\tif (selectorType === autoSelect) {\n\t\t// If memory node is used in webhook like node(like chat trigger node), it doesn't have access to evaluateExpression\n\t\t// so we try to extract sessionId from the bodyData\n\t\tif ('getBodyData' in ctx) {\n\t\t\tconst bodyData = ctx.getBodyData() ?? {};\n\t\t\tsessionId = bodyData.sessionId as string;\n\t\t} else {\n\t\t\tsessionId = ctx.evaluateExpression('{{ $json.sessionId }}', itemIndex) as string;\n\t\t}\n\n\t\tif (sessionId === '' || sessionId === undefined) {\n\t\t\tthrow new NodeOperationError(ctx.getNode(), 'No session ID found', {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Expected to find the session ID in an input field called 'sessionId' (this is what the chat trigger node outputs). To use something else, change the 'Session ID' parameter\",\n\t\t\t\titemIndex,\n\t\t\t});\n\t\t}\n\t} else {\n\t\tsessionId = ctx.getNodeParameter(customKey, itemIndex, '') as string;\n\t\tif (sessionId === '' || sessionId === undefined) {\n\t\t\tthrow new NodeOperationError(ctx.getNode(), 'Key parameter is empty', {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Provide a key to use as session ID in the 'Key' parameter or use the 'Connected Chat Trigger Node' option to use the session ID from your Chat Trigger\",\n\t\t\t\titemIndex,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn sessionId;\n}\n\nexport function logAiEvent(\n\texecuteFunctions: IExecuteFunctions | ISupplyDataFunctions,\n\tevent: AiEvent,\n\tdata?: IDataObject,\n) {\n\ttry {\n\t\texecuteFunctions.logAiEvent(event, data ? jsonStringify(data) : undefined);\n\t} catch (error) {\n\t\texecuteFunctions.logger.debug(`Error logging AI event: ${event}`);\n\t}\n}\n\nexport function serializeChatHistory(chatHistory: BaseMessage[]): string {\n\treturn chatHistory\n\t\t.map((chatMessage) => {\n\t\t\tif (chatMessage._getType() === 'human') {\n\t\t\t\treturn `Human: ${chatMessage.content}`;\n\t\t\t} else if (chatMessage._getType() === 'ai') {\n\t\t\t\treturn `Assistant: ${chatMessage.content}`;\n\t\t\t} else {\n\t\t\t\treturn `${chatMessage.content}`;\n\t\t\t}\n\t\t})\n\t\t.join('\\n');\n}\n\nexport function escapeSingleCurlyBrackets(text?: string): string | undefined {\n\tif (text === undefined) return undefined;\n\n\tlet result = text;\n\n\tresult = result\n\t\t// First handle triple brackets to avoid interference with double brackets\n\t\t.replace(/(?<!{){{{(?!{)/g, '{{{{')\n\t\t.replace(/(?<!})}}}(?!})/g, '}}}}')\n\t\t// Then handle single brackets, but only if they're not part of double brackets\n\t\t// Convert single { to {{ if it's not already part of {{ or {{{\n\t\t.replace(/(?<!{){(?!{)/g, '{{')\n\t\t// Convert single } to }} if it's not already part of }} or }}}\n\t\t.replace(/(?<!})}(?!})/g, '}}');\n\n\treturn result;\n}\n\nexport const getConnectedTools = async (\n\tctx: IExecuteFunctions | IWebhookFunctions,\n\tenforceUniqueNames: boolean,\n\tconvertStructuredTool: boolean = true,\n\tescapeCurlyBrackets: boolean = false,\n) => {\n\tconst connectedTools = (\n\t\t((await ctx.getInputConnectionData(NodeConnectionTypes.AiTool, 0)) as Array<Toolkit | Tool>) ??\n\t\t[]\n\t).flatMap((toolOrToolkit) => {\n\t\tif (toolOrToolkit instanceof Toolkit) {\n\t\t\treturn toolOrToolkit.getTools() as Tool[];\n\t\t}\n\n\t\treturn toolOrToolkit;\n\t});\n\n\tif (!enforceUniqueNames) return connectedTools;\n\n\tconst seenNames = new Set<string>();\n\n\tconst finalTools: Tool[] = [];\n\n\tfor (const tool of connectedTools) {\n\t\tconst { name } = tool;\n\t\tif (seenNames.has(name)) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`You have multiple tools with the same name: '${name}', please rename them to avoid conflicts`,\n\t\t\t);\n\t\t}\n\t\tseenNames.add(name);\n\n\t\tif (escapeCurlyBrackets) {\n\t\t\ttool.description = escapeSingleCurlyBrackets(tool.description) ?? tool.description;\n\t\t}\n\n\t\tif (convertStructuredTool && tool instanceof N8nTool) {\n\t\t\tfinalTools.push(tool.asDynamicTool());\n\t\t} else {\n\t\t\tfinalTools.push(tool);\n\t\t}\n\t}\n\n\treturn finalTools;\n};\n\n/**\n * Sometimes model output is wrapped in an additional object property.\n * This function unwraps the output if it is in the format { output: { output: { ... } } }\n */\nexport function unwrapNestedOutput(output: Record<string, unknown>): Record<string, unknown> {\n\tif (\n\t\t'output' in output &&\n\t\tObject.keys(output).length === 1 &&\n\t\ttypeof output.output === 'object' &&\n\t\toutput.output !== null &&\n\t\t'output' in output.output &&\n\t\tObject.keys(output.output).length === 1\n\t) {\n\t\treturn output.output as Record<string, unknown>;\n\t}\n\n\treturn output;\n}\n\nexport function nodeNameToToolName(node: INode): string {\n\treturn node.name.replace(/ /g, '_');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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K,MAAM,EAAE,WAAW,KAC/B,OAAO,OAAO,WAAW,YACzB,OAAO,WAAW,QAClB,YAAY,OAAO,UACnB,OAAO,KAAK,OAAO,MAAM,EAAE,WAAW,GACrC;AACD,WAAO,OAAO;AAAA,EACf;AAEA,SAAO;AACR;AAEO,SAAS,mBAAmB,MAAqB;AACvD,SAAO,KAAK,KAAK,QAAQ,MAAM,GAAG;AACnC;","names":[]}
1
+ {"version":3,"sources":["../../utils/helpers.ts"],"sourcesContent":["import type { BaseChatMessageHistory } from '@langchain/core/chat_history';\nimport type { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseLLM } from '@langchain/core/language_models/llms';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport type { Tool } from '@langchain/core/tools';\nimport { Toolkit } from 'langchain/agents';\nimport type { BaseChatMemory } from 'langchain/memory';\nimport { NodeConnectionTypes, NodeOperationError, jsonStringify } from 'n8n-workflow';\nimport type {\n\tAiEvent,\n\tINode,\n\tIDataObject,\n\tIExecuteFunctions,\n\tISupplyDataFunctions,\n\tIWebhookFunctions,\n} from 'n8n-workflow';\n\nimport { N8nTool } from './N8nTool';\n\nfunction hasMethods<T>(obj: unknown, ...methodNames: Array<string | symbol>): obj is T {\n\treturn methodNames.every(\n\t\t(methodName) =>\n\t\t\ttypeof obj === 'object' &&\n\t\t\tobj !== null &&\n\t\t\tmethodName in obj &&\n\t\t\ttypeof (obj as Record<string | symbol, unknown>)[methodName] === 'function',\n\t);\n}\n\nexport function getMetadataFiltersValues(\n\tctx: IExecuteFunctions | ISupplyDataFunctions,\n\titemIndex: number,\n): Record<string, never> | undefined {\n\tconst options = ctx.getNodeParameter('options', itemIndex, {});\n\n\tif (options.metadata) {\n\t\tconst { metadataValues: metadata } = options.metadata as {\n\t\t\tmetadataValues: Array<{\n\t\t\t\tname: string;\n\t\t\t\tvalue: string;\n\t\t\t}>;\n\t\t};\n\t\tif (metadata.length > 0) {\n\t\t\treturn metadata.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n\t\t}\n\t}\n\n\tif (options.searchFilterJson) {\n\t\treturn ctx.getNodeParameter('options.searchFilterJson', itemIndex, '', {\n\t\t\tensureType: 'object',\n\t\t}) as Record<string, never>;\n\t}\n\n\treturn undefined;\n}\n\nexport function isBaseChatMemory(obj: unknown) {\n\treturn hasMethods<BaseChatMemory>(obj, 'loadMemoryVariables', 'saveContext');\n}\n\nexport function isBaseChatMessageHistory(obj: unknown) {\n\treturn hasMethods<BaseChatMessageHistory>(obj, 'getMessages', 'addMessage');\n}\n\nexport function isChatInstance(model: unknown): model is BaseChatModel {\n\tconst namespace = (model as BaseLLM)?.lc_namespace ?? [];\n\n\treturn namespace.includes('chat_models');\n}\n\nexport function isToolsInstance(model: unknown): model is Tool {\n\tconst namespace = (model as Tool)?.lc_namespace ?? [];\n\n\treturn namespace.includes('tools');\n}\n\nexport function getPromptInputByType(options: {\n\tctx: IExecuteFunctions;\n\ti: number;\n\tpromptTypeKey: string;\n\tinputKey: string;\n}) {\n\tconst { ctx, i, promptTypeKey, inputKey } = options;\n\tconst prompt = ctx.getNodeParameter(promptTypeKey, i) as string;\n\n\tlet input;\n\tif (prompt === 'auto') {\n\t\tinput = ctx.evaluateExpression('{{ $json[\"chatInput\"] }}', i) as string;\n\t} else {\n\t\tinput = ctx.getNodeParameter(inputKey, i) as string;\n\t}\n\n\tif (input === undefined) {\n\t\tthrow new NodeOperationError(ctx.getNode(), 'No prompt specified', {\n\t\t\tdescription:\n\t\t\t\t\"Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter\",\n\t\t});\n\t}\n\n\treturn input;\n}\n\nexport function getSessionId(\n\tctx: ISupplyDataFunctions | IWebhookFunctions,\n\titemIndex: number,\n\tselectorKey = 'sessionIdType',\n\tautoSelect = 'fromInput',\n\tcustomKey = 'sessionKey',\n) {\n\tlet sessionId = '';\n\tconst selectorType = ctx.getNodeParameter(selectorKey, itemIndex) as string;\n\n\tif (selectorType === autoSelect) {\n\t\t// If memory node is used in webhook like node(like chat trigger node), it doesn't have access to evaluateExpression\n\t\t// so we try to extract sessionId from the bodyData\n\t\tif ('getBodyData' in ctx) {\n\t\t\tconst bodyData = ctx.getBodyData() ?? {};\n\t\t\tsessionId = bodyData.sessionId as string;\n\t\t} else {\n\t\t\tsessionId = ctx.evaluateExpression('{{ $json.sessionId }}', itemIndex) as string;\n\t\t}\n\n\t\tif (sessionId === '' || sessionId === undefined) {\n\t\t\tthrow new NodeOperationError(ctx.getNode(), 'No session ID found', {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Expected to find the session ID in an input field called 'sessionId' (this is what the chat trigger node outputs). To use something else, change the 'Session ID' parameter\",\n\t\t\t\titemIndex,\n\t\t\t});\n\t\t}\n\t} else {\n\t\tsessionId = ctx.getNodeParameter(customKey, itemIndex, '') as string;\n\t\tif (sessionId === '' || sessionId === undefined) {\n\t\t\tthrow new NodeOperationError(ctx.getNode(), 'Key parameter is empty', {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Provide a key to use as session ID in the 'Key' parameter or use the 'Connected Chat Trigger Node' option to use the session ID from your Chat Trigger\",\n\t\t\t\titemIndex,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn sessionId;\n}\n\nexport function logAiEvent(\n\texecuteFunctions: IExecuteFunctions | ISupplyDataFunctions,\n\tevent: AiEvent,\n\tdata?: IDataObject,\n) {\n\ttry {\n\t\texecuteFunctions.logAiEvent(event, data ? jsonStringify(data) : undefined);\n\t} catch (error) {\n\t\texecuteFunctions.logger.debug(`Error logging AI event: ${event}`);\n\t}\n}\n\nexport function serializeChatHistory(chatHistory: BaseMessage[]): string {\n\treturn chatHistory\n\t\t.map((chatMessage) => {\n\t\t\tif (chatMessage._getType() === 'human') {\n\t\t\t\treturn `Human: ${chatMessage.content}`;\n\t\t\t} else if (chatMessage._getType() === 'ai') {\n\t\t\t\treturn `Assistant: ${chatMessage.content}`;\n\t\t\t} else {\n\t\t\t\treturn `${chatMessage.content}`;\n\t\t\t}\n\t\t})\n\t\t.join('\\n');\n}\n\nexport function escapeSingleCurlyBrackets(text?: string): string | undefined {\n\tif (text === undefined) return undefined;\n\n\tlet result = text;\n\n\tresult = result\n\t\t// First handle triple brackets to avoid interference with double brackets\n\t\t.replace(/(?<!{){{{(?!{)/g, '{{{{')\n\t\t.replace(/(?<!})}}}(?!})/g, '}}}}')\n\t\t// Then handle single brackets, but only if they're not part of double brackets\n\t\t// Convert single { to {{ if it's not already part of {{ or {{{\n\t\t.replace(/(?<!{){(?!{)/g, '{{')\n\t\t// Convert single } to }} if it's not already part of }} or }}}\n\t\t.replace(/(?<!})}(?!})/g, '}}');\n\n\treturn result;\n}\n\nexport const getConnectedTools = async (\n\tctx: IExecuteFunctions | IWebhookFunctions,\n\tenforceUniqueNames: boolean,\n\tconvertStructuredTool: boolean = true,\n\tescapeCurlyBrackets: boolean = false,\n) => {\n\tconst connectedTools = (\n\t\t((await ctx.getInputConnectionData(NodeConnectionTypes.AiTool, 0)) as Array<Toolkit | Tool>) ??\n\t\t[]\n\t).flatMap((toolOrToolkit) => {\n\t\tif (toolOrToolkit instanceof Toolkit) {\n\t\t\treturn toolOrToolkit.getTools() as Tool[];\n\t\t}\n\n\t\treturn toolOrToolkit;\n\t});\n\n\tif (!enforceUniqueNames) return connectedTools;\n\n\tconst seenNames = new Set<string>();\n\n\tconst finalTools: Tool[] = [];\n\n\tfor (const tool of connectedTools) {\n\t\tconst { name } = tool;\n\t\tif (seenNames.has(name)) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`You have multiple tools with the same name: '${name}', please rename them to avoid conflicts`,\n\t\t\t);\n\t\t}\n\t\tseenNames.add(name);\n\n\t\tif (escapeCurlyBrackets) {\n\t\t\ttool.description = escapeSingleCurlyBrackets(tool.description) ?? tool.description;\n\t\t}\n\n\t\tif (convertStructuredTool && tool instanceof N8nTool) {\n\t\t\tfinalTools.push(tool.asDynamicTool());\n\t\t} else {\n\t\t\tfinalTools.push(tool);\n\t\t}\n\t}\n\n\treturn finalTools;\n};\n\n/**\n * Sometimes model output is wrapped in an additional object property.\n * This function unwraps the output if it is in the format { output: { output: { ... } } }\n */\nexport function unwrapNestedOutput(output: Record<string, unknown>): Record<string, unknown> {\n\tif (\n\t\t'output' in output &&\n\t\tObject.keys(output).length === 1 &&\n\t\ttypeof output.output === 'object' &&\n\t\toutput.output !== null &&\n\t\t'output' in output.output &&\n\t\tObject.keys(output.output).length === 1\n\t) {\n\t\treturn output.output as Record<string, unknown>;\n\t}\n\n\treturn output;\n}\n\n/**\n * Converts a node name to a valid tool name by replacing special characters with underscores\n * and collapsing consecutive underscores into a single one.\n */\nexport function nodeNameToToolName(node: INode): string {\n\treturn node.name.replace(/[\\s.?!=+#@&*()[\\]{}:;,<>\\/\\\\'\"^%$]/g, '_').replace(/_+/g, '_');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAAwB;AAExB,0BAAuE;AAUvE,qBAAwB;AAExB,SAAS,WAAc,QAAiB,aAA+C;AACtF,SAAO,YAAY;AAAA,IAClB,CAAC,eACA,OAAO,QAAQ,YACf,QAAQ,QACR,cAAc,OACd,OAAQ,IAAyC,UAAU,MAAM;AAAA,EACnE;AACD;AAEO,SAAS,yBACf,KACA,WACoC;AACpC,QAAM,UAAU,IAAI,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAE7D,MAAI,QAAQ,UAAU;AACrB,UAAM,EAAE,gBAAgB,SAAS,IAAI,QAAQ;AAM7C,QAAI,SAAS,SAAS,GAAG;AACxB,aAAO,SAAS,OAAO,CAAC,KAAK,EAAE,MAAM,MAAM,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,CAAC;AAAA,IACjF;AAAA,EACD;AAEA,MAAI,QAA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AAI,yBAAyB,uBAAS;AACrC,aAAO,cAAc,SAAS;AAAA,IAC/B;AAEA,WAAO;AAAA,EACR,CAAC;AAED,MAAI,CAAC,mBAAoB,QAAO;AAEhC,QAAM,YAAY,oBAAI,IAAY;AAElC,QAAM,aAAqB,CAAC;AAE5B,aAAW,QAAQ,gBAAgB;AAClC,UAAM,EAAE,KAAK,IAAI;AACjB,QAAI,UAAU,IAAI,IAAI,GAAG;AACxB,YAAM,IAAI;AAAA,QACT,IAAI,QAAQ;AAAA,QACZ,gDAAgD,IAAI;AAAA,MACrD;AAAA,IACD;AACA,cAAU,IAAI,IAAI;AAElB,QAAI,qBAAqB;AACxB,WAAK,cAAc,0BAA0B,KAAK,WAAW,KAAK,KAAK;AAAA,IACxE;AAEA,QAAI,yBAAyB,gBAAgB,wBAAS;AACrD,iBAAW,KAAK,KAAK,cAAc,CAAC;AAAA,IACrC,OAAO;AACN,iBAAW,KAAK,IAAI;AAAA,IACrB;AAAA,EACD;AAEA,SAAO;AACR;AAMO,SAAS,mBAAmB,QAA0D;AAC5F,MACC,YAAY,UACZ,OAAO,KAAK,MAAM,EAAE,WAAW,KAC/B,OAAO,OAAO,WAAW,YACzB,OAAO,WAAW,QAClB,YAAY,OAAO,UACnB,OAAO,KAAK,OAAO,MAAM,EAAE,WAAW,GACrC;AACD,WAAO,OAAO;AAAA,EACf;AAEA,SAAO;AACR;AAMO,SAAS,mBAAmB,MAAqB;AACvD,SAAO,KAAK,KAAK,QAAQ,uCAAuC,GAAG,EAAE,QAAQ,OAAO,GAAG;AACxF;","names":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@n8n/n8n-nodes-langchain",
3
- "version": "1.92.2",
3
+ "version": "1.93.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "dist",
8
- "LICENSE_EE.md",
9
- "LICENSE.md"
8
+ "LICENSE.md",
9
+ "LICENSE_EE.md"
10
10
  ],
11
11
  "n8n": {
12
12
  "n8nNodesApiVersion": 1,
@@ -121,7 +121,8 @@
121
121
  "dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js",
122
122
  "dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js",
123
123
  "dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js",
124
- "dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js"
124
+ "dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js",
125
+ "dist/nodes/ToolExecutor/ToolExecutor.node.js"
125
126
  ]
126
127
  },
127
128
  "devDependencies": {
@@ -134,7 +135,7 @@
134
135
  "@types/sanitize-html": "^2.11.0",
135
136
  "@types/temp": "^0.9.1",
136
137
  "tsup": "^8.4.0",
137
- "n8n-core": "1.91.0"
138
+ "n8n-core": "1.92.0"
138
139
  },
139
140
  "dependencies": {
140
141
  "@aws-sdk/client-sso-oidc": "3.666.0",
@@ -161,7 +162,7 @@
161
162
  "@langchain/qdrant": "0.1.1",
162
163
  "@langchain/redis": "0.1.0",
163
164
  "@langchain/textsplitters": "0.1.0",
164
- "@modelcontextprotocol/sdk": "1.9.0",
165
+ "@modelcontextprotocol/sdk": "1.11.0",
165
166
  "@mozilla/readability": "0.6.0",
166
167
  "@n8n/typeorm": "0.3.20-12",
167
168
  "@n8n/vm2": "3.9.25",
@@ -194,11 +195,11 @@
194
195
  "tmp-promise": "3.0.3",
195
196
  "zod": "3.24.1",
196
197
  "zod-to-json-schema": "3.23.3",
197
- "@n8n/client-oauth2": "0.24.0",
198
198
  "@n8n/typescript-config": "1.2.0",
199
- "n8n-nodes-base": "1.91.1",
200
- "n8n-workflow": "1.90.0",
201
- "@n8n/json-schema-to-zod": "1.3.0"
199
+ "@n8n/json-schema-to-zod": "1.3.0",
200
+ "n8n-workflow": "1.91.0",
201
+ "@n8n/client-oauth2": "0.24.0",
202
+ "n8n-nodes-base": "1.92.0"
202
203
  },
203
204
  "license": "SEE LICENSE IN LICENSE.md",
204
205
  "homepage": "https://n8n.io",