@n8n/n8n-nodes-langchain 2.4.4 → 2.4.5
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.
|
@@ -25,7 +25,8 @@ __export(VectorStoreAzureAISearch_node_exports, {
|
|
|
25
25
|
SEMANTIC_CONFIGURATION: () => SEMANTIC_CONFIGURATION,
|
|
26
26
|
VectorStoreAzureAISearch: () => VectorStoreAzureAISearch,
|
|
27
27
|
clearAzureSearchIndex: () => clearAzureSearchIndex,
|
|
28
|
-
getIndexName: () => getIndexName
|
|
28
|
+
getIndexName: () => getIndexName,
|
|
29
|
+
transformDocumentsForAzure: () => transformDocumentsForAzure
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(VectorStoreAzureAISearch_node_exports);
|
|
31
32
|
var import_search_documents = require("@azure/search-documents");
|
|
@@ -115,6 +116,14 @@ const insertFields = [
|
|
|
115
116
|
type: "boolean",
|
|
116
117
|
default: false,
|
|
117
118
|
description: "Whether to delete and recreate the index before inserting new data. Warning: This will reset any custom index configuration (semantic ranking, analyzers, etc.) to defaults."
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: "Metadata Keys to Insert",
|
|
122
|
+
name: "metadataKeysToInsert",
|
|
123
|
+
type: "string",
|
|
124
|
+
default: "",
|
|
125
|
+
placeholder: "e.g., source,author,category",
|
|
126
|
+
description: 'Comma-separated list of metadata keys to store in Azure AI Search. Leave empty to include all metadata. Azure AI Search stores metadata in an "attributes" array format.'
|
|
118
127
|
}
|
|
119
128
|
]
|
|
120
129
|
}
|
|
@@ -262,6 +271,25 @@ function getQueryType(context, itemIndex) {
|
|
|
262
271
|
return import_azure_aisearch.AzureAISearchQueryType.SimilarityHybrid;
|
|
263
272
|
}
|
|
264
273
|
}
|
|
274
|
+
function transformDocumentsForAzure(documents, metadataKeysToInclude) {
|
|
275
|
+
return documents.map((doc) => {
|
|
276
|
+
const originalMetadata = doc.metadata;
|
|
277
|
+
const keysToProcess = metadataKeysToInclude.length > 0 ? metadataKeysToInclude : Object.keys(originalMetadata);
|
|
278
|
+
const attributes = keysToProcess.filter(
|
|
279
|
+
(key) => Object.prototype.hasOwnProperty.call(originalMetadata, key) && originalMetadata[key] !== null && originalMetadata[key] !== void 0
|
|
280
|
+
).map((key) => ({
|
|
281
|
+
key,
|
|
282
|
+
value: String(originalMetadata[key])
|
|
283
|
+
}));
|
|
284
|
+
return {
|
|
285
|
+
...doc,
|
|
286
|
+
metadata: {
|
|
287
|
+
...originalMetadata,
|
|
288
|
+
attributes
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
});
|
|
292
|
+
}
|
|
265
293
|
class VectorStoreAzureAISearch extends (0, import_createVectorStoreNode.createVectorStoreNode)({
|
|
266
294
|
meta: {
|
|
267
295
|
displayName: "Azure AI Search Vector Store",
|
|
@@ -314,8 +342,15 @@ class VectorStoreAzureAISearch extends (0, import_createVectorStoreNode.createVe
|
|
|
314
342
|
async populateVectorStore(context, embeddings, documents, itemIndex) {
|
|
315
343
|
try {
|
|
316
344
|
await clearAzureSearchIndex(context, itemIndex);
|
|
345
|
+
const metadataKeysToInsertRaw = getOptionValue(
|
|
346
|
+
"metadataKeysToInsert",
|
|
347
|
+
context,
|
|
348
|
+
itemIndex
|
|
349
|
+
);
|
|
350
|
+
const metadataKeysToInsert = metadataKeysToInsertRaw ? metadataKeysToInsertRaw.split(",").map((k) => k.trim()).filter((k) => k.length > 0) : [];
|
|
351
|
+
const transformedDocuments = transformDocumentsForAzure(documents, metadataKeysToInsert);
|
|
317
352
|
const vectorStore = await getAzureAISearchClient(context, embeddings, itemIndex);
|
|
318
|
-
await vectorStore.addDocuments(
|
|
353
|
+
await vectorStore.addDocuments(transformedDocuments);
|
|
319
354
|
} catch (error) {
|
|
320
355
|
context.logger.debug("Azure AI Search error details:", {
|
|
321
356
|
message: error instanceof Error ? error.message : String(error),
|
|
@@ -383,6 +418,7 @@ Check the console logs for detailed error information.`
|
|
|
383
418
|
SEMANTIC_CONFIGURATION,
|
|
384
419
|
VectorStoreAzureAISearch,
|
|
385
420
|
clearAzureSearchIndex,
|
|
386
|
-
getIndexName
|
|
421
|
+
getIndexName,
|
|
422
|
+
transformDocumentsForAzure
|
|
387
423
|
});
|
|
388
424
|
//# sourceMappingURL=VectorStoreAzureAISearch.node.js.map
|
package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.ts"],"sourcesContent":["import { AzureKeyCredential, SearchIndexClient } from '@azure/search-documents';\nimport {\n\tAzureAISearchVectorStore,\n\tAzureAISearchQueryType,\n} from '@langchain/community/vectorstores/azure_aisearch';\nimport type { EmbeddingsInterface } from '@langchain/core/embeddings';\nimport {\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype ILoadOptionsFunctions,\n\ttype INodeProperties,\n\ttype IExecuteFunctions,\n\ttype ISupplyDataFunctions,\n} from 'n8n-workflow';\n\nimport { createVectorStoreNode } from '../shared/createVectorStoreNode/createVectorStoreNode';\n\n// User agent for usage tracking\nconst USER_AGENT_PREFIX = 'n8n-azure-ai-search';\n\nexport const AZURE_AI_SEARCH_CREDENTIALS = 'azureAiSearchApi';\nexport const INDEX_NAME = 'indexName';\nexport const QUERY_TYPE = 'queryType';\nexport const FILTER = 'filter';\nexport const SEMANTIC_CONFIGURATION = 'semanticConfiguration';\n\nconst indexNameField: INodeProperties = {\n\tdisplayName: 'Index Name',\n\tname: INDEX_NAME,\n\ttype: 'string',\n\tdefault: 'n8n-vectorstore',\n\tdescription:\n\t\t'The name of the Azure AI Search index. Will be created automatically if it does not exist.',\n\trequired: true,\n};\n\nconst queryTypeField: INodeProperties = {\n\tdisplayName: 'Query Type',\n\tname: QUERY_TYPE,\n\ttype: 'options',\n\tdefault: 'hybrid',\n\tdescription: 'The type of search query to perform',\n\toptions: [\n\t\t{\n\t\t\tname: 'Vector',\n\t\t\tvalue: 'vector',\n\t\t\tdescription: 'Vector similarity search only',\n\t\t},\n\t\t{\n\t\t\tname: 'Hybrid',\n\t\t\tvalue: 'hybrid',\n\t\t\tdescription: 'Combines vector and keyword search (recommended)',\n\t\t},\n\t\t{\n\t\t\tname: 'Semantic Hybrid',\n\t\t\tvalue: 'semanticHybrid',\n\t\t\tdescription: 'Hybrid search with semantic ranking (requires Basic tier or higher)',\n\t\t},\n\t],\n};\n\nconst filterField: INodeProperties = {\n\tdisplayName: 'Filter',\n\tname: FILTER,\n\ttype: 'string',\n\tdefault: '',\n\tdescription:\n\t\t'Filter results using OData syntax. Use metadata/fieldName for metadata fields. <a href=\"https://learn.microsoft.com/en-us/azure/search/search-query-odata-filter\" target=\"_blank\">Learn more</a>.',\n\tplaceholder: \"metadata/category eq 'technology' and metadata/author eq 'John'\",\n};\n\nconst semanticConfigurationField: INodeProperties = {\n\tdisplayName: 'Semantic Configuration',\n\tname: SEMANTIC_CONFIGURATION,\n\ttype: 'string',\n\tdefault: '',\n\tdescription: 'Name of the semantic configuration for semantic ranking (optional)',\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t[QUERY_TYPE]: ['semanticHybrid'],\n\t\t},\n\t},\n};\n\nconst sharedFields: INodeProperties[] = [indexNameField];\n\nconst retrieveFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [queryTypeField, filterField, semanticConfigurationField],\n\t},\n];\n\nconst insertFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Clear Index',\n\t\t\t\tname: 'clearIndex',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to delete and recreate the index before inserting new data. Warning: This will reset any custom index configuration (semantic ranking, analyzers, etc.) to defaults.',\n\t\t\t},\n\t\t],\n\t},\n];\n\ntype IFunctionsContext = IExecuteFunctions | ISupplyDataFunctions | ILoadOptionsFunctions;\n\nfunction isExecutionContext(\n\tcontext: IFunctionsContext,\n): context is IExecuteFunctions | ISupplyDataFunctions {\n\t// IExecuteFunctions and ISupplyDataFunctions have addInputData method\n\t// ILoadOptionsFunctions does not\n\treturn 'addInputData' in context;\n}\n\nfunction getParameter(key: string, context: IFunctionsContext, itemIndex: number): string {\n\tlet value: unknown;\n\n\tif (isExecutionContext(context)) {\n\t\t// Execution context: includes itemIndex parameter\n\t\tvalue = context.getNodeParameter(key, itemIndex, '', { extractValue: true });\n\t} else {\n\t\t// Load options context: no itemIndex parameter\n\t\tvalue = context.getNodeParameter(key, '', { extractValue: true });\n\t}\n\n\tif (typeof value !== 'string') {\n\t\tthrow new NodeOperationError(context.getNode(), `Parameter ${key} must be a string`);\n\t}\n\treturn value;\n}\n\nexport const getIndexName = getParameter.bind(null, INDEX_NAME);\n\nfunction getOptionValue<T>(\n\tname: string,\n\tcontext: IExecuteFunctions | ISupplyDataFunctions,\n\titemIndex: number,\n\tdefaultValue?: T,\n): T | undefined {\n\tconst options: IDataObject = context.getNodeParameter('options', itemIndex, {});\n\treturn options[name] !== undefined ? (options[name] as T) : defaultValue;\n}\n\ninterface ValidatedCredentials {\n\tendpoint: string;\n\tapiKey: string;\n}\n\nasync function getValidatedCredentials(\n\tcontext: IFunctionsContext,\n\titemIndex: number,\n): Promise<ValidatedCredentials> {\n\tconst credentials = await context.getCredentials(AZURE_AI_SEARCH_CREDENTIALS);\n\n\tif (!credentials.endpoint || typeof credentials.endpoint !== 'string') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\t'Azure AI Search endpoint is missing or invalid',\n\t\t\t{ itemIndex },\n\t\t);\n\t}\n\n\tif (!credentials.apiKey || typeof credentials.apiKey !== 'string') {\n\t\tthrow new NodeOperationError(context.getNode(), 'API Key is required for authentication', {\n\t\t\titemIndex,\n\t\t});\n\t}\n\n\treturn {\n\t\tendpoint: credentials.endpoint,\n\t\tapiKey: credentials.apiKey,\n\t};\n}\n\n/**\n * Deletes an Azure AI Search index if clearIndex option is enabled.\n * Exported for testing purposes.\n */\nexport async function clearAzureSearchIndex(\n\tcontext: IFunctionsContext,\n\titemIndex: number,\n): Promise<boolean> {\n\tconst options = context.getNodeParameter('options', itemIndex, {}) as {\n\t\tclearIndex?: boolean;\n\t};\n\n\tif (!options.clearIndex) {\n\t\treturn false;\n\t}\n\n\tconst credentials = await getValidatedCredentials(context, itemIndex);\n\tconst indexName = getIndexName(context, itemIndex);\n\n\ttry {\n\t\tconst indexClient = new SearchIndexClient(\n\t\t\tcredentials.endpoint,\n\t\t\tnew AzureKeyCredential(credentials.apiKey),\n\t\t);\n\t\tawait indexClient.deleteIndex(indexName);\n\t\tcontext.logger.debug(`Deleted Azure AI Search index: ${indexName}`);\n\t\treturn true;\n\t} catch (deleteError) {\n\t\t// Log the error but don't fail - index might not exist yet\n\t\tcontext.logger.debug('Error deleting index (may not exist):', {\n\t\t\tmessage: deleteError instanceof Error ? deleteError.message : String(deleteError),\n\t\t});\n\t\treturn false;\n\t}\n}\n\nasync function getAzureAISearchClient(\n\tcontext: IFunctionsContext,\n\tembeddings: EmbeddingsInterface,\n\titemIndex: number,\n): Promise<AzureAISearchVectorStore> {\n\tconst credentials = await getValidatedCredentials(context, itemIndex);\n\n\ttry {\n\t\tconst indexName = getIndexName(context, itemIndex);\n\t\tconst azureCredentials = new AzureKeyCredential(credentials.apiKey);\n\n\t\t// Pass endpoint, indexName, and credentials to enable automatic index creation\n\t\t// LangChain will create the index automatically if it doesn't exist\n\t\tconst config: any = {\n\t\t\tendpoint: credentials.endpoint,\n\t\t\tindexName,\n\t\t\tcredentials: azureCredentials,\n\t\t\tsearch: {},\n\t\t\t// Add custom user agent for usage tracking\n\t\t\tclientOptions: {\n\t\t\t\tuserAgentOptions: { userAgentPrefix: USER_AGENT_PREFIX },\n\t\t\t},\n\t\t};\n\n\t\t// Set search configuration options only for execution contexts\n\t\tif (isExecutionContext(context)) {\n\t\t\tconst queryType = getQueryType(context, itemIndex);\n\t\t\tconst semanticConfiguration = getOptionValue<string>(\n\t\t\t\t'semanticConfiguration',\n\t\t\t\tcontext,\n\t\t\t\titemIndex,\n\t\t\t);\n\t\t\tconst filter = getOptionValue<string>('filter', context, itemIndex);\n\n\t\t\tconfig.search.type = queryType;\n\n\t\t\tif (filter) {\n\t\t\t\tconfig.search.filter = filter;\n\t\t\t}\n\n\t\t\tif (queryType === AzureAISearchQueryType.SemanticHybrid && semanticConfiguration) {\n\t\t\t\tconfig.search.semanticConfigurationName = semanticConfiguration;\n\t\t\t}\n\t\t}\n\n\t\treturn new AzureAISearchVectorStore(embeddings, config);\n\t} catch (error) {\n\t\tif (error instanceof NodeOperationError) {\n\t\t\tthrow error;\n\t\t}\n\n\t\t// Log the full error for debugging\n\t\tcontext.logger.debug('Azure AI Search connection error:', {\n\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\tcode: (error as any).code,\n\t\t\tstatusCode: (error as any).statusCode,\n\t\t\tdetails: (error as any).details,\n\t\t});\n\n\t\t// Check for authentication errors\n\t\tif (\n\t\t\terror.message?.includes('401') ||\n\t\t\terror.message?.includes('Unauthorized') ||\n\t\t\terror.message?.includes('authentication failed')\n\t\t) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Authentication failed - invalid API key or endpoint.',\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Please verify your API Key and Search Endpoint are correct in the credentials configuration.',\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\t// Check for authorization errors (403)\n\t\tif (error.message?.includes('403') || error.message?.includes('Forbidden')) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Authorization failed - insufficient permissions.',\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The API Key does not have sufficient permissions. Ensure the key has the required access level for this operation.',\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\tthrow new NodeOperationError(context.getNode(), `Error: ${errorMessage}`, {\n\t\t\titemIndex,\n\t\t\tdescription: 'Please check your Azure AI Search connection details',\n\t\t});\n\t}\n}\n\nfunction getQueryType(\n\tcontext: IExecuteFunctions | ISupplyDataFunctions,\n\titemIndex: number,\n): AzureAISearchQueryType {\n\tconst queryType = getOptionValue<string>('queryType', context, itemIndex, 'hybrid');\n\n\tswitch (queryType) {\n\t\tcase 'vector':\n\t\t\treturn AzureAISearchQueryType.Similarity;\n\t\tcase 'hybrid':\n\t\t\treturn AzureAISearchQueryType.SimilarityHybrid;\n\t\tcase 'semanticHybrid':\n\t\t\treturn AzureAISearchQueryType.SemanticHybrid;\n\t\tdefault:\n\t\t\treturn AzureAISearchQueryType.SimilarityHybrid;\n\t}\n}\n\nexport class VectorStoreAzureAISearch extends createVectorStoreNode({\n\tmeta: {\n\t\tdisplayName: 'Azure AI Search Vector Store',\n\t\tname: 'vectorStoreAzureAISearch',\n\t\tdescription: 'Work with your data in Azure AI Search Vector Store',\n\t\ticon: { light: 'file:azure-aisearch.svg', dark: 'file:azure-aisearch.svg' },\n\t\tdocsUrl:\n\t\t\t'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreazureaisearch/',\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'azureAiSearchApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toperationModes: ['load', 'insert', 'retrieve', 'update', 'retrieve-as-tool'],\n\t},\n\tsharedFields,\n\tretrieveFields,\n\tloadFields: retrieveFields,\n\tinsertFields,\n\tasync getVectorStoreClient(context, _filter, embeddings, itemIndex) {\n\t\tconst vectorStore = await getAzureAISearchClient(context, embeddings, itemIndex);\n\n\t\t// Apply OData filter to search methods if specified in options\n\t\tif (isExecutionContext(context)) {\n\t\t\tconst filter = getOptionValue<string>('filter', context, itemIndex);\n\n\t\t\tif (filter) {\n\t\t\t\t// Per LangChain docs, pass filter as 3rd parameter with filterExpression\n\t\t\t\tconst filterObject = { filterExpression: filter };\n\n\t\t\t\t// Override similaritySearchVectorWithScore - this is the method called by n8n base node\n\t\t\t\tconst originalSearchVectorWithScore =\n\t\t\t\t\tvectorStore.similaritySearchVectorWithScore.bind(vectorStore);\n\t\t\t\tvectorStore.similaritySearchVectorWithScore = async (\n\t\t\t\t\tquery: number[],\n\t\t\t\t\tk: number,\n\t\t\t\t\tadditionalFilter?: any,\n\t\t\t\t) => {\n\t\t\t\t\t// Merge our OData filter with any additional filter passed by the caller\n\t\t\t\t\tconst mergedFilter = additionalFilter\n\t\t\t\t\t\t? { ...filterObject, ...additionalFilter }\n\t\t\t\t\t\t: filterObject;\n\t\t\t\t\treturn await originalSearchVectorWithScore(query, k, mergedFilter);\n\t\t\t\t};\n\n\t\t\t\t// Override similaritySearch to pass filter as 3rd parameter\n\t\t\t\tconst originalSearch = vectorStore.similaritySearch.bind(vectorStore);\n\t\t\t\tvectorStore.similaritySearch = async (query: string, k?: number) => {\n\t\t\t\t\treturn await originalSearch(query, k, filterObject);\n\t\t\t\t};\n\n\t\t\t\t// Override similaritySearchWithScore to pass filter as 3rd parameter\n\t\t\t\tconst originalSearchWithScore = vectorStore.similaritySearchWithScore.bind(vectorStore);\n\t\t\t\tvectorStore.similaritySearchWithScore = async (query: string, k?: number) => {\n\t\t\t\t\treturn await originalSearchWithScore(query, k, filterObject);\n\t\t\t\t};\n\n\t\t\t\t// Override asRetriever to inject filter into retriever options\n\t\t\t\tconst originalAsRetriever = vectorStore.asRetriever.bind(vectorStore);\n\t\t\t\tvectorStore.asRetriever = (kwargs?: any) => {\n\t\t\t\t\treturn originalAsRetriever({\n\t\t\t\t\t\t...kwargs,\n\t\t\t\t\t\tfilter: filterObject,\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn vectorStore;\n\t},\n\tasync populateVectorStore(context, embeddings, documents, itemIndex) {\n\t\ttry {\n\t\t\t// Clear the index if requested (delete and recreate)\n\t\t\tawait clearAzureSearchIndex(context, itemIndex);\n\n\t\t\t// Get vector store client (will auto-create index if it doesn't exist)\n\t\t\tconst vectorStore = await getAzureAISearchClient(context, embeddings, itemIndex);\n\n\t\t\t// Add documents to Azure AI Search (framework handles batching)\n\t\t\tawait vectorStore.addDocuments(documents);\n\t\t} catch (error) {\n\t\t\t// Log the full error for debugging\n\t\t\tcontext.logger.debug('Azure AI Search error details:', {\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\tcode: (error as any).code,\n\t\t\t\tstatusCode: (error as any).statusCode,\n\t\t\t\tdetails: (error as any).details,\n\t\t\t\tstack: error instanceof Error ? error.stack : undefined,\n\t\t\t});\n\n\t\t\t// Check for authentication errors\n\t\t\tif (\n\t\t\t\terror.message?.includes('401') ||\n\t\t\t\terror.message?.includes('Unauthorized') ||\n\t\t\t\terror.message?.includes('authentication failed')\n\t\t\t) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t'Authentication failed during document upload - invalid API key or endpoint.',\n\t\t\t\t\t{\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Please verify your API Key and Search Endpoint are correct in the credentials configuration.',\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check for authorization errors\n\t\t\tif (\n\t\t\t\terror.message?.includes('403') ||\n\t\t\t\terror.message?.includes('Forbidden') ||\n\t\t\t\t(error as any).statusCode === 403\n\t\t\t) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t'Authorization failed - insufficient permissions for document upload.',\n\t\t\t\t\t{\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The API Key does not have sufficient permissions for write operations. Ensure the key has the required access level.',\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check for RestError (common Azure SDK error)\n\t\t\tif ((error as any).name === 'RestError' || error.message?.includes('RestError')) {\n\t\t\t\tconst statusCode = (error as any).statusCode || 'unknown';\n\t\t\t\tconst errorCode = (error as any).code || 'unknown';\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t`Azure AI Search API error (${statusCode}): ${errorMessage}`,\n\t\t\t\t\t{\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\tdescription: `Error code: ${errorCode}\\n\\nCommon causes:\\n- Invalid endpoint URL\\n- Index doesn't exist\\n- Authentication/authorization issues\\n- API version mismatch\\n\\nCheck the console logs for detailed error information.`,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\tthrow new NodeOperationError(context.getNode(), `Error: ${errorMessage}`, {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check your Azure AI Search connection details and index configuration',\n\t\t\t});\n\t\t}\n\t},\n}) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAsD;AACtD,4BAGO;AAEP,0BAOO;AAEP,mCAAsC;AAGtC,MAAM,oBAAoB;AAEnB,MAAM,8BAA8B;AACpC,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,SAAS;AACf,MAAM,yBAAyB;AAEtC,MAAM,iBAAkC;AAAA,EACvC,aAAa;AA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tC;AAAA,QACD;AAAA,MACD;AAEA,YAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC1E,YAAM,IAAI,uCAAmB,QAAQ,QAAQ,GAAG,UAAU,YAAY,IAAI;AAAA,QACzE;AAAA,QACA,aAAa;AAAA,MACd,CAAC;AAAA,IACF;AAAA,EACD;AACD,CAAC,EAAE;AAAC;","names":["errorMessage"]}
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.ts"],"sourcesContent":["import { AzureKeyCredential, SearchIndexClient } from '@azure/search-documents';\nimport {\n\tAzureAISearchVectorStore,\n\tAzureAISearchQueryType,\n} from '@langchain/community/vectorstores/azure_aisearch';\nimport type { Document } from '@langchain/core/documents';\nimport type { EmbeddingsInterface } from '@langchain/core/embeddings';\nimport {\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype ILoadOptionsFunctions,\n\ttype INodeProperties,\n\ttype IExecuteFunctions,\n\ttype ISupplyDataFunctions,\n} from 'n8n-workflow';\n\nimport { createVectorStoreNode } from '../shared/createVectorStoreNode/createVectorStoreNode';\n\n// User agent for usage tracking\nconst USER_AGENT_PREFIX = 'n8n-azure-ai-search';\n\nexport const AZURE_AI_SEARCH_CREDENTIALS = 'azureAiSearchApi';\nexport const INDEX_NAME = 'indexName';\nexport const QUERY_TYPE = 'queryType';\nexport const FILTER = 'filter';\nexport const SEMANTIC_CONFIGURATION = 'semanticConfiguration';\n\nconst indexNameField: INodeProperties = {\n\tdisplayName: 'Index Name',\n\tname: INDEX_NAME,\n\ttype: 'string',\n\tdefault: 'n8n-vectorstore',\n\tdescription:\n\t\t'The name of the Azure AI Search index. Will be created automatically if it does not exist.',\n\trequired: true,\n};\n\nconst queryTypeField: INodeProperties = {\n\tdisplayName: 'Query Type',\n\tname: QUERY_TYPE,\n\ttype: 'options',\n\tdefault: 'hybrid',\n\tdescription: 'The type of search query to perform',\n\toptions: [\n\t\t{\n\t\t\tname: 'Vector',\n\t\t\tvalue: 'vector',\n\t\t\tdescription: 'Vector similarity search only',\n\t\t},\n\t\t{\n\t\t\tname: 'Hybrid',\n\t\t\tvalue: 'hybrid',\n\t\t\tdescription: 'Combines vector and keyword search (recommended)',\n\t\t},\n\t\t{\n\t\t\tname: 'Semantic Hybrid',\n\t\t\tvalue: 'semanticHybrid',\n\t\t\tdescription: 'Hybrid search with semantic ranking (requires Basic tier or higher)',\n\t\t},\n\t],\n};\n\nconst filterField: INodeProperties = {\n\tdisplayName: 'Filter',\n\tname: FILTER,\n\ttype: 'string',\n\tdefault: '',\n\tdescription:\n\t\t'Filter results using OData syntax. Use metadata/fieldName for metadata fields. <a href=\"https://learn.microsoft.com/en-us/azure/search/search-query-odata-filter\" target=\"_blank\">Learn more</a>.',\n\tplaceholder: \"metadata/category eq 'technology' and metadata/author eq 'John'\",\n};\n\nconst semanticConfigurationField: INodeProperties = {\n\tdisplayName: 'Semantic Configuration',\n\tname: SEMANTIC_CONFIGURATION,\n\ttype: 'string',\n\tdefault: '',\n\tdescription: 'Name of the semantic configuration for semantic ranking (optional)',\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\t[QUERY_TYPE]: ['semanticHybrid'],\n\t\t},\n\t},\n};\n\nconst sharedFields: INodeProperties[] = [indexNameField];\n\nconst retrieveFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [queryTypeField, filterField, semanticConfigurationField],\n\t},\n];\n\nconst insertFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Clear Index',\n\t\t\t\tname: 'clearIndex',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to delete and recreate the index before inserting new data. Warning: This will reset any custom index configuration (semantic ranking, analyzers, etc.) to defaults.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Metadata Keys to Insert',\n\t\t\t\tname: 'metadataKeysToInsert',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g., source,author,category',\n\t\t\t\tdescription:\n\t\t\t\t\t'Comma-separated list of metadata keys to store in Azure AI Search. Leave empty to include all metadata. Azure AI Search stores metadata in an \"attributes\" array format.',\n\t\t\t},\n\t\t],\n\t},\n];\n\ntype IFunctionsContext = IExecuteFunctions | ISupplyDataFunctions | ILoadOptionsFunctions;\n\nfunction isExecutionContext(\n\tcontext: IFunctionsContext,\n): context is IExecuteFunctions | ISupplyDataFunctions {\n\t// IExecuteFunctions and ISupplyDataFunctions have addInputData method\n\t// ILoadOptionsFunctions does not\n\treturn 'addInputData' in context;\n}\n\nfunction getParameter(key: string, context: IFunctionsContext, itemIndex: number): string {\n\tlet value: unknown;\n\n\tif (isExecutionContext(context)) {\n\t\t// Execution context: includes itemIndex parameter\n\t\tvalue = context.getNodeParameter(key, itemIndex, '', { extractValue: true });\n\t} else {\n\t\t// Load options context: no itemIndex parameter\n\t\tvalue = context.getNodeParameter(key, '', { extractValue: true });\n\t}\n\n\tif (typeof value !== 'string') {\n\t\tthrow new NodeOperationError(context.getNode(), `Parameter ${key} must be a string`);\n\t}\n\treturn value;\n}\n\nexport const getIndexName = getParameter.bind(null, INDEX_NAME);\n\nfunction getOptionValue<T>(\n\tname: string,\n\tcontext: IExecuteFunctions | ISupplyDataFunctions,\n\titemIndex: number,\n\tdefaultValue?: T,\n): T | undefined {\n\tconst options: IDataObject = context.getNodeParameter('options', itemIndex, {});\n\treturn options[name] !== undefined ? (options[name] as T) : defaultValue;\n}\n\ninterface ValidatedCredentials {\n\tendpoint: string;\n\tapiKey: string;\n}\n\nasync function getValidatedCredentials(\n\tcontext: IFunctionsContext,\n\titemIndex: number,\n): Promise<ValidatedCredentials> {\n\tconst credentials = await context.getCredentials(AZURE_AI_SEARCH_CREDENTIALS);\n\n\tif (!credentials.endpoint || typeof credentials.endpoint !== 'string') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\t'Azure AI Search endpoint is missing or invalid',\n\t\t\t{ itemIndex },\n\t\t);\n\t}\n\n\tif (!credentials.apiKey || typeof credentials.apiKey !== 'string') {\n\t\tthrow new NodeOperationError(context.getNode(), 'API Key is required for authentication', {\n\t\t\titemIndex,\n\t\t});\n\t}\n\n\treturn {\n\t\tendpoint: credentials.endpoint,\n\t\tapiKey: credentials.apiKey,\n\t};\n}\n\n/**\n * Deletes an Azure AI Search index if clearIndex option is enabled.\n * Exported for testing purposes.\n */\nexport async function clearAzureSearchIndex(\n\tcontext: IFunctionsContext,\n\titemIndex: number,\n): Promise<boolean> {\n\tconst options = context.getNodeParameter('options', itemIndex, {}) as {\n\t\tclearIndex?: boolean;\n\t};\n\n\tif (!options.clearIndex) {\n\t\treturn false;\n\t}\n\n\tconst credentials = await getValidatedCredentials(context, itemIndex);\n\tconst indexName = getIndexName(context, itemIndex);\n\n\ttry {\n\t\tconst indexClient = new SearchIndexClient(\n\t\t\tcredentials.endpoint,\n\t\t\tnew AzureKeyCredential(credentials.apiKey),\n\t\t);\n\t\tawait indexClient.deleteIndex(indexName);\n\t\tcontext.logger.debug(`Deleted Azure AI Search index: ${indexName}`);\n\t\treturn true;\n\t} catch (deleteError) {\n\t\t// Log the error but don't fail - index might not exist yet\n\t\tcontext.logger.debug('Error deleting index (may not exist):', {\n\t\t\tmessage: deleteError instanceof Error ? deleteError.message : String(deleteError),\n\t\t});\n\t\treturn false;\n\t}\n}\n\nasync function getAzureAISearchClient(\n\tcontext: IFunctionsContext,\n\tembeddings: EmbeddingsInterface,\n\titemIndex: number,\n): Promise<AzureAISearchVectorStore> {\n\tconst credentials = await getValidatedCredentials(context, itemIndex);\n\n\ttry {\n\t\tconst indexName = getIndexName(context, itemIndex);\n\t\tconst azureCredentials = new AzureKeyCredential(credentials.apiKey);\n\n\t\t// Pass endpoint, indexName, and credentials to enable automatic index creation\n\t\t// LangChain will create the index automatically if it doesn't exist\n\t\tconst config: any = {\n\t\t\tendpoint: credentials.endpoint,\n\t\t\tindexName,\n\t\t\tcredentials: azureCredentials,\n\t\t\tsearch: {},\n\t\t\t// Add custom user agent for usage tracking\n\t\t\tclientOptions: {\n\t\t\t\tuserAgentOptions: { userAgentPrefix: USER_AGENT_PREFIX },\n\t\t\t},\n\t\t};\n\n\t\t// Set search configuration options only for execution contexts\n\t\tif (isExecutionContext(context)) {\n\t\t\tconst queryType = getQueryType(context, itemIndex);\n\t\t\tconst semanticConfiguration = getOptionValue<string>(\n\t\t\t\t'semanticConfiguration',\n\t\t\t\tcontext,\n\t\t\t\titemIndex,\n\t\t\t);\n\t\t\tconst filter = getOptionValue<string>('filter', context, itemIndex);\n\n\t\t\tconfig.search.type = queryType;\n\n\t\t\tif (filter) {\n\t\t\t\tconfig.search.filter = filter;\n\t\t\t}\n\n\t\t\tif (queryType === AzureAISearchQueryType.SemanticHybrid && semanticConfiguration) {\n\t\t\t\tconfig.search.semanticConfigurationName = semanticConfiguration;\n\t\t\t}\n\t\t}\n\n\t\treturn new AzureAISearchVectorStore(embeddings, config);\n\t} catch (error) {\n\t\tif (error instanceof NodeOperationError) {\n\t\t\tthrow error;\n\t\t}\n\n\t\t// Log the full error for debugging\n\t\tcontext.logger.debug('Azure AI Search connection error:', {\n\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\tcode: (error as any).code,\n\t\t\tstatusCode: (error as any).statusCode,\n\t\t\tdetails: (error as any).details,\n\t\t});\n\n\t\t// Check for authentication errors\n\t\tif (\n\t\t\terror.message?.includes('401') ||\n\t\t\terror.message?.includes('Unauthorized') ||\n\t\t\terror.message?.includes('authentication failed')\n\t\t) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Authentication failed - invalid API key or endpoint.',\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Please verify your API Key and Search Endpoint are correct in the credentials configuration.',\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\t// Check for authorization errors (403)\n\t\tif (error.message?.includes('403') || error.message?.includes('Forbidden')) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tcontext.getNode(),\n\t\t\t\t'Authorization failed - insufficient permissions.',\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The API Key does not have sufficient permissions. Ensure the key has the required access level for this operation.',\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\tthrow new NodeOperationError(context.getNode(), `Error: ${errorMessage}`, {\n\t\t\titemIndex,\n\t\t\tdescription: 'Please check your Azure AI Search connection details',\n\t\t});\n\t}\n}\n\nfunction getQueryType(\n\tcontext: IExecuteFunctions | ISupplyDataFunctions,\n\titemIndex: number,\n): AzureAISearchQueryType {\n\tconst queryType = getOptionValue<string>('queryType', context, itemIndex, 'hybrid');\n\n\tswitch (queryType) {\n\t\tcase 'vector':\n\t\t\treturn AzureAISearchQueryType.Similarity;\n\t\tcase 'hybrid':\n\t\t\treturn AzureAISearchQueryType.SimilarityHybrid;\n\t\tcase 'semanticHybrid':\n\t\t\treturn AzureAISearchQueryType.SemanticHybrid;\n\t\tdefault:\n\t\t\treturn AzureAISearchQueryType.SimilarityHybrid;\n\t}\n}\n\ninterface AzureMetadataAttribute {\n\tkey: string;\n\tvalue: string;\n}\n\n/**\n * Transforms document metadata into Azure AI Search's expected format.\n * Azure AI Search requires metadata to be stored in an 'attributes' array\n * with {key, value} pairs where values are strings.\n *\n * @param documents - Array of documents to transform\n * @param metadataKeysToInclude - Optional array of specific keys to include. If empty, includes all keys.\n * @returns Documents with transformed metadata\n */\nexport function transformDocumentsForAzure(\n\tdocuments: Array<Document<Record<string, unknown>>>,\n\tmetadataKeysToInclude: string[],\n): Array<Document<Record<string, unknown>>> {\n\treturn documents.map((doc) => {\n\t\tconst originalMetadata = doc.metadata;\n\n\t\tconst keysToProcess =\n\t\t\tmetadataKeysToInclude.length > 0 ? metadataKeysToInclude : Object.keys(originalMetadata);\n\n\t\tconst attributes: AzureMetadataAttribute[] = keysToProcess\n\t\t\t.filter(\n\t\t\t\t(key) =>\n\t\t\t\t\tObject.prototype.hasOwnProperty.call(originalMetadata, key) &&\n\t\t\t\t\toriginalMetadata[key] !== null &&\n\t\t\t\t\toriginalMetadata[key] !== undefined,\n\t\t\t)\n\t\t\t.map((key) => ({\n\t\t\t\tkey,\n\t\t\t\tvalue: String(originalMetadata[key]),\n\t\t\t}));\n\n\t\treturn {\n\t\t\t...doc,\n\t\t\tmetadata: {\n\t\t\t\t...originalMetadata,\n\t\t\t\tattributes,\n\t\t\t},\n\t\t};\n\t});\n}\n\nexport class VectorStoreAzureAISearch extends createVectorStoreNode({\n\tmeta: {\n\t\tdisplayName: 'Azure AI Search Vector Store',\n\t\tname: 'vectorStoreAzureAISearch',\n\t\tdescription: 'Work with your data in Azure AI Search Vector Store',\n\t\ticon: { light: 'file:azure-aisearch.svg', dark: 'file:azure-aisearch.svg' },\n\t\tdocsUrl:\n\t\t\t'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreazureaisearch/',\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'azureAiSearchApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toperationModes: ['load', 'insert', 'retrieve', 'update', 'retrieve-as-tool'],\n\t},\n\tsharedFields,\n\tretrieveFields,\n\tloadFields: retrieveFields,\n\tinsertFields,\n\tasync getVectorStoreClient(context, _filter, embeddings, itemIndex) {\n\t\tconst vectorStore = await getAzureAISearchClient(context, embeddings, itemIndex);\n\n\t\t// Apply OData filter to search methods if specified in options\n\t\tif (isExecutionContext(context)) {\n\t\t\tconst filter = getOptionValue<string>('filter', context, itemIndex);\n\n\t\t\tif (filter) {\n\t\t\t\t// Per LangChain docs, pass filter as 3rd parameter with filterExpression\n\t\t\t\tconst filterObject = { filterExpression: filter };\n\n\t\t\t\t// Override similaritySearchVectorWithScore - this is the method called by n8n base node\n\t\t\t\tconst originalSearchVectorWithScore =\n\t\t\t\t\tvectorStore.similaritySearchVectorWithScore.bind(vectorStore);\n\t\t\t\tvectorStore.similaritySearchVectorWithScore = async (\n\t\t\t\t\tquery: number[],\n\t\t\t\t\tk: number,\n\t\t\t\t\tadditionalFilter?: any,\n\t\t\t\t) => {\n\t\t\t\t\t// Merge our OData filter with any additional filter passed by the caller\n\t\t\t\t\tconst mergedFilter = additionalFilter\n\t\t\t\t\t\t? { ...filterObject, ...additionalFilter }\n\t\t\t\t\t\t: filterObject;\n\t\t\t\t\treturn await originalSearchVectorWithScore(query, k, mergedFilter);\n\t\t\t\t};\n\n\t\t\t\t// Override similaritySearch to pass filter as 3rd parameter\n\t\t\t\tconst originalSearch = vectorStore.similaritySearch.bind(vectorStore);\n\t\t\t\tvectorStore.similaritySearch = async (query: string, k?: number) => {\n\t\t\t\t\treturn await originalSearch(query, k, filterObject);\n\t\t\t\t};\n\n\t\t\t\t// Override similaritySearchWithScore to pass filter as 3rd parameter\n\t\t\t\tconst originalSearchWithScore = vectorStore.similaritySearchWithScore.bind(vectorStore);\n\t\t\t\tvectorStore.similaritySearchWithScore = async (query: string, k?: number) => {\n\t\t\t\t\treturn await originalSearchWithScore(query, k, filterObject);\n\t\t\t\t};\n\n\t\t\t\t// Override asRetriever to inject filter into retriever options\n\t\t\t\tconst originalAsRetriever = vectorStore.asRetriever.bind(vectorStore);\n\t\t\t\tvectorStore.asRetriever = (kwargs?: any) => {\n\t\t\t\t\treturn originalAsRetriever({\n\t\t\t\t\t\t...kwargs,\n\t\t\t\t\t\tfilter: filterObject,\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn vectorStore;\n\t},\n\tasync populateVectorStore(context, embeddings, documents, itemIndex) {\n\t\ttry {\n\t\t\t// Clear the index if requested (delete and recreate)\n\t\t\tawait clearAzureSearchIndex(context, itemIndex);\n\n\t\t\tconst metadataKeysToInsertRaw = getOptionValue<string>(\n\t\t\t\t'metadataKeysToInsert',\n\t\t\t\tcontext,\n\t\t\t\titemIndex,\n\t\t\t);\n\t\t\tconst metadataKeysToInsert = metadataKeysToInsertRaw\n\t\t\t\t? metadataKeysToInsertRaw\n\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t.map((k) => k.trim())\n\t\t\t\t\t\t.filter((k) => k.length > 0)\n\t\t\t\t: [];\n\n\t\t\tconst transformedDocuments = transformDocumentsForAzure(documents, metadataKeysToInsert);\n\n\t\t\t// Get vector store client (will auto-create index if it doesn't exist)\n\t\t\tconst vectorStore = await getAzureAISearchClient(context, embeddings, itemIndex);\n\n\t\t\t// Add documents to Azure AI Search (framework handles batching)\n\t\t\tawait vectorStore.addDocuments(transformedDocuments);\n\t\t} catch (error) {\n\t\t\t// Log the full error for debugging\n\t\t\tcontext.logger.debug('Azure AI Search error details:', {\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\tcode: (error as any).code,\n\t\t\t\tstatusCode: (error as any).statusCode,\n\t\t\t\tdetails: (error as any).details,\n\t\t\t\tstack: error instanceof Error ? error.stack : undefined,\n\t\t\t});\n\n\t\t\t// Check for authentication errors\n\t\t\tif (\n\t\t\t\terror.message?.includes('401') ||\n\t\t\t\terror.message?.includes('Unauthorized') ||\n\t\t\t\terror.message?.includes('authentication failed')\n\t\t\t) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t'Authentication failed during document upload - invalid API key or endpoint.',\n\t\t\t\t\t{\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Please verify your API Key and Search Endpoint are correct in the credentials configuration.',\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check for authorization errors\n\t\t\tif (\n\t\t\t\terror.message?.includes('403') ||\n\t\t\t\terror.message?.includes('Forbidden') ||\n\t\t\t\t(error as any).statusCode === 403\n\t\t\t) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t'Authorization failed - insufficient permissions for document upload.',\n\t\t\t\t\t{\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The API Key does not have sufficient permissions for write operations. Ensure the key has the required access level.',\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check for RestError (common Azure SDK error)\n\t\t\tif ((error as any).name === 'RestError' || error.message?.includes('RestError')) {\n\t\t\t\tconst statusCode = (error as any).statusCode || 'unknown';\n\t\t\t\tconst errorCode = (error as any).code || 'unknown';\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tcontext.getNode(),\n\t\t\t\t\t`Azure AI Search API error (${statusCode}): ${errorMessage}`,\n\t\t\t\t\t{\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\tdescription: `Error code: ${errorCode}\\n\\nCommon causes:\\n- Invalid endpoint URL\\n- Index doesn't exist\\n- Authentication/authorization issues\\n- API version mismatch\\n\\nCheck the console logs for detailed error information.`,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\tthrow new NodeOperationError(context.getNode(), `Error: ${errorMessage}`, {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check your Azure AI Search connection details and index configuration',\n\t\t\t});\n\t\t}\n\t},\n}) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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IAAI,uCAAmB,QAAQ,QAAQ,GAAG,UAAU,YAAY,IAAI;AAAA,QACzE;AAAA,QACA,aAAa;AAAA,MACd,CAAC;AAAA,IACF;AAAA,EACD;AACD,CAAC,EAAE;AAAC;","names":["errorMessage"]}
|
package/dist/types/nodes.json
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
{"displayName":"Manual Chat Trigger","name":"manualChatTrigger","icon":"fa:comments","group":["trigger"],"version":[1,1.1],"description":"Runs the flow on new manual chat message","eventTriggerDescription":"","maxNodes":1,"hidden":true,"defaults":{"name":"When chat message received","color":"#909298"},"codex":{"categories":["Core Nodes"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.chattrigger/"}]},"subcategories":{"Core Nodes":["Other Trigger Nodes"]}},"inputs":[],"outputs":["main"],"properties":[{"displayName":"This node is where a manual chat workflow execution starts. To make one, go back to the canvas and click ‘Chat’","name":"notice","type":"notice","default":""},{"displayName":"Chat and execute workflow","name":"openChat","type":"button","typeOptions":{"buttonConfig":{"action":"openChat"}},"default":""}]},
|
|
90
90
|
{"displayName":"Chat Trigger","name":"chatTrigger","icon":"fa:comments","iconColor":"black","group":["trigger"],"version":[1,1.1,1.2,1.3,1.4],"defaultVersion":1.4,"description":"Runs the workflow when an n8n generated webchat is submitted","defaults":{"name":"When chat message received"},"codex":{"categories":["Core Nodes"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.chattrigger/"}]}},"maxNodes":1,"inputs":"={{ (() => {\n\t\t\tif (!['hostedChat', 'webhook'].includes($parameter.mode)) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tif ($parameter.options?.loadPreviousSession !== 'memory') {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Memory',\n\t\t\t\t\tmaxConnections: 1,\n\t\t\t\t\ttype: 'ai_memory',\n\t\t\t\t\trequired: true,\n\t\t\t\t}\n\t\t\t];\n\t\t })() }}","outputs":["main"],"credentials":[{"name":"httpBasicAuth","required":true,"displayOptions":{"show":{"authentication":["basicAuth"]}}}],"webhooks":[{"name":"setup","httpMethod":"GET","responseMode":"onReceived","path":"chat","ndvHideUrl":true},{"name":"default","httpMethod":"POST","responseMode":"={{$parameter.options?.[\"responseMode\"] ?? ($parameter.availableInChat ? \"streaming\" : \"lastNode\") }}","path":"chat","ndvHideMethod":true,"ndvHideUrl":"={{ !$parameter.public }}"}],"eventTriggerDescription":"Waiting for you to submit the chat","activationMessage":"You can now make calls to your production chat URL.","triggerPanel":false,"properties":[{"displayName":"Make Chat Publicly Available","name":"public","type":"boolean","default":false,"description":"Whether the chat should be publicly available or only accessible through the manual chat interface"},{"displayName":"Mode","name":"mode","type":"options","options":[{"name":"Hosted Chat","value":"hostedChat","description":"Chat on a page served by n8n"},{"name":"Embedded Chat","value":"webhook","description":"Chat through a widget embedded in another page, or by calling a webhook"}],"default":"hostedChat","displayOptions":{"show":{"public":[true]}}},{"displayName":"Chat will be live at the URL above once this workflow is published. Live executions will show up in the ‘executions’ tab","name":"hostedChatNotice","type":"notice","displayOptions":{"show":{"mode":["hostedChat"],"public":[true]}},"default":""},{"displayName":"Follow the instructions <a href=\"https://www.npmjs.com/package/@n8n/chat\" target=\"_blank\">here</a> to embed chat in a webpage (or just call the webhook URL at the top of this section). Chat will be live once you publish this workflow","name":"embeddedChatNotice","type":"notice","displayOptions":{"show":{"mode":["webhook"],"public":[true]}},"default":""},{"displayName":"Authentication","name":"authentication","type":"options","displayOptions":{"show":{"public":[true]}},"options":[{"name":"Basic Auth","value":"basicAuth","description":"Simple username and password (the same one for all users)"},{"name":"n8n User Auth","value":"n8nUserAuth","description":"Require user to be logged in with their n8n account"},{"name":"None","value":"none"}],"default":"none","description":"The way to authenticate"},{"displayName":"Initial Message(s)","name":"initialMessages","type":"string","displayOptions":{"show":{"mode":["hostedChat"],"public":[true]}},"typeOptions":{"rows":3},"default":"Hi there! 👋\nMy name is Nathan. How can I assist you today?","description":"Default messages shown at the start of the chat, one per line"},{"displayName":"Make Available in n8n Chat","name":"availableInChat","type":"boolean","default":false,"noDataExpression":true,"description":"Whether to make the agent available in n8n Chat"},{"displayName":"Your Chat Trigger node is out of date. To update, delete this node and insert a new Chat Trigger node.","name":"availableInChatNotice","type":"notice","displayOptions":{"show":{"availableInChat":[true],"@version":[{"_cnd":{"lt":1.2}}]}},"default":""},{"displayName":"Your n8n users will be able to use this agent in <a href=\"/home/chat/\" target=\"_blank\">Chat</a> once this workflow is published. Make sure to share this workflow with at least Project Chat User access to all users who should use it. Currently, only streaming response mode is supported.","name":"availableInChatNotice","type":"notice","displayOptions":{"show":{"availableInChat":[true],"@version":[{"_cnd":{"gte":1.2}}]}},"default":""},{"displayName":"Agent Icon","name":"agentIcon","type":"icon","default":{"type":"icon","value":"bot"},"noDataExpression":true,"description":"The icon of the agent on n8n Chat","displayOptions":{"show":{"availableInChat":[true],"@version":[{"_cnd":{"gte":1.2}}]}}},{"displayName":"Agent Name","name":"agentName","type":"string","default":"","noDataExpression":true,"description":"The name of the agent on n8n Chat. Name of the workflow is used if left empty.","displayOptions":{"show":{"availableInChat":[true],"@version":[{"_cnd":{"gte":1.2}}]}}},{"displayName":"Agent Description","name":"agentDescription","type":"string","typeOptions":{"rows":2},"default":"","noDataExpression":true,"description":"The description of the agent on n8n Chat","displayOptions":{"show":{"availableInChat":[true],"@version":[{"_cnd":{"gte":1.2}}]}}},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"public":[false],"@version":[1,1.1]}},"placeholder":"Add Field","default":{},"options":[{"displayName":"Allow File Uploads","name":"allowFileUploads","type":"boolean","default":false,"description":"Whether to allow file uploads in the chat"},{"displayName":"Allowed File Mime Types","name":"allowedFilesMimeTypes","type":"string","default":"*","placeholder":"e.g. image/*, text/*, application/pdf","description":"Allowed file types for upload. Comma-separated list of <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\" target=\"_blank\">MIME types</a>."}]},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"mode":["hostedChat","webhook"],"public":[true],"@version":[1,1.1]}},"placeholder":"Add Field","default":{},"options":[{"displayName":"Allowed Origins (CORS)","name":"allowedOrigins","type":"string","default":"*","description":"Comma-separated list of URLs allowed for cross-origin non-preflight requests. Use * (default) to allow all origins.","displayOptions":{"show":{"/mode":["hostedChat","webhook"]}}},{"displayName":"Allow File Uploads","name":"allowFileUploads","type":"boolean","default":false,"description":"Whether to allow file uploads in the chat","displayOptions":{"show":{"/mode":["hostedChat"]}}},{"displayName":"Allowed File Mime Types","name":"allowedFilesMimeTypes","type":"string","default":"*","placeholder":"e.g. image/*, text/*, application/pdf","description":"Allowed file types for upload. Comma-separated list of <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\" target=\"_blank\">MIME types</a>.","displayOptions":{"show":{"/mode":["hostedChat"]}}},{"displayName":"Input Placeholder","name":"inputPlaceholder","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Type your question..","placeholder":"e.g. Type your message here","description":"Shown as placeholder text in the chat input field"},{"displayName":"Load Previous Session","name":"loadPreviousSession","type":"options","options":[{"name":"Off","value":"notSupported","description":"Loading messages of previous session is turned off"},{"name":"From Memory","value":"memory","description":"Load session messages from memory"},{"name":"Manually","value":"manually","description":"Manually return messages of session"}],"default":"notSupported","description":"If loading messages of a previous session should be enabled"},{"displayName":"Require Button Click to Start Chat","name":"showWelcomeScreen","type":"boolean","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":false,"description":"Whether to show the welcome screen at the start of the chat"},{"displayName":"Start Conversation Button Text","name":"getStarted","type":"string","displayOptions":{"show":{"showWelcomeScreen":[true],"/mode":["hostedChat"]}},"default":"New Conversation","placeholder":"e.g. New Conversation","description":"Shown as part of the welcome screen, in the middle of the chat window"},{"displayName":"Subtitle","name":"subtitle","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Start a chat. We're here to help you 24/7.","placeholder":"e.g. We're here for you","description":"Shown at the top of the chat, under the title"},{"displayName":"Title","name":"title","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Hi there! 👋","placeholder":"e.g. Welcome","description":"Shown at the top of the chat"},{"displayName":"Custom Chat Styling","name":"customCss","type":"string","typeOptions":{"rows":10,"editor":"cssEditor"},"displayOptions":{"show":{"/mode":["hostedChat"]}},"default":":root {\n /* Colors */\n --chat--color-primary: #e74266;\n --chat--color-primary-shade-50: #db4061;\n --chat--color-primary-shade-100: #cf3c5c;\n --chat--color-secondary: #20b69e;\n --chat--color-secondary-shade-50: #1ca08a;\n --chat--color-white: #ffffff;\n --chat--color-light: #f2f4f8;\n --chat--color-light-shade-50: #e6e9f1;\n --chat--color-light-shade-100: #c2c5cc;\n --chat--color-medium: #d2d4d9;\n --chat--color-dark: #101330;\n --chat--color-disabled: #d2d4d9;\n --chat--color-typing: #404040;\n\n /* Base Layout */\n --chat--spacing: 1rem;\n --chat--border-radius: 0.25rem;\n --chat--transition-duration: 0.15s;\n --chat--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\n\n /* Window Dimensions */\n --chat--window--width: 400px;\n --chat--window--height: 600px;\n --chat--window--bottom: var(--chat--spacing);\n --chat--window--right: var(--chat--spacing);\n --chat--window--z-index: 9999;\n --chat--window--border: 1px solid var(--chat--color-light-shade-50);\n --chat--window--border-radius: var(--chat--border-radius);\n --chat--window--margin-bottom: var(--chat--spacing);\n\n /* Header Styles */\n --chat--header-height: auto;\n --chat--header--padding: var(--chat--spacing);\n --chat--header--background: var(--chat--color-dark);\n --chat--header--color: var(--chat--color-light);\n --chat--header--border-top: none;\n --chat--header--border-bottom: none;\n --chat--header--border-left: none;\n --chat--header--border-right: none;\n --chat--heading--font-size: 2em;\n --chat--subtitle--font-size: inherit;\n --chat--subtitle--line-height: 1.8;\n\n /* Message Styles */\n --chat--message--font-size: 1rem;\n --chat--message--padding: var(--chat--spacing);\n --chat--message--border-radius: var(--chat--border-radius);\n --chat--message-line-height: 1.5;\n --chat--message--margin-bottom: calc(var(--chat--spacing) * 1);\n --chat--message--bot--background: var(--chat--color-white);\n --chat--message--bot--color: var(--chat--color-dark);\n --chat--message--bot--border: none;\n --chat--message--user--background: var(--chat--color-secondary);\n --chat--message--user--color: var(--chat--color-white);\n --chat--message--user--border: none;\n --chat--message--pre--background: rgba(0, 0, 0, 0.05);\n --chat--messages-list--padding: var(--chat--spacing);\n\n /* Toggle Button */\n --chat--toggle--size: 64px;\n --chat--toggle--width: var(--chat--toggle--size);\n --chat--toggle--height: var(--chat--toggle--size);\n --chat--toggle--border-radius: 50%;\n --chat--toggle--background: var(--chat--color-primary);\n --chat--toggle--hover--background: var(--chat--color-primary-shade-50);\n --chat--toggle--active--background: var(--chat--color-primary-shade-100);\n --chat--toggle--color: var(--chat--color-white);\n\n /* Input Area */\n --chat--textarea--height: 50px;\n --chat--textarea--max-height: 30rem;\n --chat--input--font-size: inherit;\n --chat--input--border: 0;\n --chat--input--border-radius: 0;\n --chat--input--padding: 0.8rem;\n --chat--input--background: var(--chat--color-white);\n --chat--input--text-color: initial;\n --chat--input--line-height: 1.5;\n --chat--input--placeholder--font-size: var(--chat--input--font-size);\n --chat--input--border-active: 0;\n --chat--input--left--panel--width: 2rem;\n\n /* Button Styles */\n --chat--button--color: var(--chat--color-light);\n --chat--button--background: var(--chat--color-primary);\n --chat--button--padding: calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing);\n --chat--button--border-radius: var(--chat--border-radius);\n --chat--button--hover--color: var(--chat--color-light);\n --chat--button--hover--background: var(--chat--color-primary-shade-50);\n --chat--close--button--color-hover: var(--chat--color-primary);\n\n /* Send and File Buttons */\n --chat--input--send--button--background: var(--chat--color-white);\n --chat--input--send--button--color: var(--chat--color-secondary);\n --chat--input--send--button--background-hover: var(--chat--color-primary-shade-50);\n --chat--input--send--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--input--file--button--background: var(--chat--color-white);\n --chat--input--file--button--color: var(--chat--color-secondary);\n --chat--input--file--button--background-hover: var(--chat--input--file--button--background);\n --chat--input--file--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--files-spacing: 0.25rem;\n\n /* Body and Footer */\n --chat--body--background: var(--chat--color-light);\n --chat--footer--background: var(--chat--color-light);\n --chat--footer--color: var(--chat--color-dark);\n}\n\n\n/* You can override any class styles, too. Right-click inspect in Chat UI to find class to override. */\n.chat-message {\n\tmax-width: 50%;\n}","description":"Override default styling of the public chat interface with CSS"},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"When Last Node Finishes","value":"lastNode","description":"Returns data of the last-executed node"},{"name":"Using 'Respond to Webhook' Node","value":"responseNode","description":"Response defined in that node"}],"default":"lastNode","description":"When and how to respond to the webhook"}]},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"mode":["hostedChat","webhook"],"public":[true],"@version":[1.2]}},"placeholder":"Add Field","default":{},"options":[{"displayName":"Allowed Origins (CORS)","name":"allowedOrigins","type":"string","default":"*","description":"Comma-separated list of URLs allowed for cross-origin non-preflight requests. Use * (default) to allow all origins.","displayOptions":{"show":{"/mode":["hostedChat","webhook"]}}},{"displayName":"Allow File Uploads","name":"allowFileUploads","type":"boolean","default":false,"description":"Whether to allow file uploads in the chat","displayOptions":{"show":{"/mode":["hostedChat"]}}},{"displayName":"Allowed File Mime Types","name":"allowedFilesMimeTypes","type":"string","default":"*","placeholder":"e.g. image/*, text/*, application/pdf","description":"Allowed file types for upload. Comma-separated list of <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\" target=\"_blank\">MIME types</a>.","displayOptions":{"show":{"/mode":["hostedChat"]}}},{"displayName":"Input Placeholder","name":"inputPlaceholder","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Type your question..","placeholder":"e.g. Type your message here","description":"Shown as placeholder text in the chat input field"},{"displayName":"Load Previous Session","name":"loadPreviousSession","type":"options","options":[{"name":"Off","value":"notSupported","description":"Loading messages of previous session is turned off"},{"name":"From Memory","value":"memory","description":"Load session messages from memory"},{"name":"Manually","value":"manually","description":"Manually return messages of session"}],"default":"notSupported","description":"If loading messages of a previous session should be enabled"},{"displayName":"Require Button Click to Start Chat","name":"showWelcomeScreen","type":"boolean","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":false,"description":"Whether to show the welcome screen at the start of the chat"},{"displayName":"Start Conversation Button Text","name":"getStarted","type":"string","displayOptions":{"show":{"showWelcomeScreen":[true],"/mode":["hostedChat"]}},"default":"New Conversation","placeholder":"e.g. New Conversation","description":"Shown as part of the welcome screen, in the middle of the chat window"},{"displayName":"Subtitle","name":"subtitle","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Start a chat. We're here to help you 24/7.","placeholder":"e.g. We're here for you","description":"Shown at the top of the chat, under the title"},{"displayName":"Title","name":"title","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Hi there! 👋","placeholder":"e.g. Welcome","description":"Shown at the top of the chat"},{"displayName":"Custom Chat Styling","name":"customCss","type":"string","typeOptions":{"rows":10,"editor":"cssEditor"},"displayOptions":{"show":{"/mode":["hostedChat"]}},"default":":root {\n /* Colors */\n --chat--color-primary: #e74266;\n --chat--color-primary-shade-50: #db4061;\n --chat--color-primary-shade-100: #cf3c5c;\n --chat--color-secondary: #20b69e;\n --chat--color-secondary-shade-50: #1ca08a;\n --chat--color-white: #ffffff;\n --chat--color-light: #f2f4f8;\n --chat--color-light-shade-50: #e6e9f1;\n --chat--color-light-shade-100: #c2c5cc;\n --chat--color-medium: #d2d4d9;\n --chat--color-dark: #101330;\n --chat--color-disabled: #d2d4d9;\n --chat--color-typing: #404040;\n\n /* Base Layout */\n --chat--spacing: 1rem;\n --chat--border-radius: 0.25rem;\n --chat--transition-duration: 0.15s;\n --chat--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\n\n /* Window Dimensions */\n --chat--window--width: 400px;\n --chat--window--height: 600px;\n --chat--window--bottom: var(--chat--spacing);\n --chat--window--right: var(--chat--spacing);\n --chat--window--z-index: 9999;\n --chat--window--border: 1px solid var(--chat--color-light-shade-50);\n --chat--window--border-radius: var(--chat--border-radius);\n --chat--window--margin-bottom: var(--chat--spacing);\n\n /* Header Styles */\n --chat--header-height: auto;\n --chat--header--padding: var(--chat--spacing);\n --chat--header--background: var(--chat--color-dark);\n --chat--header--color: var(--chat--color-light);\n --chat--header--border-top: none;\n --chat--header--border-bottom: none;\n --chat--header--border-left: none;\n --chat--header--border-right: none;\n --chat--heading--font-size: 2em;\n --chat--subtitle--font-size: inherit;\n --chat--subtitle--line-height: 1.8;\n\n /* Message Styles */\n --chat--message--font-size: 1rem;\n --chat--message--padding: var(--chat--spacing);\n --chat--message--border-radius: var(--chat--border-radius);\n --chat--message-line-height: 1.5;\n --chat--message--margin-bottom: calc(var(--chat--spacing) * 1);\n --chat--message--bot--background: var(--chat--color-white);\n --chat--message--bot--color: var(--chat--color-dark);\n --chat--message--bot--border: none;\n --chat--message--user--background: var(--chat--color-secondary);\n --chat--message--user--color: var(--chat--color-white);\n --chat--message--user--border: none;\n --chat--message--pre--background: rgba(0, 0, 0, 0.05);\n --chat--messages-list--padding: var(--chat--spacing);\n\n /* Toggle Button */\n --chat--toggle--size: 64px;\n --chat--toggle--width: var(--chat--toggle--size);\n --chat--toggle--height: var(--chat--toggle--size);\n --chat--toggle--border-radius: 50%;\n --chat--toggle--background: var(--chat--color-primary);\n --chat--toggle--hover--background: var(--chat--color-primary-shade-50);\n --chat--toggle--active--background: var(--chat--color-primary-shade-100);\n --chat--toggle--color: var(--chat--color-white);\n\n /* Input Area */\n --chat--textarea--height: 50px;\n --chat--textarea--max-height: 30rem;\n --chat--input--font-size: inherit;\n --chat--input--border: 0;\n --chat--input--border-radius: 0;\n --chat--input--padding: 0.8rem;\n --chat--input--background: var(--chat--color-white);\n --chat--input--text-color: initial;\n --chat--input--line-height: 1.5;\n --chat--input--placeholder--font-size: var(--chat--input--font-size);\n --chat--input--border-active: 0;\n --chat--input--left--panel--width: 2rem;\n\n /* Button Styles */\n --chat--button--color: var(--chat--color-light);\n --chat--button--background: var(--chat--color-primary);\n --chat--button--padding: calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing);\n --chat--button--border-radius: var(--chat--border-radius);\n --chat--button--hover--color: var(--chat--color-light);\n --chat--button--hover--background: var(--chat--color-primary-shade-50);\n --chat--close--button--color-hover: var(--chat--color-primary);\n\n /* Send and File Buttons */\n --chat--input--send--button--background: var(--chat--color-white);\n --chat--input--send--button--color: var(--chat--color-secondary);\n --chat--input--send--button--background-hover: var(--chat--color-primary-shade-50);\n --chat--input--send--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--input--file--button--background: var(--chat--color-white);\n --chat--input--file--button--color: var(--chat--color-secondary);\n --chat--input--file--button--background-hover: var(--chat--input--file--button--background);\n --chat--input--file--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--files-spacing: 0.25rem;\n\n /* Body and Footer */\n --chat--body--background: var(--chat--color-light);\n --chat--footer--background: var(--chat--color-light);\n --chat--footer--color: var(--chat--color-dark);\n}\n\n\n/* You can override any class styles, too. Right-click inspect in Chat UI to find class to override. */\n.chat-message {\n\tmax-width: 50%;\n}","description":"Override default styling of the public chat interface with CSS"},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"When Last Node Finishes","value":"lastNode","description":"Returns data of the last-executed node"},{"name":"Using 'Respond to Webhook' Node","value":"responseNode","description":"Response defined in that node"},{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"}],"default":"lastNode","description":"When and how to respond to the webhook","displayOptions":{"show":{"/availableInChat":[false]}}},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"}],"default":"streaming","description":"When and how to respond to the webhook","displayOptions":{"show":{"/availableInChat":[true]}}}]},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"public":[false],"@version":[{"_cnd":{"gte":1.3}}]}},"placeholder":"Add Field","default":{},"options":[{"displayName":"Allow File Uploads","name":"allowFileUploads","type":"boolean","default":false,"description":"Whether to allow file uploads in the chat"},{"displayName":"Allowed File Mime Types","name":"allowedFilesMimeTypes","type":"string","default":"*","placeholder":"e.g. image/*, text/*, application/pdf","description":"Allowed file types for upload. Comma-separated list of <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\" target=\"_blank\">MIME types</a>."},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"When Last Node Finishes","value":"lastNode","description":"Returns data of the last-executed node"},{"name":"Using Response Nodes","value":"responseNodes","description":"Send responses to the chat by using 'Respond to Chat' node"},{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"}],"default":"lastNode","description":"When and how to respond to the chat","displayOptions":{"show":{"/availableInChat":[false]}}},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"}],"default":"streaming","description":"When and how to respond to the webhook","displayOptions":{"show":{"/availableInChat":[true]}}}]},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"mode":["hostedChat","webhook"],"public":[true],"@version":[{"_cnd":{"gte":1.3}}]}},"placeholder":"Add Field","default":{},"options":[{"displayName":"Allowed Origins (CORS)","name":"allowedOrigins","type":"string","default":"*","description":"Comma-separated list of URLs allowed for cross-origin non-preflight requests. Use * (default) to allow all origins.","displayOptions":{"show":{"/mode":["hostedChat","webhook"]}}},{"displayName":"Allow File Uploads","name":"allowFileUploads","type":"boolean","default":false,"description":"Whether to allow file uploads in the chat","displayOptions":{"show":{"/mode":["hostedChat"]}}},{"displayName":"Allowed File Mime Types","name":"allowedFilesMimeTypes","type":"string","default":"*","placeholder":"e.g. image/*, text/*, application/pdf","description":"Allowed file types for upload. Comma-separated list of <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\" target=\"_blank\">MIME types</a>.","displayOptions":{"show":{"/mode":["hostedChat"]}}},{"displayName":"Input Placeholder","name":"inputPlaceholder","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Type your question..","placeholder":"e.g. Type your message here","description":"Shown as placeholder text in the chat input field"},{"displayName":"Load Previous Session","name":"loadPreviousSession","type":"options","options":[{"name":"Off","value":"notSupported","description":"Loading messages of previous session is turned off"},{"name":"From Memory","value":"memory","description":"Load session messages from memory"},{"name":"Manually","value":"manually","description":"Manually return messages of session"}],"default":"notSupported","description":"If loading messages of a previous session should be enabled"},{"displayName":"Require Button Click to Start Chat","name":"showWelcomeScreen","type":"boolean","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":false,"description":"Whether to show the welcome screen at the start of the chat"},{"displayName":"Start Conversation Button Text","name":"getStarted","type":"string","displayOptions":{"show":{"showWelcomeScreen":[true],"/mode":["hostedChat"]}},"default":"New Conversation","placeholder":"e.g. New Conversation","description":"Shown as part of the welcome screen, in the middle of the chat window"},{"displayName":"Subtitle","name":"subtitle","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Start a chat. We're here to help you 24/7.","placeholder":"e.g. We're here for you","description":"Shown at the top of the chat, under the title"},{"displayName":"Title","name":"title","type":"string","displayOptions":{"show":{"/mode":["hostedChat"]}},"default":"Hi there! 👋","placeholder":"e.g. Welcome","description":"Shown at the top of the chat"},{"displayName":"Custom Chat Styling","name":"customCss","type":"string","typeOptions":{"rows":10,"editor":"cssEditor"},"displayOptions":{"show":{"/mode":["hostedChat"]}},"default":":root {\n /* Colors */\n --chat--color-primary: #e74266;\n --chat--color-primary-shade-50: #db4061;\n --chat--color-primary-shade-100: #cf3c5c;\n --chat--color-secondary: #20b69e;\n --chat--color-secondary-shade-50: #1ca08a;\n --chat--color-white: #ffffff;\n --chat--color-light: #f2f4f8;\n --chat--color-light-shade-50: #e6e9f1;\n --chat--color-light-shade-100: #c2c5cc;\n --chat--color-medium: #d2d4d9;\n --chat--color-dark: #101330;\n --chat--color-disabled: #d2d4d9;\n --chat--color-typing: #404040;\n\n /* Base Layout */\n --chat--spacing: 1rem;\n --chat--border-radius: 0.25rem;\n --chat--transition-duration: 0.15s;\n --chat--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\n\n /* Window Dimensions */\n --chat--window--width: 400px;\n --chat--window--height: 600px;\n --chat--window--bottom: var(--chat--spacing);\n --chat--window--right: var(--chat--spacing);\n --chat--window--z-index: 9999;\n --chat--window--border: 1px solid var(--chat--color-light-shade-50);\n --chat--window--border-radius: var(--chat--border-radius);\n --chat--window--margin-bottom: var(--chat--spacing);\n\n /* Header Styles */\n --chat--header-height: auto;\n --chat--header--padding: var(--chat--spacing);\n --chat--header--background: var(--chat--color-dark);\n --chat--header--color: var(--chat--color-light);\n --chat--header--border-top: none;\n --chat--header--border-bottom: none;\n --chat--header--border-left: none;\n --chat--header--border-right: none;\n --chat--heading--font-size: 2em;\n --chat--subtitle--font-size: inherit;\n --chat--subtitle--line-height: 1.8;\n\n /* Message Styles */\n --chat--message--font-size: 1rem;\n --chat--message--padding: var(--chat--spacing);\n --chat--message--border-radius: var(--chat--border-radius);\n --chat--message-line-height: 1.5;\n --chat--message--margin-bottom: calc(var(--chat--spacing) * 1);\n --chat--message--bot--background: var(--chat--color-white);\n --chat--message--bot--color: var(--chat--color-dark);\n --chat--message--bot--border: none;\n --chat--message--user--background: var(--chat--color-secondary);\n --chat--message--user--color: var(--chat--color-white);\n --chat--message--user--border: none;\n --chat--message--pre--background: rgba(0, 0, 0, 0.05);\n --chat--messages-list--padding: var(--chat--spacing);\n\n /* Toggle Button */\n --chat--toggle--size: 64px;\n --chat--toggle--width: var(--chat--toggle--size);\n --chat--toggle--height: var(--chat--toggle--size);\n --chat--toggle--border-radius: 50%;\n --chat--toggle--background: var(--chat--color-primary);\n --chat--toggle--hover--background: var(--chat--color-primary-shade-50);\n --chat--toggle--active--background: var(--chat--color-primary-shade-100);\n --chat--toggle--color: var(--chat--color-white);\n\n /* Input Area */\n --chat--textarea--height: 50px;\n --chat--textarea--max-height: 30rem;\n --chat--input--font-size: inherit;\n --chat--input--border: 0;\n --chat--input--border-radius: 0;\n --chat--input--padding: 0.8rem;\n --chat--input--background: var(--chat--color-white);\n --chat--input--text-color: initial;\n --chat--input--line-height: 1.5;\n --chat--input--placeholder--font-size: var(--chat--input--font-size);\n --chat--input--border-active: 0;\n --chat--input--left--panel--width: 2rem;\n\n /* Button Styles */\n --chat--button--color: var(--chat--color-light);\n --chat--button--background: var(--chat--color-primary);\n --chat--button--padding: calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing);\n --chat--button--border-radius: var(--chat--border-radius);\n --chat--button--hover--color: var(--chat--color-light);\n --chat--button--hover--background: var(--chat--color-primary-shade-50);\n --chat--close--button--color-hover: var(--chat--color-primary);\n\n /* Send and File Buttons */\n --chat--input--send--button--background: var(--chat--color-white);\n --chat--input--send--button--color: var(--chat--color-secondary);\n --chat--input--send--button--background-hover: var(--chat--color-primary-shade-50);\n --chat--input--send--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--input--file--button--background: var(--chat--color-white);\n --chat--input--file--button--color: var(--chat--color-secondary);\n --chat--input--file--button--background-hover: var(--chat--input--file--button--background);\n --chat--input--file--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--files-spacing: 0.25rem;\n\n /* Body and Footer */\n --chat--body--background: var(--chat--color-light);\n --chat--footer--background: var(--chat--color-light);\n --chat--footer--color: var(--chat--color-dark);\n}\n\n\n/* You can override any class styles, too. Right-click inspect in Chat UI to find class to override. */\n.chat-message {\n\tmax-width: 50%;\n}","description":"Override default styling of the public chat interface with CSS"},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"}],"default":"streaming","description":"When and how to respond to the webhook","displayOptions":{"show":{"/availableInChat":[true]}}},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"When Last Node Finishes","value":"lastNode","description":"Returns data of the last-executed node"},{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"},{"name":"Using 'Respond to Webhook' Node","value":"responseNode","description":"Response defined in that node"}],"default":"lastNode","description":"When and how to respond to the chat","displayOptions":{"show":{"/mode":["webhook"],"/availableInChat":[false]}}},{"displayName":"Response Mode","name":"responseMode","type":"options","options":[{"name":"When Last Node Finishes","value":"lastNode","description":"Returns data of the last-executed node"},{"name":"Streaming","value":"streaming","description":"Streaming response from specified nodes (e.g. Agents)"},{"name":"Using Response Nodes","value":"responseNodes","description":"Send responses to the chat by using 'Respond to Chat' node"}],"default":"lastNode","description":"When and how to respond to the webhook","displayOptions":{"show":{"/mode":["hostedChat"],"/availableInChat":[false]}}}]}]},
|
|
91
91
|
{"usableAsTool":true,"displayName":"Respond to Chat","name":"chat","icon":"fa:comments","iconColor":"black","group":["input"],"version":1,"description":"Send a message to a chat","defaults":{"name":"Respond to Chat"},"codex":{"categories":["Core Nodes","HITL"],"subcategories":{"HITL":["Human in the Loop"]},"alias":["human","wait","hitl"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.respondtochat/"}]}},"inputs":"={{ ((parameters) => {\n const inputs = [\n {\n type: \"main\",\n displayName: \"User Response\"\n }\n ];\n if (parameters.options?.memoryConnection) {\n return [\n ...inputs,\n {\n type: \"ai_memory\",\n displayName: \"Memory\",\n maxConnections: 1\n }\n ];\n }\n return inputs;\n})($parameter) }}","outputs":["main"],"properties":[{"displayName":"Verify you're using a chat trigger with the 'Response Mode' option set to 'Using Response Nodes'","name":"generalNotice","type":"notice","default":""},{"displayName":"Message","name":"message","type":"string","default":"","required":true,"typeOptions":{"rows":6}},{"displayName":"Wait for User Reply","name":"waitUserReply","type":"boolean","default":true,"noDataExpression":true},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"displayOptions":{"hide":{"@tool":[true]}},"options":[{"displayName":"Add Memory Input Connection","name":"memoryConnection","type":"boolean","default":false},{"displayName":"Limit Wait Time","name":"limitWaitTime","type":"fixedCollection","description":"Whether to limit the time this node should wait for a user response before execution resumes","default":{"values":{"limitType":"afterTimeInterval","resumeAmount":45,"resumeUnit":"minutes"}},"options":[{"displayName":"Values","name":"values","values":[{"displayName":"Limit Type","name":"limitType","type":"options","default":"afterTimeInterval","description":"Sets the condition for the execution to resume. Can be a specified date or after some time.","options":[{"name":"After Time Interval","description":"Waits for a certain amount of time","value":"afterTimeInterval"},{"name":"At Specified Time","description":"Waits until the set date and time to continue","value":"atSpecifiedTime"}]},{"displayName":"Amount","name":"resumeAmount","type":"number","displayOptions":{"show":{"limitType":["afterTimeInterval"]}},"typeOptions":{"minValue":0,"numberPrecision":2},"default":1,"description":"The time to wait"},{"displayName":"Unit","name":"resumeUnit","type":"options","displayOptions":{"show":{"limitType":["afterTimeInterval"]}},"options":[{"name":"Minutes","value":"minutes"},{"name":"Hours","value":"hours"},{"name":"Days","value":"days"}],"default":"hours","description":"Unit of the interval value"},{"displayName":"Max Date and Time","name":"maxDateAndTime","type":"dateTime","displayOptions":{"show":{"limitType":["atSpecifiedTime"]}},"default":"","description":"Continue execution after the specified date and time"}]}],"displayOptions":{"show":{"/waitUserReply":[true]}}}]},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Limit Wait Time","name":"limitWaitTime","type":"fixedCollection","description":"Whether to limit the time this node should wait for a user response before execution resumes","default":{"values":{"limitType":"afterTimeInterval","resumeAmount":45,"resumeUnit":"minutes"}},"options":[{"displayName":"Values","name":"values","values":[{"displayName":"Limit Type","name":"limitType","type":"options","default":"afterTimeInterval","description":"Sets the condition for the execution to resume. Can be a specified date or after some time.","options":[{"name":"After Time Interval","description":"Waits for a certain amount of time","value":"afterTimeInterval"},{"name":"At Specified Time","description":"Waits until the set date and time to continue","value":"atSpecifiedTime"}]},{"displayName":"Amount","name":"resumeAmount","type":"number","displayOptions":{"show":{"limitType":["afterTimeInterval"]}},"typeOptions":{"minValue":0,"numberPrecision":2},"default":1,"description":"The time to wait"},{"displayName":"Unit","name":"resumeUnit","type":"options","displayOptions":{"show":{"limitType":["afterTimeInterval"]}},"options":[{"name":"Minutes","value":"minutes"},{"name":"Hours","value":"hours"},{"name":"Days","value":"days"}],"default":"hours","description":"Unit of the interval value"},{"displayName":"Max Date and Time","name":"maxDateAndTime","type":"dateTime","displayOptions":{"show":{"limitType":["atSpecifiedTime"]}},"default":"","description":"Continue execution after the specified date and time"}]}],"displayOptions":{"show":{"/waitUserReply":[true]}}}],"displayOptions":{"show":{"@tool":[true],"/waitUserReply":[true]}}}]},
|
|
92
|
-
{"displayName":"Azure AI Search Vector Store","name":"vectorStoreAzureAISearch","description":"Work with your data in Azure AI Search Vector Store","group":["transform"],"version":[1,1.1,1.2,1.3],"defaults":{"name":"Azure AI Search Vector Store"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores","Tools","Root Nodes"],"Vector Stores":["Other Vector Stores"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreazureaisearch/"}]}},"credentials":[{"name":"azureAiSearchApi","required":true}],"inputs":"={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"ai_embedding\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"ai_reranker\", required: true, maxConnections: 1})\n\t\t\t\t}\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":"Tip: Get a feel for vector stores in n8n with our","name":"ragStarterCallout","type":"callout","typeOptions":{"calloutAction":{"label":"RAG starter template","type":"openSampleWorkflowTemplate","templateId":"rag-starter-template"}},"default":""},{"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"},{"name":"Update Documents","value":"update","description":"Update documents in vector store by ID","action":"Update vector store documents"}]},{"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":{"@version":[{"_cnd":{"lte":1.2}}],"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 Azure AI Search Vector Store","displayOptions":{"show":{"mode":["retrieve-as-tool"]}}},{"displayName":"Index Name","name":"indexName","type":"string","default":"n8n-vectorstore","description":"The name of the Azure AI Search index. Will be created automatically if it does not exist.","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":"Clear Index","name":"clearIndex","type":"boolean","default":false,"description":"Whether to delete and recreate the index before inserting new data. Warning: This will reset any custom index configuration (semantic ranking, analyzers, etc.) to defaults."}],"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":"Rerank Results","name":"useReranker","type":"boolean","default":false,"description":"Whether or not to rerank results","displayOptions":{"show":{"mode":["load","retrieve","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":"Query Type","name":"queryType","type":"options","default":"hybrid","description":"The type of search query to perform","options":[{"name":"Vector","value":"vector","description":"Vector similarity search only"},{"name":"Hybrid","value":"hybrid","description":"Combines vector and keyword search (recommended)"},{"name":"Semantic Hybrid","value":"semanticHybrid","description":"Hybrid search with semantic ranking (requires Basic tier or higher)"}]},{"displayName":"Filter","name":"filter","type":"string","default":"","description":"Filter results using OData syntax. Use metadata/fieldName for metadata fields. <a href=\"https://learn.microsoft.com/en-us/azure/search/search-query-odata-filter\" target=\"_blank\">Learn more</a>.","placeholder":"metadata/category eq 'technology' and metadata/author eq 'John'"},{"displayName":"Semantic Configuration","name":"semanticConfiguration","type":"string","default":"","description":"Name of the semantic configuration for semantic ranking (optional)","displayOptions":{"show":{"queryType":["semanticHybrid"]}}}],"displayOptions":{"show":{"mode":["load","retrieve-as-tool"]}}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Query Type","name":"queryType","type":"options","default":"hybrid","description":"The type of search query to perform","options":[{"name":"Vector","value":"vector","description":"Vector similarity search only"},{"name":"Hybrid","value":"hybrid","description":"Combines vector and keyword search (recommended)"},{"name":"Semantic Hybrid","value":"semanticHybrid","description":"Hybrid search with semantic ranking (requires Basic tier or higher)"}]},{"displayName":"Filter","name":"filter","type":"string","default":"","description":"Filter results using OData syntax. Use metadata/fieldName for metadata fields. <a href=\"https://learn.microsoft.com/en-us/azure/search/search-query-odata-filter\" target=\"_blank\">Learn more</a>.","placeholder":"metadata/category eq 'technology' and metadata/author eq 'John'"},{"displayName":"Semantic Configuration","name":"semanticConfiguration","type":"string","default":"","description":"Name of the semantic configuration for semantic ranking (optional)","displayOptions":{"show":{"queryType":["semanticHybrid"]}}}],"displayOptions":{"show":{"mode":["retrieve"]}}}],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreAzureAISearch/azure-aisearch.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreAzureAISearch/azure-aisearch.svg"}},
|
|
92
|
+
{"displayName":"Azure AI Search Vector Store","name":"vectorStoreAzureAISearch","description":"Work with your data in Azure AI Search Vector Store","group":["transform"],"version":[1,1.1,1.2,1.3],"defaults":{"name":"Azure AI Search Vector Store"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores","Tools","Root Nodes"],"Vector Stores":["Other Vector Stores"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreazureaisearch/"}]}},"credentials":[{"name":"azureAiSearchApi","required":true}],"inputs":"={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"ai_embedding\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"ai_reranker\", required: true, maxConnections: 1})\n\t\t\t\t}\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":"Tip: Get a feel for vector stores in n8n with our","name":"ragStarterCallout","type":"callout","typeOptions":{"calloutAction":{"label":"RAG starter template","type":"openSampleWorkflowTemplate","templateId":"rag-starter-template"}},"default":""},{"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"},{"name":"Update Documents","value":"update","description":"Update documents in vector store by ID","action":"Update vector store documents"}]},{"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":{"@version":[{"_cnd":{"lte":1.2}}],"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 Azure AI Search Vector Store","displayOptions":{"show":{"mode":["retrieve-as-tool"]}}},{"displayName":"Index Name","name":"indexName","type":"string","default":"n8n-vectorstore","description":"The name of the Azure AI Search index. Will be created automatically if it does not exist.","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":"Clear Index","name":"clearIndex","type":"boolean","default":false,"description":"Whether to delete and recreate the index before inserting new data. Warning: This will reset any custom index configuration (semantic ranking, analyzers, etc.) to defaults."},{"displayName":"Metadata Keys to Insert","name":"metadataKeysToInsert","type":"string","default":"","placeholder":"e.g., source,author,category","description":"Comma-separated list of metadata keys to store in Azure AI Search. Leave empty to include all metadata. Azure AI Search stores metadata in an \"attributes\" array format."}],"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":"Rerank Results","name":"useReranker","type":"boolean","default":false,"description":"Whether or not to rerank results","displayOptions":{"show":{"mode":["load","retrieve","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":"Query Type","name":"queryType","type":"options","default":"hybrid","description":"The type of search query to perform","options":[{"name":"Vector","value":"vector","description":"Vector similarity search only"},{"name":"Hybrid","value":"hybrid","description":"Combines vector and keyword search (recommended)"},{"name":"Semantic Hybrid","value":"semanticHybrid","description":"Hybrid search with semantic ranking (requires Basic tier or higher)"}]},{"displayName":"Filter","name":"filter","type":"string","default":"","description":"Filter results using OData syntax. Use metadata/fieldName for metadata fields. <a href=\"https://learn.microsoft.com/en-us/azure/search/search-query-odata-filter\" target=\"_blank\">Learn more</a>.","placeholder":"metadata/category eq 'technology' and metadata/author eq 'John'"},{"displayName":"Semantic Configuration","name":"semanticConfiguration","type":"string","default":"","description":"Name of the semantic configuration for semantic ranking (optional)","displayOptions":{"show":{"queryType":["semanticHybrid"]}}}],"displayOptions":{"show":{"mode":["load","retrieve-as-tool"]}}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Query Type","name":"queryType","type":"options","default":"hybrid","description":"The type of search query to perform","options":[{"name":"Vector","value":"vector","description":"Vector similarity search only"},{"name":"Hybrid","value":"hybrid","description":"Combines vector and keyword search (recommended)"},{"name":"Semantic Hybrid","value":"semanticHybrid","description":"Hybrid search with semantic ranking (requires Basic tier or higher)"}]},{"displayName":"Filter","name":"filter","type":"string","default":"","description":"Filter results using OData syntax. Use metadata/fieldName for metadata fields. <a href=\"https://learn.microsoft.com/en-us/azure/search/search-query-odata-filter\" target=\"_blank\">Learn more</a>.","placeholder":"metadata/category eq 'technology' and metadata/author eq 'John'"},{"displayName":"Semantic Configuration","name":"semanticConfiguration","type":"string","default":"","description":"Name of the semantic configuration for semantic ranking (optional)","displayOptions":{"show":{"queryType":["semanticHybrid"]}}}],"displayOptions":{"show":{"mode":["retrieve"]}}}],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreAzureAISearch/azure-aisearch.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreAzureAISearch/azure-aisearch.svg"}},
|
|
93
93
|
{"displayName":"Simple Vector Store","name":"vectorStoreInMemory","description":"The easiest way to experiment with vector stores, without external setup.","icon":"fa:database","iconColor":"black","group":["transform"],"version":[1,1.1,1.2,1.3],"defaults":{"name":"Simple Vector Store"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores","Tools","Root Nodes"],"Vector Stores":["For Beginners"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/"}]}},"inputs":"={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"ai_embedding\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"ai_reranker\", required: true, maxConnections: 1})\n\t\t\t\t}\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":"Tip: Get a feel for vector stores in n8n with our","name":"ragStarterCallout","type":"callout","typeOptions":{"calloutAction":{"label":"RAG starter template","type":"openSampleWorkflowTemplate","templateId":"rag-starter-template"}},"default":""},{"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":{"@version":[{"_cnd":{"lte":1.2}}],"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. The easiest way to experiment with vector stores, without external setup.","displayOptions":{"show":{"mode":["retrieve-as-tool"]}}},{"displayName":"Memory Key","name":"memoryKey","type":"string","default":"vector_store_key","description":"The key to use to store the vector memory in the workflow data. The key will be prefixed with the workflow ID to avoid collisions.","displayOptions":{"show":{"@version":[{"_cnd":{"lte":1.1}}]}}},{"displayName":"Memory Key","name":"memoryKey","type":"resourceLocator","required":true,"default":{"mode":"list","value":"vector_store_key"},"description":"The key to use to store the vector memory in the workflow data. These keys are shared between workflows.","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.2}}]}},"modes":[{"displayName":"From List","name":"list","type":"list","typeOptions":{"searchListMethod":"vectorStoresSearch","searchable":true,"allowNewResource":{"label":"resourceLocator.mode.list.addNewResource.vectorStoreInMemory","defaultName":"vector_store_key","method":"createVectorStore"}}},{"displayName":"Manual","name":"id","type":"string","placeholder":"vector_store_key"}]},{"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":"Clear Store","name":"clearStore","type":"boolean","default":false,"description":"Whether to clear the store before inserting new data","displayOptions":{"show":{"mode":["insert"]}}},{"displayName":"<strong>For experimental use only</strong>: Data is stored in memory and will be lost if n8n restarts. Data may also be cleared if available memory gets low, and is accessible to all users of this instance. <a href=\"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/\">More info</a>","name":"notice","type":"notice","default":"","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":"Rerank Results","name":"useReranker","type":"boolean","default":false,"description":"Whether or not to rerank results","displayOptions":{"show":{"mode":["load","retrieve","retrieve-as-tool"]}}},{"displayName":"ID","name":"id","type":"string","default":"","required":true,"description":"ID of an embedding entry","displayOptions":{"show":{"mode":["update"]}}},{"displayName":"<strong>For experimental use only</strong>: Data is stored in memory and will be lost if n8n restarts. Data may also be cleared if available memory gets low, and is accessible to all users of this instance. <a href=\"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/\">More info</a>","name":"notice","type":"notice","default":"","displayOptions":{"show":{"mode":["load","retrieve-as-tool"]}}},{"displayName":"<strong>For experimental use only</strong>: Data is stored in memory and will be lost if n8n restarts. Data may also be cleared if available memory gets low, and is accessible to all users of this instance. <a href=\"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/\">More info</a>","name":"notice","type":"notice","default":"","displayOptions":{"show":{"mode":["retrieve"]}}}]},
|
|
94
94
|
{"displayName":"In Memory Vector Store Insert","name":"vectorStoreInMemoryInsert","icon":"fa:database","group":["transform"],"version":1,"hidden":true,"description":"Insert data into an in-memory vector store","defaults":{"name":"In Memory Vector Store Insert"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/"}]}},"inputs":["main",{"displayName":"Document","maxConnections":1,"type":"ai_document","required":true},{"displayName":"Embedding","maxConnections":1,"type":"ai_embedding","required":true}],"outputs":["main"],"properties":[{"displayName":"The embbded data are stored in the server memory, so they will be lost when the server is restarted. Additionally, if the amount of data is too large, it may cause the server to crash due to insufficient memory.","name":"notice","type":"notice","default":""},{"displayName":"Clear Store","name":"clearStore","type":"boolean","default":false,"description":"Whether to clear the store before inserting new data"},{"displayName":"Memory Key","name":"memoryKey","type":"string","default":"vector_store_key","description":"The key to use to store the vector memory in the workflow data. The key will be prefixed with the workflow ID to avoid collisions."}]},
|
|
95
95
|
{"displayName":"In Memory Vector Store Load","name":"vectorStoreInMemoryLoad","icon":"fa:database","group":["transform"],"version":1,"hidden":true,"description":"Load embedded data from an in-memory vector store","defaults":{"name":"In Memory Vector Store Load"},"codex":{"categories":["AI"],"subcategories":{"AI":["Vector Stores"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/"}]}},"inputs":[{"displayName":"Embedding","maxConnections":1,"type":"ai_embedding","required":true}],"outputs":["ai_vectorStore"],"outputNames":["Vector Store"],"properties":[{"displayName":"Memory Key","name":"memoryKey","type":"string","default":"vector_store_key","description":"The key to use to store the vector memory in the workflow data. The key will be prefixed with the workflow ID to avoid collisions."}]},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/n8n-nodes-langchain",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -229,14 +229,14 @@
|
|
|
229
229
|
"weaviate-client": "3.9.0",
|
|
230
230
|
"zod": "3.25.67",
|
|
231
231
|
"zod-to-json-schema": "3.23.3",
|
|
232
|
+
"@n8n/client-oauth2": "1.0.0-rc.0",
|
|
232
233
|
"@n8n/config": "2.3.0",
|
|
233
234
|
"@n8n/di": "0.10.0",
|
|
234
|
-
"@n8n/json-schema-to-zod": "1.6.0",
|
|
235
235
|
"@n8n/errors": "0.5.0",
|
|
236
|
-
"@n8n/
|
|
236
|
+
"@n8n/json-schema-to-zod": "1.6.0",
|
|
237
237
|
"@n8n/typescript-config": "1.3.0",
|
|
238
|
-
"n8n-
|
|
239
|
-
"n8n-
|
|
238
|
+
"n8n-workflow": "2.4.3",
|
|
239
|
+
"n8n-nodes-base": "2.4.5"
|
|
240
240
|
},
|
|
241
241
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
242
242
|
"homepage": "https://n8n.io",
|