diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts index f531d3ebad..2830ca02c3 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { INodeInputConfiguration, INodeInputFilter, @@ -7,6 +7,7 @@ import type { INodeType, INodeTypeDescription, INodeProperties, + NodeConnectionType, } from 'n8n-workflow'; import { promptTypeOptions, textFromPreviousNode, textInput } from '@utils/descriptions'; @@ -85,7 +86,7 @@ function getInputs( if (agent === 'conversationalAgent') { specialInputs = [ { - type: NodeConnectionType.AiLanguageModel, + type: 'ai_languageModel', filter: { nodes: [ '@n8n/n8n-nodes-langchain.lmChatAnthropic', @@ -103,19 +104,19 @@ function getInputs( }, }, { - type: NodeConnectionType.AiMemory, + type: 'ai_memory', }, { - type: NodeConnectionType.AiTool, + type: 'ai_tool', }, { - type: NodeConnectionType.AiOutputParser, + type: 'ai_outputParser', }, ]; } else if (agent === 'toolsAgent') { specialInputs = [ { - type: NodeConnectionType.AiLanguageModel, + type: 'ai_languageModel', filter: { nodes: [ '@n8n/n8n-nodes-langchain.lmChatAnthropic', @@ -133,20 +134,20 @@ function getInputs( }, }, { - type: NodeConnectionType.AiMemory, + type: 'ai_memory', }, { - type: NodeConnectionType.AiTool, + type: 'ai_tool', required: true, }, { - type: NodeConnectionType.AiOutputParser, + type: 'ai_outputParser', }, ]; } else if (agent === 'openAiFunctionsAgent') { specialInputs = [ { - type: NodeConnectionType.AiLanguageModel, + type: 'ai_languageModel', filter: { nodes: [ '@n8n/n8n-nodes-langchain.lmChatOpenAi', @@ -155,57 +156,55 @@ function getInputs( }, }, { - type: NodeConnectionType.AiMemory, + type: 'ai_memory', }, { - type: NodeConnectionType.AiTool, + type: 'ai_tool', required: true, }, { - type: NodeConnectionType.AiOutputParser, + type: 'ai_outputParser', }, ]; } else if (agent === 'reActAgent') { specialInputs = [ { - type: NodeConnectionType.AiLanguageModel, + type: 'ai_languageModel', }, { - type: NodeConnectionType.AiTool, + type: 'ai_tool', }, { - type: NodeConnectionType.AiOutputParser, + type: 'ai_outputParser', }, ]; } else if (agent === 'sqlAgent') { specialInputs = [ { - type: NodeConnectionType.AiLanguageModel, + type: 'ai_languageModel', }, { - type: NodeConnectionType.AiMemory, + type: 'ai_memory', }, ]; } else if (agent === 'planAndExecuteAgent') { specialInputs = [ { - type: NodeConnectionType.AiLanguageModel, + type: 'ai_languageModel', }, { - type: NodeConnectionType.AiTool, + type: 'ai_tool', }, { - type: NodeConnectionType.AiOutputParser, + type: 'ai_outputParser', }, ]; } if (hasOutputParser === false) { - specialInputs = specialInputs.filter( - (input) => input.type !== NodeConnectionType.AiOutputParser, - ); + specialInputs = specialInputs.filter((input) => input.type !== 'ai_outputParser'); } - return [NodeConnectionType.Main, ...getInputData(specialInputs)]; + return ['main', ...getInputData(specialInputs)]; } const agentTypeProperty: INodeProperties = { @@ -290,7 +289,7 @@ export class Agent implements INodeType { return getInputs(agent, hasOutputParser) })($parameter.agent, $parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true) }}`, - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [ { // eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed @@ -430,7 +429,7 @@ export class Agent implements INodeType { }, }, { - displayName: `Connect an output parser on the canvas to specify the output format you require`, + displayName: `Connect an output parser on the canvas to specify the output format you require`, name: 'notice', type: 'notice', default: '', diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts index ba90ddfea5..b7197cebdf 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts @@ -2,7 +2,7 @@ import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; import { PromptTemplate } from '@langchain/core/prompts'; import { initializeAgentExecutorWithOptions } from 'langchain/agents'; import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { isChatInstance, getPromptInputByType, getConnectedTools } from '@utils/helpers'; import { getOptionalOutputParser } from '@utils/output_parsers/N8nOutputParser'; @@ -16,13 +16,13 @@ export async function conversationalAgentExecute( nodeVersion: number, ): Promise { this.logger.debug('Executing Conversational Agent'); - const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0); + const model = await this.getInputConnectionData(NodeConnectionTypes.AiLanguageModel, 0); if (!isChatInstance(model)) { throw new NodeOperationError(this.getNode(), 'Conversational Agent requires Chat Model'); } - const memory = (await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + const memory = (await this.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BaseChatMemory | undefined; diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts index cfc3ff5a03..d71ff645dd 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts @@ -6,7 +6,7 @@ import { BufferMemory, type BaseChatMemory } from 'langchain/memory'; import { type IExecuteFunctions, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, } from 'n8n-workflow'; @@ -22,7 +22,7 @@ export async function openAiFunctionsAgentExecute( ): Promise { this.logger.debug('Executing OpenAi Functions Agent'); const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as ChatOpenAI; @@ -32,7 +32,7 @@ export async function openAiFunctionsAgentExecute( 'OpenAI Functions Agent requires OpenAI Chat Model', ); } - const memory = (await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + const memory = (await this.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BaseChatMemory | undefined; const tools = await getConnectedTools(this, nodeVersion >= 1.5, false); diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts index 8a73b2a2db..576d25d0cc 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts @@ -4,7 +4,7 @@ import { PlanAndExecuteAgentExecutor } from 'langchain/experimental/plan_and_exe import { type IExecuteFunctions, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, } from 'n8n-workflow'; @@ -21,7 +21,7 @@ export async function planAndExecuteAgentExecute( ): Promise { this.logger.debug('Executing PlanAndExecute Agent'); const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseChatModel; diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts index 117cd306c5..21a358c327 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts @@ -5,7 +5,7 @@ import { AgentExecutor, ChatAgent, ZeroShotAgent } from 'langchain/agents'; import { type IExecuteFunctions, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, } from 'n8n-workflow'; @@ -22,7 +22,7 @@ export async function reActAgentAgentExecute( ): Promise { this.logger.debug('Executing ReAct Agent'); - const model = (await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0)) as + const model = (await this.getInputConnectionData(NodeConnectionTypes.AiLanguageModel, 0)) as | BaseLanguageModel | BaseChatModel; diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts index 369ca109af..e61439bcda 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts @@ -7,7 +7,7 @@ import { SqlDatabase } from 'langchain/sql_db'; import { type IExecuteFunctions, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, type IDataObject, } from 'n8n-workflow'; @@ -32,7 +32,7 @@ export async function sqlAgentAgentExecute( this.logger.debug('Executing SQL Agent'); const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; const items = this.getInputData(); @@ -113,7 +113,7 @@ export async function sqlAgentAgentExecute( const toolkit = new SqlToolkit(dbInstance, model); const agentExecutor = createSqlAgent(model, toolkit, agentOptions); - const memory = (await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + const memory = (await this.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BaseChatMemory | undefined; diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts index adbf9de87b..db1e0ffbe7 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts @@ -11,7 +11,7 @@ import type { AgentAction, AgentFinish } from 'langchain/agents'; import { AgentExecutor, createToolCallingAgent } from 'langchain/agents'; import type { ToolsAgentAction } from 'langchain/dist/agents/tool_calling/output_parser'; import { omit } from 'lodash'; -import { BINARY_ENCODING, jsonParse, NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { BINARY_ENCODING, jsonParse, NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow'; import type { ZodObject } from 'zod'; import { z } from 'zod'; @@ -275,7 +275,7 @@ export const getAgentStepsParser = * @returns The validated chat model */ export async function getChatModel(ctx: IExecuteFunctions): Promise { - const model = await ctx.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0); + const model = await ctx.getInputConnectionData(NodeConnectionTypes.AiLanguageModel, 0); if (!isChatInstance(model) || !model.bindTools) { throw new NodeOperationError( ctx.getNode(), @@ -294,7 +294,7 @@ export async function getChatModel(ctx: IExecuteFunctions): Promise { - return (await ctx.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + return (await ctx.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BaseChatMemory | undefined; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts b/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts index e44ad8f9d2..10f8808ff9 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts @@ -1,7 +1,7 @@ import { AgentExecutor } from 'langchain/agents'; import type { OpenAIToolType } from 'langchain/dist/experimental/openai_assistant/schema'; import { OpenAIAssistantRunnable } from 'langchain/experimental/openai_assistant'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { IExecuteFunctions, INodeExecutionData, @@ -44,10 +44,10 @@ export class OpenAiAssistant implements INodeType { }, }, inputs: [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiTool, displayName: 'Tools' }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiTool, displayName: 'Tools' }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [ { name: 'openAiApi', diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts index 06f79f0b9b..1419e5823c 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/ChainLlm.node.ts @@ -5,7 +5,7 @@ import type { INodeType, INodeTypeDescription, } from 'n8n-workflow'; -import { NodeApiError, NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeApiError, NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { getPromptInputByType } from '@utils/helpers'; import { getOptionalOutputParser } from '@utils/output_parsers/N8nOutputParser'; @@ -55,7 +55,7 @@ export class ChainLlm implements INodeType { }, }, inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`, - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [], properties: nodeProperties, }; @@ -73,7 +73,7 @@ export class ChainLlm implements INodeType { try { // Get the language model const llm = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts index 15686918be..098bc8a8e1 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts @@ -3,8 +3,8 @@ import { HumanMessagePromptTemplate, SystemMessagePromptTemplate, } from '@langchain/core/prompts'; -import type { IDataObject, INodeProperties } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import type { IDataObject, INodeInputConfiguration, INodeProperties } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { promptTypeOptions, textFromPreviousNode } from '@utils/descriptions'; import { getTemplateNoticeField } from '@utils/sharedFields'; @@ -13,7 +13,7 @@ import { getTemplateNoticeField } from '@utils/sharedFields'; * Dynamic input configuration generation based on node parameters */ export function getInputs(parameters: IDataObject) { - const inputs = [ + const inputs: INodeInputConfiguration[] = [ { displayName: '', type: 'main' }, { displayName: 'Model', @@ -260,7 +260,7 @@ export const nodeProperties: INodeProperties[] = [ ], }, { - displayName: `Connect an output parser on the canvas to specify the output format you require`, + displayName: `Connect an output parser on the canvas to specify the output format you require`, name: 'notice', type: 'notice', default: '', diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts index 5cbe2990ed..bd3e41a681 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/imageUtils.ts @@ -3,7 +3,7 @@ import { HumanMessage } from '@langchain/core/messages'; import { ChatGoogleGenerativeAI } from '@langchain/google-genai'; import { ChatOllama } from '@langchain/ollama'; import type { IExecuteFunctions, IBinaryData } from 'n8n-workflow'; -import { NodeOperationError, NodeConnectionType, OperationalError } from 'n8n-workflow'; +import { NodeOperationError, NodeConnectionTypes, OperationalError } from 'n8n-workflow'; import type { MessageTemplate } from './types'; @@ -69,7 +69,7 @@ export async function createImageMessage({ const bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey); const model = (await context.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/ChainLlm.node.test.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/ChainLlm.node.test.ts index 0ddbd983c3..75fa9ae1eb 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/ChainLlm.node.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/ChainLlm.node.test.ts @@ -3,7 +3,7 @@ import { FakeChatModel } from '@langchain/core/utils/testing'; import { mock } from 'jest-mock-extended'; import type { IExecuteFunctions, INode } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import * as helperModule from '@utils/helpers'; import * as outputParserModule from '@utils/output_parsers/N8nOutputParser'; @@ -64,7 +64,7 @@ describe('ChainLlm Node', () => { expect(node.description.version).toContain(1.5); expect(node.description.properties).toBeDefined(); expect(node.description.inputs).toBeDefined(); - expect(node.description.outputs).toEqual([NodeConnectionType.Main]); + expect(node.description.outputs).toEqual([NodeConnectionTypes.Main]); }); }); diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts index 997b48fb54..2ec49822d7 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { getInputs, nodeProperties } from '../methods/config'; @@ -8,24 +8,24 @@ describe('config', () => { const inputs = getInputs({}); expect(inputs).toHaveLength(3); - expect(inputs[0].type).toBe(NodeConnectionType.Main); - expect(inputs[1].type).toBe(NodeConnectionType.AiLanguageModel); - expect(inputs[2].type).toBe(NodeConnectionType.AiOutputParser); + expect(inputs[0].type).toBe(NodeConnectionTypes.Main); + expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel); + expect(inputs[2].type).toBe(NodeConnectionTypes.AiOutputParser); }); it('should exclude the OutputParser when hasOutputParser is false', () => { const inputs = getInputs({ hasOutputParser: false }); expect(inputs).toHaveLength(2); - expect(inputs[0].type).toBe(NodeConnectionType.Main); - expect(inputs[1].type).toBe(NodeConnectionType.AiLanguageModel); + expect(inputs[0].type).toBe(NodeConnectionTypes.Main); + expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel); }); it('should include the OutputParser when hasOutputParser is true', () => { const inputs = getInputs({ hasOutputParser: true }); expect(inputs).toHaveLength(3); - expect(inputs[2].type).toBe(NodeConnectionType.AiOutputParser); + expect(inputs[2].type).toBe(NodeConnectionTypes.AiOutputParser); }); }); diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts index 14e443c6a3..4640603f69 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts @@ -8,7 +8,7 @@ import { import type { BaseRetriever } from '@langchain/core/retrievers'; import { createStuffDocumentsChain } from 'langchain/chains/combine_documents'; import { createRetrievalChain } from 'langchain/chains/retrieval'; -import { NodeConnectionType, NodeOperationError, parseErrorMetadata } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError, parseErrorMetadata } from 'n8n-workflow'; import { type INodeProperties, type IExecuteFunctions, @@ -70,21 +70,21 @@ export class ChainRetrievalQa implements INodeType { }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, { displayName: 'Retriever', maxConnections: 1, - type: NodeConnectionType.AiRetriever, + type: NodeConnectionTypes.AiRetriever, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [], properties: [ getTemplateNoticeField(1960), @@ -192,12 +192,12 @@ export class ChainRetrievalQa implements INodeType { for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { try { const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; const retriever = (await this.getInputConnectionData( - NodeConnectionType.AiRetriever, + NodeConnectionTypes.AiRetriever, 0, )) as BaseRetriever; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/test/ChainRetrievalQa.node.test.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/test/ChainRetrievalQa.node.test.ts index cd1169acee..36e118464b 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/test/ChainRetrievalQa.node.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/test/ChainRetrievalQa.node.test.ts @@ -3,8 +3,8 @@ import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import type { BaseRetriever } from '@langchain/core/retrievers'; import { FakeChatModel, FakeLLM, FakeRetriever } from '@langchain/core/utils/testing'; import get from 'lodash/get'; -import type { IDataObject, IExecuteFunctions } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError, UnexpectedError } from 'n8n-workflow'; +import type { IDataObject, IExecuteFunctions, NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError, UnexpectedError } from 'n8n-workflow'; import { ChainRetrievalQa } from '../ChainRetrievalQa.node'; @@ -27,10 +27,10 @@ const createExecuteFunctionsMock = ( }; }, getInputConnectionData(type: NodeConnectionType) { - if (type === NodeConnectionType.AiLanguageModel) { + if (type === NodeConnectionTypes.AiLanguageModel) { return fakeLlm; } - if (type === NodeConnectionType.AiRetriever) { + if (type === NodeConnectionTypes.AiRetriever) { return fakeRetriever; } return null; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts index fedf979082..6507e8617d 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts @@ -4,7 +4,7 @@ import { PromptTemplate } from '@langchain/core/prompts'; import type { SummarizationChainParams } from 'langchain/chains'; import { loadSummarizationChain } from 'langchain/chains'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeTypeBaseDescription, type IExecuteFunctions, type INodeExecutionData, @@ -31,21 +31,21 @@ export class ChainSummarizationV1 implements INodeType { }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, { displayName: 'Document', maxConnections: 1, - type: NodeConnectionType.AiDocument, + type: NodeConnectionTypes.AiDocument, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [], properties: [ getTemplateNoticeField(1951), @@ -167,11 +167,11 @@ export class ChainSummarizationV1 implements INodeType { const type = this.getNodeParameter('type', 0) as 'map_reduce' | 'stuff' | 'refine'; const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; - const documentInput = (await this.getInputConnectionData(NodeConnectionType.AiDocument, 0)) as + const documentInput = (await this.getInputConnectionData(NodeConnectionTypes.AiDocument, 0)) as | N8nJsonLoader | Array>>; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts index fa074edc3b..7cb2bed603 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts @@ -10,8 +10,9 @@ import type { INodeType, INodeTypeDescription, IDataObject, + INodeInputConfiguration, } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { N8nBinaryLoader } from '@utils/N8nBinaryLoader'; import { N8nJsonLoader } from '@utils/N8nJsonLoader'; @@ -24,7 +25,7 @@ import { REFINE_PROMPT_TEMPLATE, DEFAULT_PROMPT_TEMPLATE } from '../prompt'; function getInputs(parameters: IDataObject) { const chunkingMode = parameters?.chunkingMode; const operationMode = parameters?.operationMode; - const inputs = [ + const inputs: INodeInputConfiguration[] = [ { displayName: '', type: 'main' }, { displayName: 'Model', @@ -69,7 +70,7 @@ export class ChainSummarizationV2 implements INodeType { }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`, - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [], properties: [ getTemplateNoticeField(1951), @@ -327,7 +328,7 @@ export class ChainSummarizationV2 implements INodeType { for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { try { const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; @@ -356,7 +357,7 @@ export class ChainSummarizationV2 implements INodeType { // Use dedicated document loader input to load documents if (operationMode === 'documentLoader') { const documentInput = (await this.getInputConnectionData( - NodeConnectionType.AiDocument, + NodeConnectionTypes.AiDocument, 0, )) as N8nJsonLoader | Array>>; @@ -390,7 +391,7 @@ export class ChainSummarizationV2 implements INodeType { // In advanced mode user can connect text splitter node so we just retrieve it case 'advanced': textSplitter = (await this.getInputConnectionData( - NodeConnectionType.AiTextSplitter, + NodeConnectionTypes.AiTextSplitter, 0, )) as TextSplitter | undefined; break; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/InformationExtractor/InformationExtractor.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/InformationExtractor/InformationExtractor.node.ts index 365a35ddd3..182e488782 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/InformationExtractor/InformationExtractor.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/InformationExtractor/InformationExtractor.node.ts @@ -3,7 +3,7 @@ import { HumanMessage } from '@langchain/core/messages'; import { ChatPromptTemplate, SystemMessagePromptTemplate } from '@langchain/core/prompts'; import type { JSONSchema7 } from 'json-schema'; import { OutputFixingParser, StructuredOutputParser } from 'langchain/output_parsers'; -import { jsonParse, NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { jsonParse, NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { INodeType, INodeTypeDescription, @@ -51,15 +51,15 @@ export class InformationExtractor implements INodeType { name: 'Information Extractor', }, inputs: [ - { displayName: '', type: NodeConnectionType.Main }, + { displayName: '', type: NodeConnectionTypes.Main }, { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: 'Text', @@ -222,7 +222,7 @@ export class InformationExtractor implements INodeType { const items = this.getInputData(); const llm = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts index e810b0f98a..577634ca98 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts @@ -2,7 +2,7 @@ import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import { HumanMessage } from '@langchain/core/messages'; import { SystemMessagePromptTemplate, ChatPromptTemplate } from '@langchain/core/prompts'; import { OutputFixingParser, StructuredOutputParser } from 'langchain/output_parsers'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { IDataObject, IExecuteFunctions, @@ -24,7 +24,7 @@ const configuredOutputs = (parameters: INodeParameters, defaultCategories: strin const categories = (options?.categories as string) ?? defaultCategories; const categoriesArray = categories.split(',').map((cat) => cat.trim()); - const ret = categoriesArray.map((cat) => ({ type: NodeConnectionType.Main, displayName: cat })); + const ret = categoriesArray.map((cat) => ({ type: NodeConnectionTypes.Main, displayName: cat })); return ret; }; @@ -54,11 +54,11 @@ export class SentimentAnalysis implements INodeType { name: 'Sentiment Analysis', }, inputs: [ - { displayName: '', type: NodeConnectionType.Main }, + { displayName: '', type: NodeConnectionTypes.Main }, { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, ], @@ -140,7 +140,7 @@ export class SentimentAnalysis implements INodeType { const items = this.getInputData(); const llm = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; diff --git a/packages/@n8n/nodes-langchain/nodes/chains/TextClassifier/TextClassifier.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/TextClassifier/TextClassifier.node.ts index 298c41572d..8cc241c294 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/TextClassifier/TextClassifier.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/TextClassifier/TextClassifier.node.ts @@ -2,7 +2,7 @@ import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import { HumanMessage } from '@langchain/core/messages'; import { SystemMessagePromptTemplate, ChatPromptTemplate } from '@langchain/core/prompts'; import { OutputFixingParser, StructuredOutputParser } from 'langchain/output_parsers'; -import { NodeOperationError, NodeConnectionType } from 'n8n-workflow'; +import { NodeOperationError, NodeConnectionTypes } from 'n8n-workflow'; import type { IDataObject, IExecuteFunctions, @@ -22,9 +22,9 @@ const configuredOutputs = (parameters: INodeParameters) => { const categories = ((parameters.categories as IDataObject)?.categories as IDataObject[]) ?? []; const fallback = (parameters.options as IDataObject)?.fallback as string; const ret = categories.map((cat) => { - return { type: NodeConnectionType.Main, displayName: cat.category }; + return { type: NodeConnectionTypes.Main, displayName: cat.category }; }); - if (fallback === 'other') ret.push({ type: NodeConnectionType.Main, displayName: 'Other' }); + if (fallback === 'other') ret.push({ type: NodeConnectionTypes.Main, displayName: 'Other' }); return ret; }; @@ -54,11 +54,11 @@ export class TextClassifier implements INodeType { name: 'Text Classifier', }, inputs: [ - { displayName: '', type: NodeConnectionType.Main }, + { displayName: '', type: NodeConnectionTypes.Main }, { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, ], @@ -167,7 +167,7 @@ export class TextClassifier implements INodeType { const items = this.getInputData(); const llm = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; diff --git a/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts b/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts index dda3f24414..716e74648f 100644 --- a/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/code/Code.node.ts @@ -4,7 +4,7 @@ import { makeResolverFromLegacyOptions } from '@n8n/vm2'; import { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox'; import { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox'; import { standardizeOutput } from 'n8n-nodes-base/dist/nodes/Code/utils'; -import { NodeOperationError, NodeConnectionType } from 'n8n-workflow'; +import { NodeOperationError, NodeConnectionTypes } from 'n8n-workflow'; import type { IExecuteFunctions, INodeExecutionData, @@ -24,16 +24,16 @@ const { NODE_FUNCTION_ALLOW_BUILTIN: builtIn, NODE_FUNCTION_ALLOW_EXTERNAL: exte // TODO: Replace const connectorTypes = { - [NodeConnectionType.AiChain]: 'Chain', - [NodeConnectionType.AiDocument]: 'Document', - [NodeConnectionType.AiEmbedding]: 'Embedding', - [NodeConnectionType.AiLanguageModel]: 'Language Model', - [NodeConnectionType.AiMemory]: 'Memory', - [NodeConnectionType.AiOutputParser]: 'Output Parser', - [NodeConnectionType.AiTextSplitter]: 'Text Splitter', - [NodeConnectionType.AiTool]: 'Tool', - [NodeConnectionType.AiVectorStore]: 'Vector Store', - [NodeConnectionType.Main]: 'Main', + [NodeConnectionTypes.AiChain]: 'Chain', + [NodeConnectionTypes.AiDocument]: 'Document', + [NodeConnectionTypes.AiEmbedding]: 'Embedding', + [NodeConnectionTypes.AiLanguageModel]: 'Language Model', + [NodeConnectionTypes.AiMemory]: 'Memory', + [NodeConnectionTypes.AiOutputParser]: 'Output Parser', + [NodeConnectionTypes.AiTextSplitter]: 'Text Splitter', + [NodeConnectionTypes.AiTool]: 'Tool', + [NodeConnectionTypes.AiVectorStore]: 'Vector Store', + [NodeConnectionTypes.Main]: 'Main', }; const defaultCodeExecute = `const { PromptTemplate } = require('@langchain/core/prompts'); @@ -304,7 +304,7 @@ export class Code implements INodeType { const outputs = this.getNodeOutputs(); const mainOutputs: INodeOutputConfiguration[] = outputs.filter( - (output) => output.type === NodeConnectionType.Main, + (output) => output.type === NodeConnectionTypes.Main, ); const options = { multiOutput: mainOutputs.length !== 1 }; diff --git a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.ts b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.ts index 5c9ebf08b0..52a1411d9e 100644 --- a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { TextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -51,15 +51,15 @@ export class DocumentBinaryInputLoader implements INodeType { { displayName: 'Text Splitter', maxConnections: 1, - type: NodeConnectionType.AiTextSplitter, + type: NodeConnectionTypes.AiTextSplitter, required: true, }, ], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiDocument], + outputs: [NodeConnectionTypes.AiDocument], outputNames: ['Document'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Loader Type', name: 'loader', @@ -179,7 +179,7 @@ export class DocumentBinaryInputLoader implements INodeType { async supplyData(this: ISupplyDataFunctions): Promise { this.logger.debug('Supply Data for Binary Input Loader'); const textSplitter = (await this.getInputConnectionData( - NodeConnectionType.AiTextSplitter, + NodeConnectionTypes.AiTextSplitter, 0, )) as TextSplitter | undefined; diff --git a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.ts b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.ts index 46e4120764..ca9b1e5053 100644 --- a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { TextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -49,12 +49,12 @@ export class DocumentDefaultDataLoader implements INodeType { { displayName: 'Text Splitter', maxConnections: 1, - type: NodeConnectionType.AiTextSplitter, + type: NodeConnectionTypes.AiTextSplitter, required: true, }, ], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiDocument], + outputs: [NodeConnectionTypes.AiDocument], outputNames: ['Document'], properties: [ { @@ -286,7 +286,7 @@ export class DocumentDefaultDataLoader implements INodeType { async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise { const dataType = this.getNodeParameter('dataType', itemIndex, 'json') as 'json' | 'binary'; const textSplitter = (await this.getInputConnectionData( - NodeConnectionType.AiTextSplitter, + NodeConnectionTypes.AiTextSplitter, 0, )) as TextSplitter | undefined; const binaryDataKey = this.getNodeParameter('binaryDataKey', itemIndex, '') as string; diff --git a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.ts b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.ts index 7d63e32f0b..49efeb0cb1 100644 --- a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.ts @@ -2,7 +2,7 @@ import { GithubRepoLoader } from '@langchain/community/document_loaders/web/github'; import type { CharacterTextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -47,15 +47,15 @@ export class DocumentGithubLoader implements INodeType { { displayName: 'Text Splitter', maxConnections: 1, - type: NodeConnectionType.AiTextSplitter, + type: NodeConnectionTypes.AiTextSplitter, }, ], inputNames: ['Text Splitter'], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiDocument], + outputs: [NodeConnectionTypes.AiDocument], outputNames: ['Document'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Repository Link', name: 'repository', @@ -106,11 +106,11 @@ export class DocumentGithubLoader implements INodeType { }; const textSplitter = (await this.getInputConnectionData( - NodeConnectionType.AiTextSplitter, + NodeConnectionTypes.AiTextSplitter, 0, )) as CharacterTextSplitter | undefined; - const { index } = this.addInputData(NodeConnectionType.AiDocument, [ + const { index } = this.addInputData(NodeConnectionTypes.AiDocument, [ [{ json: { repository, branch, ignorePaths, recursive } }], ]); const docs = new GithubRepoLoader(repository, { @@ -125,7 +125,7 @@ export class DocumentGithubLoader implements INodeType { ? await textSplitter.splitDocuments(await docs.load()) : await docs.load(); - this.addOutputData(NodeConnectionType.AiDocument, index, [[{ json: { loadedDocs } }]]); + this.addOutputData(NodeConnectionTypes.AiDocument, index, [[{ json: { loadedDocs } }]]); return { response: logWrapper(loadedDocs, this), }; diff --git a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.ts b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.ts index 9c295ba144..05de2f3884 100644 --- a/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { TextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,15 +44,15 @@ export class DocumentJsonInputLoader implements INodeType { { displayName: 'Text Splitter', maxConnections: 1, - type: NodeConnectionType.AiTextSplitter, + type: NodeConnectionTypes.AiTextSplitter, }, ], inputNames: ['Text Splitter'], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiDocument], + outputs: [NodeConnectionTypes.AiDocument], outputNames: ['Document'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Pointers', name: 'pointers', @@ -82,7 +82,7 @@ export class DocumentJsonInputLoader implements INodeType { async supplyData(this: ISupplyDataFunctions): Promise { this.logger.debug('Supply Data for JSON Input Loader'); const textSplitter = (await this.getInputConnectionData( - NodeConnectionType.AiTextSplitter, + NodeConnectionTypes.AiTextSplitter, 0, )) as TextSplitter | undefined; diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts index fdb2da5ce0..e58fd24948 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { BedrockEmbeddings } from '@langchain/aws'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -45,14 +45,14 @@ export class EmbeddingsAwsBedrock implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], requestDefaults: { ignoreHttpStatusErrors: true, baseURL: '=https://bedrock.{{$credentials?.region ?? "eu-central-1"}}.amazonaws.com', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Model', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts index 65f493d578..fca450c16f 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { OpenAIEmbeddings } from '@langchain/openai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -45,10 +45,10 @@ export class EmbeddingsAzureOpenAi implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Model (Deployment) Name', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts index ebab22ec55..c669349e5f 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { CohereEmbeddings } from '@langchain/cohere'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -48,10 +48,10 @@ export class EmbeddingsCohere implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Each model is using different dimensional density for embeddings. Please make sure to use the same dimensionality for your vector store. The default model is using 768-dimensional embeddings.', diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.ts index 949d6ee24e..9324f379e1 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { GoogleGenerativeAIEmbeddings } from '@langchain/google-genai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -48,10 +48,10 @@ export class EmbeddingsGoogleGemini implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Each model is using different dimensional density for embeddings. Please make sure to use the same dimensionality for your vector store. The default model is using 768-dimensional embeddings.', diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts index c8023354ef..710399aaea 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { HuggingFaceInferenceEmbeddings } from '@langchain/community/embeddings/hf'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,10 +44,10 @@ export class EmbeddingsHuggingFaceInference implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Each model is using different dimensional density for embeddings. Please make sure to use the same dimensionality for your vector store. The default model is using 768-dimensional embeddings.', diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.ts index 553abfa406..392e66fb32 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.ts @@ -2,7 +2,7 @@ import type { MistralAIEmbeddingsParams } from '@langchain/mistralai'; import { MistralAIEmbeddings } from '@langchain/mistralai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -46,14 +46,14 @@ export class EmbeddingsMistralCloud implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], requestDefaults: { ignoreHttpStatusErrors: true, baseURL: 'https://api.mistral.ai/v1', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { displayName: 'Model', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts index 08feb90309..9a4c4b2dad 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { OllamaEmbeddings } from '@langchain/ollama'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -41,9 +41,9 @@ export class EmbeddingsOllama implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], - properties: [getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), ollamaModel], + properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), ollamaModel], }; async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise { diff --git a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts index 58d90ff90b..8d9bb41bc0 100644 --- a/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { OpenAIEmbeddings } from '@langchain/openai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type SupplyData, @@ -101,7 +101,7 @@ export class EmbeddingsOpenAi implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiEmbedding], + outputs: [NodeConnectionTypes.AiEmbedding], outputNames: ['Embeddings'], requestDefaults: { ignoreHttpStatusErrors: true, @@ -109,7 +109,7 @@ export class EmbeddingsOpenAi implements INodeType { '={{ $parameter.options?.baseURL?.split("/").slice(0,-1).join("/") || $credentials.url?.split("/").slice(0,-1).join("/") || "https://api.openai.com" }}', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiVectorStore]), + getConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]), { ...modelParameter, default: 'text-embedding-ada-002', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts index 7bf2e28bba..46d6a3c2ee 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts @@ -3,7 +3,7 @@ import { ChatAnthropic } from '@langchain/anthropic'; import type { LLMResult } from '@langchain/core/outputs'; import { - NodeConnectionType, + NodeConnectionTypes, type INodePropertyOptions, type INodeProperties, type ISupplyDataFunctions, @@ -109,7 +109,7 @@ export class LmChatAnthropic implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -118,7 +118,7 @@ export class LmChatAnthropic implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiChain]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiChain]), { ...modelField, displayOptions: { diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts index d4685fa802..3bbe049a61 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOllama/LmChatOllama.node.ts @@ -3,7 +3,7 @@ import type { ChatOllamaInput } from '@langchain/ollama'; import { ChatOllama } from '@langchain/ollama'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -45,11 +45,11 @@ export class LmChatOllama implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], ...ollamaDescription, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), ollamaModel, ollamaOptions, ], diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts index 005ee33808..770a1c80b8 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts @@ -2,7 +2,7 @@ import { ChatOpenAI, type ClientOptions } from '@langchain/openai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -51,7 +51,7 @@ export class LmChatOpenAi implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -65,7 +65,7 @@ export class LmChatOpenAi implements INodeType { '={{ $parameter.options?.baseURL?.split("/").slice(0,-1).join("/") || $credentials?.url?.split("/").slice(0,-1).join("/") || "https://api.openai.com" }}', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'If using JSON response format, you must include word "json" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts index 6b9559104b..e3bdd302f5 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMCohere/LmCohere.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { Cohere } from '@langchain/cohere'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -42,7 +42,7 @@ export class LmCohere implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -51,7 +51,7 @@ export class LmCohere implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Options', name: 'options', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts index 21a7a0c50f..b27d9d5c0a 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMOllama/LmOllama.node.ts @@ -2,7 +2,7 @@ import { Ollama } from '@langchain/community/llms/ollama'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,11 +44,11 @@ export class LmOllama implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], ...ollamaDescription, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), ollamaModel, ollamaOptions, ], diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts index 1a64f07cca..8f442f6555 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenAi/LmOpenAi.node.ts @@ -1,6 +1,6 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { OpenAI, type ClientOptions } from '@langchain/openai'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { INodeType, INodeTypeDescription, @@ -53,7 +53,7 @@ export class LmOpenAi implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts index e393d86f8a..6e0b40c7f2 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { HuggingFaceInference } from '@langchain/community/llms/hf'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -42,7 +42,7 @@ export class LmOpenHuggingFaceInference implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -51,7 +51,7 @@ export class LmOpenHuggingFaceInference implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Model', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts index ef15a531cf..8db75531c8 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { ChatBedrockConverse } from '@langchain/aws'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -42,7 +42,7 @@ export class LmChatAwsBedrock implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -56,7 +56,7 @@ export class LmChatAwsBedrock implements INodeType { baseURL: '=https://bedrock.{{$credentials?.region ?? "eu-central-1"}}.amazonaws.com', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiChain]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiChain]), { displayName: 'Model', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts index 0618ceadc8..578e7a6f58 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { AzureChatOpenAI } from '@langchain/openai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -42,7 +42,7 @@ export class LmChatAzureOpenAi implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -51,7 +51,7 @@ export class LmChatAzureOpenAi implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'If using JSON response format, you must include word "json" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.ts index bf811ac2fe..33d6eb8554 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.ts @@ -2,7 +2,7 @@ import { ChatOpenAI, type ClientOptions } from '@langchain/openai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,7 +44,7 @@ export class LmChatDeepSeek implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -57,7 +57,7 @@ export class LmChatDeepSeek implements INodeType { baseURL: '={{ $credentials?.url }}', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'If using JSON response format, you must include word "json" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.ts index f6ff0f5038..df69662031 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { SafetySetting } from '@google/generative-ai'; import { ChatGoogleGenerativeAI } from '@langchain/google-genai'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { NodeError, INodeType, @@ -52,7 +52,7 @@ export class LmChatGoogleGemini implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -65,7 +65,7 @@ export class LmChatGoogleGemini implements INodeType { baseURL: '={{ $credentials.host }}', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Model', name: 'modelName', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.ts index ab3320c2ba..a68080fdac 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.ts @@ -4,7 +4,7 @@ import { ProjectsClient } from '@google-cloud/resource-manager'; import { ChatVertexAI } from '@langchain/google-vertexai'; import { formatPrivateKey } from 'n8n-nodes-base/dist/utils/utilities'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -50,7 +50,7 @@ export class LmChatGoogleVertex implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -59,7 +59,7 @@ export class LmChatGoogleVertex implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Project ID', name: 'projectId', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGroq/LmChatGroq.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGroq/LmChatGroq.node.ts index fb859e3fce..14c94d7bee 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatGroq/LmChatGroq.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatGroq/LmChatGroq.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { ChatGroq } from '@langchain/groq'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -42,7 +42,7 @@ export class LmChatGroq implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -54,7 +54,7 @@ export class LmChatGroq implements INodeType { baseURL: 'https://api.groq.com/openai/v1', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiChain]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiChain]), { displayName: 'Model', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.ts index a23c2d4e9f..d4ff63a8ee 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.ts @@ -3,7 +3,7 @@ import type { ChatMistralAIInput } from '@langchain/mistralai'; import { ChatMistralAI } from '@langchain/mistralai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,7 +44,7 @@ export class LmChatMistralCloud implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -57,7 +57,7 @@ export class LmChatMistralCloud implements INodeType { baseURL: 'https://api.mistral.ai/v1', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Model', name: 'model', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.ts b/packages/@n8n/nodes-langchain/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.ts index 57a14028e7..005ee84ab5 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.ts @@ -2,7 +2,7 @@ import { ChatOpenAI, type ClientOptions } from '@langchain/openai'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -43,7 +43,7 @@ export class LmChatOpenRouter implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiLanguageModel], + outputs: [NodeConnectionTypes.AiLanguageModel], outputNames: ['Model'], credentials: [ { @@ -56,7 +56,7 @@ export class LmChatOpenRouter implements INodeType { baseURL: '={{ $credentials?.url }}', }, properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'If using JSON response format, you must include word "json" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.', diff --git a/packages/@n8n/nodes-langchain/nodes/llms/N8nLlmTracing.ts b/packages/@n8n/nodes-langchain/nodes/llms/N8nLlmTracing.ts index 7f7d70841e..4ba3571f33 100644 --- a/packages/@n8n/nodes-langchain/nodes/llms/N8nLlmTracing.ts +++ b/packages/@n8n/nodes-langchain/nodes/llms/N8nLlmTracing.ts @@ -11,7 +11,7 @@ import type { LLMResult } from '@langchain/core/outputs'; import { encodingForModel } from '@langchain/core/utils/tiktoken'; import { pick } from 'lodash'; import type { IDataObject, ISupplyDataFunctions, JsonObject } from 'n8n-workflow'; -import { NodeConnectionType, NodeError, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeError, NodeOperationError } from 'n8n-workflow'; import { logAiEvent } from '@utils/helpers'; @@ -35,7 +35,7 @@ export class N8nLlmTracing extends BaseCallbackHandler { // This is crucial for the handleLLMError handler to work correctly (it should be called before the error is propagated to the root node) awaitHandlers = true; - connectionType = NodeConnectionType.AiLanguageModel; + connectionType = NodeConnectionTypes.AiLanguageModel; promptTokensEstimate = 0; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts index 91282ce144..e532032606 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts @@ -2,7 +2,7 @@ import type { BufferWindowMemoryInput } from 'langchain/memory'; import { BufferWindowMemory } from 'langchain/memory'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -101,10 +101,10 @@ export class MemoryBufferWindow implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiMemory], + outputs: [NodeConnectionTypes.AiMemory], outputNames: ['Memory'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Session Key', name: 'sessionKey', diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts index 82fcba22a6..62d1f30c13 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts @@ -2,7 +2,7 @@ import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; import type { BaseMessage } from '@langchain/core/messages'; import { - NodeConnectionType, + NodeConnectionTypes, type IDataObject, type IExecuteFunctions, type INodeExecutionData, @@ -61,16 +61,16 @@ export class MemoryChatRetriever implements INodeType { }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Memory', maxConnections: 1, - type: NodeConnectionType.AiMemory, + type: NodeConnectionTypes.AiMemory, required: true, }, ], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: "This node is deprecated. Use 'Chat Memory Manager' node instead.", @@ -91,7 +91,7 @@ export class MemoryChatRetriever implements INodeType { async execute(this: IExecuteFunctions): Promise { this.logger.debug('Executing Chat Memory Retriever'); - const memory = (await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + const memory = (await this.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BaseChatMemory | undefined; const simplifyOutput = this.getNodeParameter('simplifyOutput', 0) as boolean; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts index 964da65475..6bfbe19779 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryManager/MemoryManager.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; import { AIMessage, SystemMessage, HumanMessage, type BaseMessage } from '@langchain/core/messages'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { IDataObject, IExecuteFunctions, @@ -92,11 +92,11 @@ export class MemoryManager implements INodeType { inputs: [ { displayName: '', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, }, { displayName: 'Memory', - type: NodeConnectionType.AiMemory, + type: NodeConnectionTypes.AiMemory, required: true, maxConnections: 1, }, @@ -105,7 +105,7 @@ export class MemoryManager implements INodeType { outputs: [ { displayName: '', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, }, ], properties: [ @@ -297,7 +297,7 @@ export class MemoryManager implements INodeType { const items = this.getInputData(); const mode = this.getNodeParameter('mode', 0, 'load') as 'load' | 'insert' | 'delete'; const memory = (await this.getInputConnectionData( - NodeConnectionType.AiMemory, + NodeConnectionTypes.AiMemory, 0, )) as BaseChatMemory; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts index 06fa387ee6..08a617cfd5 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { MotorheadMemory } from '@langchain/community/memory/motorhead_memory'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -42,7 +42,7 @@ export class MemoryMotorhead implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiMemory], + outputs: [NodeConnectionTypes.AiMemory], outputNames: ['Memory'], credentials: [ { @@ -51,7 +51,7 @@ export class MemoryMotorhead implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Session ID', name: 'sessionId', diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.ts index 81be577f79..a62d06d7af 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.ts @@ -10,7 +10,7 @@ import type { INodeTypeDescription, SupplyData, } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type pg from 'pg'; import { getSessionId } from '@utils/helpers'; @@ -58,10 +58,10 @@ export class MemoryPostgresChat implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiMemory], + outputs: [NodeConnectionTypes.AiMemory], outputNames: ['Memory'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), sessionIdOption, expressionSessionKeyProperty(1.2), sessionKeyProperty, diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts index 3d9a8c8b01..9a094b8ab3 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts @@ -8,7 +8,7 @@ import { type INodeTypeDescription, type ISupplyDataFunctions, type SupplyData, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import type { RedisClientOptions } from 'redis'; import { createClient } from 'redis'; @@ -57,10 +57,10 @@ export class MemoryRedisChat implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiMemory], + outputs: [NodeConnectionTypes.AiMemory], outputNames: ['Memory'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Session Key', name: 'sessionKey', diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts index c1ad7b9539..e9bc97404e 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryXata/MemoryXata.node.ts @@ -2,7 +2,7 @@ import { XataChatMessageHistory } from '@langchain/community/stores/message/xata'; import { BaseClient } from '@xata.io/client'; import { BufferMemory, BufferWindowMemory } from 'langchain/memory'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { ISupplyDataFunctions, INodeType, @@ -50,7 +50,7 @@ export class MemoryXata implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiMemory], + outputs: [NodeConnectionTypes.AiMemory], outputNames: ['Memory'], credentials: [ { @@ -59,7 +59,7 @@ export class MemoryXata implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Session ID', name: 'sessionId', diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts index 1943f41c03..dea31c4f19 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryZep/MemoryZep.node.ts @@ -5,7 +5,7 @@ import { ZepCloudMemory } from '@langchain/community/memory/zep_cloud'; import type { InputValues, MemoryVariables } from '@langchain/core/memory'; import type { BaseMessage } from '@langchain/core/messages'; import { - NodeConnectionType, + NodeConnectionTypes, type ISupplyDataFunctions, type INodeType, type INodeTypeDescription, @@ -58,7 +58,7 @@ export class MemoryZep implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiMemory], + outputs: [NodeConnectionTypes.AiMemory], outputNames: ['Memory'], credentials: [ { @@ -67,7 +67,7 @@ export class MemoryZep implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Only works with Zep Cloud and Community edition <= v0.27.2', name: 'supportedVersions', diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts index f9e6cd2968..39d8d00e7e 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts @@ -1,6 +1,6 @@ import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import { PromptTemplate } from '@langchain/core/prompts'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { ISupplyDataFunctions, INodeType, @@ -47,18 +47,18 @@ export class OutputParserAutofixing implements INodeType { { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, { displayName: 'Output Parser', maxConnections: 1, required: true, - type: NodeConnectionType.AiOutputParser, + type: NodeConnectionTypes.AiOutputParser, }, ], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiOutputParser], + outputs: [NodeConnectionTypes.AiOutputParser], outputNames: ['Output Parser'], properties: [ { @@ -68,7 +68,7 @@ export class OutputParserAutofixing implements INodeType { type: 'notice', default: '', }, - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Options', name: 'options', @@ -95,11 +95,11 @@ export class OutputParserAutofixing implements INodeType { async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise { const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, itemIndex, )) as BaseLanguageModel; const outputParser = (await this.getInputConnectionData( - NodeConnectionType.AiOutputParser, + NodeConnectionTypes.AiOutputParser, itemIndex, )) as N8nStructuredOutputParser; const prompt = this.getNodeParameter('options.prompt', itemIndex, NAIVE_FIX_PROMPT) as string; diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/test/OutputParserAutofixing.node.test.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/test/OutputParserAutofixing.node.test.ts index 8c8e723c37..a5dfce4219 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/test/OutputParserAutofixing.node.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserAutofixing/test/OutputParserAutofixing.node.test.ts @@ -5,8 +5,12 @@ import { OutputParserException } from '@langchain/core/output_parsers'; import type { MockProxy } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended'; import { normalizeItems } from 'n8n-core'; -import type { ISupplyDataFunctions, IWorkflowDataProxyData } from 'n8n-workflow'; -import { ApplicationError, NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import type { + ISupplyDataFunctions, + IWorkflowDataProxyData, + NodeConnectionType, +} from 'n8n-workflow'; +import { ApplicationError, NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { N8nOutputFixingParser, @@ -34,8 +38,8 @@ describe('OutputParserAutofixing', () => { thisArg.addInputData.mockReturnValue({ index: 0 }); thisArg.addOutputData.mockReturnValue(); thisArg.getInputConnectionData.mockImplementation(async (type: NodeConnectionType) => { - if (type === NodeConnectionType.AiLanguageModel) return mockModel; - if (type === NodeConnectionType.AiOutputParser) return mockStructuredOutputParser; + if (type === NodeConnectionTypes.AiLanguageModel) return mockModel; + if (type === NodeConnectionTypes.AiOutputParser) return mockStructuredOutputParser; throw new ApplicationError('Unexpected connection type'); }); diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts index b94b82fada..774489bb88 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts @@ -1,6 +1,6 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -39,10 +39,10 @@ export class OutputParserItemList implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiOutputParser], + outputs: [NodeConnectionTypes.AiOutputParser], outputNames: ['Output Parser'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { displayName: 'Options', name: 'options', diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts index 0869020997..0367427a4e 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts @@ -6,7 +6,7 @@ import { type ISupplyDataFunctions, type SupplyData, NodeOperationError, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import type { z } from 'zod'; @@ -46,10 +46,10 @@ export class OutputParserStructured implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiOutputParser], + outputs: [NodeConnectionTypes.AiOutputParser], outputNames: ['Output Parser'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiChain, NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]), { ...schemaTypeField, displayOptions: { show: { '@version': [{ _cnd: { gte: 1.2 } }] } } }, { ...jsonSchemaExampleField, diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts index feb70ecb43..9ba7683a7d 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts @@ -5,7 +5,7 @@ import type { BaseRetriever } from '@langchain/core/retrievers'; import { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression'; import { LLMChainExtractor } from 'langchain/retrievers/document_compressors/chain_extract'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,13 +44,13 @@ export class RetrieverContextualCompression implements INodeType { { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, { displayName: 'Retriever', maxConnections: 1, - type: NodeConnectionType.AiRetriever, + type: NodeConnectionTypes.AiRetriever, required: true, }, ], @@ -58,7 +58,7 @@ export class RetrieverContextualCompression implements INodeType { { displayName: 'Retriever', maxConnections: 1, - type: NodeConnectionType.AiRetriever, + type: NodeConnectionTypes.AiRetriever, }, ], properties: [], @@ -68,12 +68,12 @@ export class RetrieverContextualCompression implements INodeType { this.logger.debug('Supplying data for Contextual Compression Retriever'); const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, itemIndex, )) as BaseLanguageModel; const baseRetriever = (await this.getInputConnectionData( - NodeConnectionType.AiRetriever, + NodeConnectionTypes.AiRetriever, itemIndex, )) as BaseRetriever; diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts index 4bbc45f6d1..73d7b2ac1e 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts @@ -4,7 +4,7 @@ import type { BaseLanguageModel } from '@langchain/core/language_models/base'; import type { BaseRetriever } from '@langchain/core/retrievers'; import { MultiQueryRetriever } from 'langchain/retrievers/multi_query'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -44,13 +44,13 @@ export class RetrieverMultiQuery implements INodeType { { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, { displayName: 'Retriever', maxConnections: 1, - type: NodeConnectionType.AiRetriever, + type: NodeConnectionTypes.AiRetriever, required: true, }, ], @@ -58,7 +58,7 @@ export class RetrieverMultiQuery implements INodeType { { displayName: 'Retriever', maxConnections: 1, - type: NodeConnectionType.AiRetriever, + type: NodeConnectionTypes.AiRetriever, }, ], properties: [ @@ -89,12 +89,12 @@ export class RetrieverMultiQuery implements INodeType { const options = this.getNodeParameter('options', itemIndex, {}) as { queryCount?: number }; const model = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, itemIndex, )) as BaseLanguageModel; const baseRetriever = (await this.getInputConnectionData( - NodeConnectionType.AiRetriever, + NodeConnectionTypes.AiRetriever, itemIndex, )) as BaseRetriever; diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts index 915d9766dc..7323eacb2d 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { VectorStore } from '@langchain/core/vectorstores'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -40,12 +40,12 @@ export class RetrieverVectorStore implements INodeType { { displayName: 'Vector Store', maxConnections: 1, - type: NodeConnectionType.AiVectorStore, + type: NodeConnectionTypes.AiVectorStore, required: true, }, ], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiRetriever], + outputs: [NodeConnectionTypes.AiRetriever], outputNames: ['Retriever'], properties: [ { @@ -63,7 +63,7 @@ export class RetrieverVectorStore implements INodeType { const topK = this.getNodeParameter('topK', itemIndex, 4) as number; const vectorStore = (await this.getInputConnectionData( - NodeConnectionType.AiVectorStore, + NodeConnectionTypes.AiVectorStore, itemIndex, )) as VectorStore; diff --git a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts index 1291b92252..b7026430da 100644 --- a/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts @@ -4,7 +4,7 @@ import { Document } from '@langchain/core/documents'; import { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers'; import type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces'; import * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { IDataObject, IExecuteWorkflowInfo, @@ -66,7 +66,7 @@ export class RetrieverWorkflow implements INodeType { { displayName: 'Retriever', maxConnections: 1, - type: NodeConnectionType.AiRetriever, + type: NodeConnectionTypes.AiRetriever, }, ], properties: [ diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts index 962af5bde2..87d0fae475 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts @@ -2,7 +2,7 @@ import type { CharacterTextSplitterParams } from '@langchain/textsplitters'; import { CharacterTextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -40,10 +40,10 @@ export class TextSplitterCharacterTextSplitter implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTextSplitter], + outputs: [NodeConnectionTypes.AiTextSplitter], outputNames: ['Text Splitter'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiDocument]), + getConnectionHintNoticeField([NodeConnectionTypes.AiDocument]), { displayName: 'Separator', name: 'separator', diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts index 4e376c39a3..e2a99402eb 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts @@ -5,7 +5,7 @@ import type { } from '@langchain/textsplitters'; import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -60,10 +60,10 @@ export class TextSplitterRecursiveCharacterTextSplitter implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTextSplitter], + outputs: [NodeConnectionTypes.AiTextSplitter], outputNames: ['Text Splitter'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiDocument]), + getConnectionHintNoticeField([NodeConnectionTypes.AiDocument]), { displayName: 'Chunk Size', name: 'chunkSize', diff --git a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts index b5dade396d..c8dfc7b3ec 100644 --- a/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { TokenTextSplitter } from '@langchain/textsplitters'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -39,10 +39,10 @@ export class TextSplitterTokenSplitter implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTextSplitter], + outputs: [NodeConnectionTypes.AiTextSplitter], outputNames: ['Text Splitter'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiDocument]), + getConnectionHintNoticeField([NodeConnectionTypes.AiDocument]), { displayName: 'Chunk Size', name: 'chunkSize', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts index 6d67a04555..f60912112e 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolCalculator/ToolCalculator.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { Calculator } from '@langchain/community/tools/calculator'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -40,9 +40,9 @@ export class ToolCalculator implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], - properties: [getConnectionHintNoticeField([NodeConnectionType.AiAgent])], + properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])], }; async supplyData(this: ISupplyDataFunctions): Promise { diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts index cf412ea5d3..02dec8cc71 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolCode/ToolCode.node.ts @@ -13,7 +13,7 @@ import type { ExecutionError, IDataObject, } from 'n8n-workflow'; -import { jsonParse, NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { jsonParse, NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { buildInputSchemaField, @@ -54,10 +54,10 @@ export class ToolCode implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'See an example of a conversational agent with custom tool written in JavaScript here.', @@ -221,7 +221,7 @@ export class ToolCode implements INodeType { }; const toolHandler = async (query: string | IDataObject): Promise => { - const { index } = this.addInputData(NodeConnectionType.AiTool, [[{ json: { query } }]]); + const { index } = this.addInputData(NodeConnectionTypes.AiTool, [[{ json: { query } }]]); let response: string = ''; let executionError: ExecutionError | undefined; @@ -245,9 +245,9 @@ export class ToolCode implements INodeType { } if (executionError) { - void this.addOutputData(NodeConnectionType.AiTool, index, executionError); + void this.addOutputData(NodeConnectionTypes.AiTool, index, executionError); } else { - void this.addOutputData(NodeConnectionType.AiTool, index, [[{ json: { response } }]]); + void this.addOutputData(NodeConnectionTypes.AiTool, index, [[{ json: { response } }]]); } return response; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts index bfdd3e7ace..1756abf549 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts @@ -8,7 +8,11 @@ import type { IHttpRequestMethods, IHttpRequestOptions, } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError, tryToParseAlphanumericString } from 'n8n-workflow'; +import { + NodeConnectionTypes, + NodeOperationError, + tryToParseAlphanumericString, +} from 'n8n-workflow'; import { N8nTool } from '@utils/N8nTool'; import { getConnectionHintNoticeField } from '@utils/sharedFields'; @@ -62,10 +66,10 @@ export class ToolHttpRequest implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Description', name: 'toolDescription', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts index 0bd1b1a8a6..7602322de3 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts @@ -14,7 +14,7 @@ import type { NodeApiError, ISupplyDataFunctions, } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError, jsonParse } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError, jsonParse } from 'n8n-workflow'; import { z } from 'zod'; import type { @@ -585,7 +585,7 @@ export const configureToolFunction = ( optimizeResponse: (response: string) => string, ) => { return async (query: string | IDataObject): Promise => { - const { index } = ctx.addInputData(NodeConnectionType.AiTool, [[{ json: { query } }]]); + const { index } = ctx.addInputData(NodeConnectionTypes.AiTool, [[{ json: { query } }]]); // Clone options and rawRequestOptions to avoid mutating the original objects const options: IHttpRequestOptions | null = structuredClone(requestOptions); @@ -792,9 +792,9 @@ export const configureToolFunction = ( } if (executionError) { - void ctx.addOutputData(NodeConnectionType.AiTool, index, executionError as ExecutionError); + void ctx.addOutputData(NodeConnectionTypes.AiTool, index, executionError as ExecutionError); } else { - void ctx.addOutputData(NodeConnectionType.AiTool, index, [[{ json: { response } }]]); + void ctx.addOutputData(NodeConnectionTypes.AiTool, index, [[{ json: { response } }]]); } return response; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts index 7a7a09b933..514d84aeaa 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolSerpApi/ToolSerpApi.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { SerpAPI } from '@langchain/community/tools/serpapi'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -39,7 +39,7 @@ export class ToolSerpApi implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], credentials: [ { @@ -48,7 +48,7 @@ export class ToolSerpApi implements INodeType { }, ], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Options', name: 'options', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts index 97113643f3..7a9e4a7f1a 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolVectorStore/ToolVectorStore.node.ts @@ -8,7 +8,7 @@ import type { ISupplyDataFunctions, SupplyData, } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { logWrapper } from '@utils/logWrapper'; import { getConnectionHintNoticeField } from '@utils/sharedFields'; @@ -44,21 +44,21 @@ export class ToolVectorStore implements INodeType { { displayName: 'Vector Store', maxConnections: 1, - type: NodeConnectionType.AiVectorStore, + type: NodeConnectionTypes.AiVectorStore, required: true, }, { displayName: 'Model', maxConnections: 1, - type: NodeConnectionType.AiLanguageModel, + type: NodeConnectionTypes.AiLanguageModel, required: true, }, ], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'Data Name', name: 'name', @@ -97,12 +97,12 @@ export class ToolVectorStore implements INodeType { const topK = this.getNodeParameter('topK', itemIndex, 4) as number; const vectorStore = (await this.getInputConnectionData( - NodeConnectionType.AiVectorStore, + NodeConnectionTypes.AiVectorStore, itemIndex, )) as VectorStore; const llm = (await this.getInputConnectionData( - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.AiLanguageModel, 0, )) as BaseLanguageModel; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts index 4eef3a1b45..abf2e82dca 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWikipedia/ToolWikipedia.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { WikipediaQueryRun } from '@langchain/community/tools/wikipedia_query_run'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -39,9 +39,9 @@ export class ToolWikipedia implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], - properties: [getConnectionHintNoticeField([NodeConnectionType.AiAgent])], + properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])], }; async supplyData(this: ISupplyDataFunctions): Promise { diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts index 162b78ba8e..572a678627 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -45,9 +45,9 @@ export class ToolWolframAlpha implements INodeType { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], - properties: [getConnectionHintNoticeField([NodeConnectionType.AiAgent])], + properties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])], }; async supplyData(this: ISupplyDataFunctions): Promise { diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.ts index 4c33c86b4e..993f48e195 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.ts @@ -20,7 +20,7 @@ import type { ITaskMetadata, INodeTypeBaseDescription, } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError, jsonParse } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError, jsonParse } from 'n8n-workflow'; import { versionDescription } from './versionDescription'; import type { DynamicZodObject } from '../../../../types/zod.types'; @@ -148,7 +148,7 @@ export class ToolWorkflowV1 implements INodeType { query: string | IDataObject, runManager?: CallbackManagerForToolRun, ): Promise => { - const { index } = this.addInputData(NodeConnectionType.AiTool, [[{ json: { query } }]]); + const { index } = this.addInputData(NodeConnectionTypes.AiTool, [[{ json: { query } }]]); let response: string = ''; let executionError: ExecutionError | undefined; @@ -189,12 +189,12 @@ export class ToolWorkflowV1 implements INodeType { } if (executionError) { - void this.addOutputData(NodeConnectionType.AiTool, index, executionError, metadata); + void this.addOutputData(NodeConnectionTypes.AiTool, index, executionError, metadata); } else { // Output always needs to be an object // so we try to parse the response as JSON and if it fails we just return the string wrapped in an object const json = jsonParse(response, { fallbackValue: { response } }); - void this.addOutputData(NodeConnectionType.AiTool, index, [[{ json }]], metadata); + void this.addOutputData(NodeConnectionTypes.AiTool, index, [[{ json }]], metadata); } return response; }; diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/versionDescription.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/versionDescription.ts index f46ef05c0d..87c4c02748 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/versionDescription.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v1/versionDescription.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-filename-against-convention */ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { INodeTypeDescription } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { inputSchemaField, @@ -36,10 +36,10 @@ export const versionDescription: INodeTypeDescription = { // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [], // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'See an example of a workflow to suggest meeting slots using AI here.', diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.ts index 57a6d1fc84..2c7d34374b 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.ts @@ -21,7 +21,7 @@ import type { import { generateZodSchema, jsonParse, - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, parseErrorMetadata, traverseNodeParameters, @@ -113,7 +113,7 @@ export class WorkflowToolService { } void context.addOutputData( - NodeConnectionType.AiTool, + NodeConnectionTypes.AiTool, localRunIndex, [responseData], metadata, @@ -126,7 +126,7 @@ export class WorkflowToolService { const metadata = parseErrorMetadata(error); void context.addOutputData( - NodeConnectionType.AiTool, + NodeConnectionTypes.AiTool, localRunIndex, executionError, metadata, diff --git a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/versionDescription.ts b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/versionDescription.ts index cd56a0f5d7..2004a9337f 100644 --- a/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/versionDescription.ts +++ b/packages/@n8n/nodes-langchain/nodes/tools/ToolWorkflow/v2/versionDescription.ts @@ -1,6 +1,6 @@ /* eslint-disable n8n-nodes-base/node-filename-against-convention */ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ -import { NodeConnectionType, type INodeTypeDescription } from 'n8n-workflow'; +import { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow'; import { getConnectionHintNoticeField } from '../../../../utils/sharedFields'; @@ -14,10 +14,10 @@ export const versionDescription: INodeTypeDescription = { }, version: [2, 2.1], inputs: [], - outputs: [NodeConnectionType.AiTool], + outputs: [NodeConnectionTypes.AiTool], outputNames: ['Tool'], properties: [ - getConnectionHintNoticeField([NodeConnectionType.AiAgent]), + getConnectionHintNoticeField([NodeConnectionTypes.AiAgent]), { displayName: 'See an example of a workflow to suggest meeting slots using AI here.', diff --git a/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts b/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts index fab05be8ec..3401bc0b18 100644 --- a/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts @@ -1,6 +1,6 @@ import type { BaseChatMemory } from '@langchain/community/memory/chat_memory'; import { pick } from 'lodash'; -import { Node, NodeConnectionType } from 'n8n-workflow'; +import { Node, NodeConnectionTypes } from 'n8n-workflow'; import type { IDataObject, IWebhookFunctions, @@ -70,12 +70,12 @@ export class ChatTrigger extends Node { { displayName: 'Memory', maxConnections: 1, - type: '${NodeConnectionType.AiMemory}', + type: '${NodeConnectionTypes.AiMemory}', required: true, } ]; })() }}`, - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [ { // eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed @@ -554,7 +554,7 @@ ${cssVariables} if (bodyData.action === 'loadPreviousSession') { if (options?.loadPreviousSession === 'memory') { - const memory = (await ctx.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + const memory = (await ctx.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BaseChatMemory | undefined; const messages = ((await memory?.chatHistory.getMessages()) ?? []) diff --git a/packages/@n8n/nodes-langchain/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.ts b/packages/@n8n/nodes-langchain/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.ts index 816b56b59a..f746a32f02 100644 --- a/packages/@n8n/nodes-langchain/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.ts @@ -3,7 +3,7 @@ import { type INodeType, type INodeTypeDescription, type ITriggerResponse, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; export class ManualChatTrigger implements INodeType { @@ -35,7 +35,7 @@ export class ManualChatTrigger implements INodeType { }, }, inputs: [], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts index c0fcca1ab7..757b535fa2 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts @@ -2,7 +2,7 @@ import type { Embeddings } from '@langchain/core/embeddings'; import type { Document } from 'langchain/document'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeExecutionData, type IExecuteFunctions, type INodeType, @@ -42,21 +42,21 @@ export class VectorStoreInMemoryInsert implements INodeType { }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Document', maxConnections: 1, - type: NodeConnectionType.AiDocument, + type: NodeConnectionTypes.AiDocument, required: true, }, { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: @@ -86,13 +86,13 @@ export class VectorStoreInMemoryInsert implements INodeType { async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(0); const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; const memoryKey = this.getNodeParameter('memoryKey', 0) as string; const clearStore = this.getNodeParameter('clearStore', 0) as boolean; - const documentInput = (await this.getInputConnectionData(NodeConnectionType.AiDocument, 0)) as + const documentInput = (await this.getInputConnectionData(NodeConnectionTypes.AiDocument, 0)) as | N8nJsonLoader | Array>>; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts index 53c5608aac..4d17581136 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts @@ -1,7 +1,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { Embeddings } from '@langchain/core/embeddings'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -43,11 +43,11 @@ export class VectorStoreInMemoryLoad implements INodeType { { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.AiVectorStore], + outputs: [NodeConnectionTypes.AiVectorStore], outputNames: ['Vector Store'], properties: [ { @@ -63,7 +63,7 @@ export class VectorStoreInMemoryLoad implements INodeType { async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise { const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, itemIndex, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts index 7bf9b4d94d..025d9868a8 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts @@ -7,7 +7,7 @@ import { type INodeType, type INodeTypeDescription, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import type { N8nJsonLoader } from '@utils/N8nJsonLoader'; @@ -51,21 +51,21 @@ export class VectorStorePineconeInsert implements INodeType { }, ], inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Document', maxConnections: 1, - type: NodeConnectionType.AiDocument, + type: NodeConnectionTypes.AiDocument, required: true, }, { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ pineconeIndexRLC, { @@ -106,12 +106,12 @@ export class VectorStorePineconeInsert implements INodeType { const credentials = await this.getCredentials('pineconeApi'); - const documentInput = (await this.getInputConnectionData(NodeConnectionType.AiDocument, 0)) as + const documentInput = (await this.getInputConnectionData(NodeConnectionTypes.AiDocument, 0)) as | N8nJsonLoader | Array>>; const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts index 8e0300380a..a87a06c7cb 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts @@ -3,7 +3,7 @@ import type { PineconeStoreParams } from '@langchain/pinecone'; import { PineconeStore } from '@langchain/pinecone'; import { Pinecone } from '@pinecone-database/pinecone'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -54,11 +54,11 @@ export class VectorStorePineconeLoad implements INodeType { { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.AiVectorStore], + outputs: [NodeConnectionTypes.AiVectorStore], outputNames: ['Vector Store'], properties: [ pineconeIndexRLC, @@ -95,7 +95,7 @@ export class VectorStorePineconeLoad implements INodeType { const credentials = await this.getCredentials('pineconeApi'); const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, itemIndex, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts index 18906270fc..cd1a579e32 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts @@ -7,7 +7,7 @@ import { type INodeType, type INodeTypeDescription, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import type { N8nJsonLoader } from '@utils/N8nJsonLoader'; @@ -51,21 +51,21 @@ export class VectorStoreSupabaseInsert implements INodeType { }, ], inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Document', maxConnections: 1, - type: NodeConnectionType.AiDocument, + type: NodeConnectionTypes.AiDocument, required: true, }, { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: @@ -102,12 +102,12 @@ export class VectorStoreSupabaseInsert implements INodeType { const queryName = this.getNodeParameter('queryName', 0) as string; const credentials = await this.getCredentials('supabaseApi'); - const documentInput = (await this.getInputConnectionData(NodeConnectionType.AiDocument, 0)) as + const documentInput = (await this.getInputConnectionData(NodeConnectionTypes.AiDocument, 0)) as | N8nJsonLoader | Array>>; const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; const client = createClient(credentials.host as string, credentials.serviceRole as string); diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts index 3f84f03782..b8fd7d78b3 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts @@ -7,7 +7,7 @@ import { type INodeTypeDescription, type ISupplyDataFunctions, type SupplyData, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import { getMetadataFiltersValues } from '@utils/helpers'; @@ -54,11 +54,11 @@ export class VectorStoreSupabaseLoad implements INodeType { { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.AiVectorStore], + outputs: [NodeConnectionTypes.AiVectorStore], outputNames: ['Vector Store'], properties: [ supabaseTableNameRLC, @@ -93,7 +93,7 @@ export class VectorStoreSupabaseLoad implements INodeType { const credentials = await this.getCredentials('supabaseApi'); const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts index 4892d8ad85..652025bd15 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts @@ -6,7 +6,7 @@ import { type INodeType, type INodeTypeDescription, type INodeExecutionData, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import type { N8nJsonLoader } from '@utils/N8nJsonLoader'; @@ -47,21 +47,21 @@ export class VectorStoreZepInsert implements INodeType { }, ], inputs: [ - NodeConnectionType.Main, + NodeConnectionTypes.Main, { displayName: 'Document', maxConnections: 1, - type: NodeConnectionType.AiDocument, + type: NodeConnectionTypes.AiDocument, required: true, }, { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: 'Collection Name', @@ -117,12 +117,12 @@ export class VectorStoreZepInsert implements INodeType { apiUrl: string; }>('zepApi'); - const documentInput = (await this.getInputConnectionData(NodeConnectionType.AiDocument, 0)) as + const documentInput = (await this.getInputConnectionData(NodeConnectionTypes.AiDocument, 0)) as | N8nJsonLoader | Array>>; const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts index 040b845e57..81542ebc2b 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts @@ -2,7 +2,7 @@ import type { IZepConfig } from '@langchain/community/vectorstores/zep'; import { ZepVectorStore } from '@langchain/community/vectorstores/zep'; import type { Embeddings } from '@langchain/core/embeddings'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type ISupplyDataFunctions, @@ -50,11 +50,11 @@ export class VectorStoreZepLoad implements INodeType { { displayName: 'Embedding', maxConnections: 1, - type: NodeConnectionType.AiEmbedding, + type: NodeConnectionTypes.AiEmbedding, required: true, }, ], - outputs: [NodeConnectionType.AiVectorStore], + outputs: [NodeConnectionTypes.AiVectorStore], outputNames: ['Vector Store'], properties: [ { @@ -99,7 +99,7 @@ export class VectorStoreZepLoad implements INodeType { apiUrl: string; }>('zepApi'); const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.ts index 1ddf704f1d..424d1e1490 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.ts @@ -1,6 +1,6 @@ import type { VectorStore } from '@langchain/core/vectorstores'; import type { INodeProperties } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { DEFAULT_OPERATION_MODES } from '../constants'; import type { VectorStoreNodeConstructorArgs, NodeOperationMode } from '../types'; @@ -178,8 +178,8 @@ describe('Vector Store Utilities', () => { const retrieveOption = result.find((option) => option.value === 'retrieve'); const retrieveAsToolOption = result.find((option) => option.value === 'retrieve-as-tool'); - expect(retrieveOption?.outputConnectionType).toBe(NodeConnectionType.AiVectorStore); - expect(retrieveAsToolOption?.outputConnectionType).toBe(NodeConnectionType.AiTool); + expect(retrieveOption?.outputConnectionType).toBe(NodeConnectionTypes.AiVectorStore); + expect(retrieveAsToolOption?.outputConnectionType).toBe(NodeConnectionTypes.AiTool); }); }); }); diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/constants.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/constants.ts index 172c8d5d54..30aceb2bc0 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/constants.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/constants.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { INodePropertyOptions } from 'n8n-workflow'; import type { NodeOperationMode } from './types'; @@ -28,14 +28,14 @@ export const OPERATION_MODE_DESCRIPTIONS: INodePropertyOptions[] = [ 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: NodeConnectionType.AiVectorStore, + outputConnectionType: NodeConnectionTypes.AiVectorStore, }, { 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: NodeConnectionType.AiTool, + outputConnectionType: NodeConnectionTypes.AiTool, }, { name: 'Update Documents', diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts index 9afd6e6694..31d0f8eb7a 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts @@ -2,7 +2,7 @@ /* eslint-disable n8n-nodes-base/node-dirname-against-convention */ import type { Embeddings } from '@langchain/core/embeddings'; import type { VectorStore } from '@langchain/core/vectorstores'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import type { IExecuteFunctions, INodeExecutionData, @@ -66,18 +66,18 @@ export const createVectorStoreNode = ( inputs: `={{ ((parameters) => { const mode = parameters?.mode; - const inputs = [{ displayName: "Embedding", type: "${NodeConnectionType.AiEmbedding}", required: true, maxConnections: 1}] + const inputs = [{ displayName: "Embedding", type: "${NodeConnectionTypes.AiEmbedding}", required: true, maxConnections: 1}] if (mode === 'retrieve-as-tool') { return inputs; } if (['insert', 'load', 'update'].includes(mode)) { - inputs.push({ displayName: "", type: "${NodeConnectionType.Main}"}) + inputs.push({ displayName: "", type: "${NodeConnectionTypes.Main}"}) } if (['insert'].includes(mode)) { - inputs.push({ displayName: "Document", type: "${NodeConnectionType.AiDocument}", required: true, maxConnections: 1}) + inputs.push({ displayName: "Document", type: "${NodeConnectionTypes.AiDocument}", required: true, maxConnections: 1}) } return inputs })($parameter) @@ -87,13 +87,13 @@ export const createVectorStoreNode = ( const mode = parameters?.mode ?? 'retrieve'; if (mode === 'retrieve-as-tool') { - return [{ displayName: "Tool", type: "${NodeConnectionType.AiTool}"}] + return [{ displayName: "Tool", type: "${NodeConnectionTypes.AiTool}"}] } if (mode === 'retrieve') { - return [{ displayName: "Vector Store", type: "${NodeConnectionType.AiVectorStore}"}] + return [{ displayName: "Vector Store", type: "${NodeConnectionTypes.AiVectorStore}"}] } - return [{ displayName: "", type: "${NodeConnectionType.Main}"}] + return [{ displayName: "", type: "${NodeConnectionTypes.Main}"}] })($parameter) }}`, properties: [ @@ -106,7 +106,7 @@ export const createVectorStoreNode = ( options: getOperationModeOptions(args), }, { - ...getConnectionHintNoticeField([NodeConnectionType.AiRetriever]), + ...getConnectionHintNoticeField([NodeConnectionTypes.AiRetriever]), displayOptions: { show: { mode: ['retrieve'], @@ -232,7 +232,7 @@ export const createVectorStoreNode = ( // Get the embeddings model connected to this node const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; @@ -274,7 +274,7 @@ export const createVectorStoreNode = ( // Get the embeddings model connected to this node const embeddings = (await this.getInputConnectionData( - NodeConnectionType.AiEmbedding, + NodeConnectionTypes.AiEmbedding, 0, )) as Embeddings; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.ts index c4fa745b7e..a37d73f46a 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.ts @@ -6,7 +6,7 @@ import type { VectorStore } from '@langchain/core/vectorstores'; import type { MockProxy } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended'; import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { logAiEvent } from '@utils/helpers'; import type { N8nBinaryLoader } from '@utils/N8nBinaryLoader'; @@ -137,7 +137,7 @@ describe('handleInsertOperation', () => { // Should get document input from connection expect(mockContext.getInputConnectionData).toHaveBeenCalledWith( - NodeConnectionType.AiDocument, + NodeConnectionTypes.AiDocument, 0, ); diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts index a80db041a3..5cb44ef8a5 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts @@ -2,7 +2,7 @@ import type { Document } from '@langchain/core/documents'; import type { Embeddings } from '@langchain/core/embeddings'; import type { VectorStore } from '@langchain/core/vectorstores'; import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { logAiEvent } from '@utils/helpers'; import type { N8nBinaryLoader } from '@utils/N8nBinaryLoader'; @@ -23,7 +23,7 @@ export async function handleInsertOperation const nodeVersion = context.getNode().typeVersion; // Get the input items and document data const items = context.getInputData(); - const documentInput = (await context.getInputConnectionData(NodeConnectionType.AiDocument, 0)) as + const documentInput = (await context.getInputConnectionData(NodeConnectionTypes.AiDocument, 0)) as | N8nJsonLoader | N8nBinaryLoader | Array>>; diff --git a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/message.operation.ts b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/message.operation.ts index e88c7e1013..6ba3a93fd6 100644 --- a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/message.operation.ts +++ b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/assistant/message.operation.ts @@ -12,7 +12,7 @@ import type { } from 'n8n-workflow'; import { ApplicationError, - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, updateDisplayOptions, } from 'n8n-workflow'; @@ -235,7 +235,7 @@ export async function execute(this: IExecuteFunctions, i: number): Promise= 1.6 && this.getNodeParameter('memory', i) === 'connector'; const memory = useMemoryConnector || nodeVersion < 1.6 - ? ((await this.getInputConnectionData(NodeConnectionType.AiMemory, 0)) as + ? ((await this.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as | BufferWindowMemory | undefined) : undefined; diff --git a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/versionDescription.ts b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/versionDescription.ts index 1ebd986f12..64d2c10597 100644 --- a/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/versionDescription.ts +++ b/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/actions/versionDescription.ts @@ -1,6 +1,6 @@ /* eslint-disable n8n-nodes-base/node-filename-against-convention */ import type { INodeInputConfiguration, INodeTypeDescription } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import * as assistant from './assistant'; import * as audio from './audio'; @@ -50,25 +50,25 @@ const configureNodeInputs = ( ) => { if (resource === 'assistant' && operation === 'message') { const inputs: INodeInputConfiguration[] = [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiTool, displayName: 'Tools' }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiTool, displayName: 'Tools' }, ]; if (memory !== 'threadId') { - inputs.push({ type: NodeConnectionType.AiMemory, displayName: 'Memory', maxConnections: 1 }); + inputs.push({ type: NodeConnectionTypes.AiMemory, displayName: 'Memory', maxConnections: 1 }); } return inputs; } if (resource === 'text' && operation === 'message') { if (hideTools === 'hide') { - return [NodeConnectionType.Main]; + return [NodeConnectionTypes.Main]; } return [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiTool, displayName: 'Tools' }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiTool, displayName: 'Tools' }, ]; } - return [NodeConnectionType.Main]; + return [NodeConnectionTypes.Main]; }; // eslint-disable-next-line n8n-nodes-base/node-class-description-missing-subtitle @@ -98,7 +98,7 @@ export const versionDescription: INodeTypeDescription = { }, }, inputs: `={{(${configureNodeInputs})($parameter.resource, $parameter.operation, $parameter.hideTools, $parameter.memory ?? undefined)}}`, - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [ { name: 'openAiApi', diff --git a/packages/@n8n/nodes-langchain/utils/N8nTool.ts b/packages/@n8n/nodes-langchain/utils/N8nTool.ts index f568955beb..b7f885f6e7 100644 --- a/packages/@n8n/nodes-langchain/utils/N8nTool.ts +++ b/packages/@n8n/nodes-langchain/utils/N8nTool.ts @@ -2,7 +2,7 @@ import type { DynamicStructuredToolInput } from '@langchain/core/tools'; import { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools'; import { StructuredOutputParser } from 'langchain/output_parsers'; import type { ISupplyDataFunctions, IDataObject } from 'n8n-workflow'; -import { NodeConnectionType, jsonParse, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, jsonParse, NodeOperationError } from 'n8n-workflow'; import type { ZodTypeAny } from 'zod'; import { ZodBoolean, ZodNullable, ZodNumber, ZodObject, ZodOptional } from 'zod'; @@ -96,8 +96,8 @@ export class N8nTool extends DynamicStructuredTool { return result; } catch (e) { - const { index } = context.addInputData(NodeConnectionType.AiTool, [[{ json: { query } }]]); - void context.addOutputData(NodeConnectionType.AiTool, index, e); + const { index } = context.addInputData(NodeConnectionTypes.AiTool, [[{ json: { query } }]]); + void context.addOutputData(NodeConnectionTypes.AiTool, index, e); return e.toString(); } diff --git a/packages/@n8n/nodes-langchain/utils/helpers.ts b/packages/@n8n/nodes-langchain/utils/helpers.ts index ba9551ed6a..99bb541503 100644 --- a/packages/@n8n/nodes-langchain/utils/helpers.ts +++ b/packages/@n8n/nodes-langchain/utils/helpers.ts @@ -4,7 +4,7 @@ import type { BaseLLM } from '@langchain/core/language_models/llms'; import type { BaseMessage } from '@langchain/core/messages'; import type { Tool } from '@langchain/core/tools'; import type { BaseChatMemory } from 'langchain/memory'; -import { NodeConnectionType, NodeOperationError, jsonStringify } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError, jsonStringify } from 'n8n-workflow'; import type { AiEvent, IDataObject, @@ -190,7 +190,7 @@ export const getConnectedTools = async ( escapeCurlyBrackets: boolean = false, ) => { const connectedTools = - ((await ctx.getInputConnectionData(NodeConnectionType.AiTool, 0)) as Tool[]) || []; + ((await ctx.getInputConnectionData(NodeConnectionTypes.AiTool, 0)) as Tool[]) || []; if (!enforceUniqueNames) return connectedTools; diff --git a/packages/@n8n/nodes-langchain/utils/logWrapper.ts b/packages/@n8n/nodes-langchain/utils/logWrapper.ts index 699bf39395..a58217f005 100644 --- a/packages/@n8n/nodes-langchain/utils/logWrapper.ts +++ b/packages/@n8n/nodes-langchain/utils/logWrapper.ts @@ -15,8 +15,9 @@ import type { INodeExecutionData, ISupplyDataFunctions, ITaskMetadata, + NodeConnectionType, } from 'n8n-workflow'; -import { NodeOperationError, NodeConnectionType, parseErrorMetadata } from 'n8n-workflow'; +import { NodeOperationError, NodeConnectionTypes, parseErrorMetadata } from 'n8n-workflow'; import { logAiEvent, isToolsInstance, isBaseChatMemory, isBaseChatMessageHistory } from './helpers'; import { N8nBinaryLoader } from './N8nBinaryLoader'; @@ -116,7 +117,7 @@ export function logWrapper( if (isBaseChatMemory(originalInstance)) { if (prop === 'loadMemoryVariables' && 'loadMemoryVariables' in target) { return async (values: InputValues): Promise => { - connectionType = NodeConnectionType.AiMemory; + connectionType = NodeConnectionTypes.AiMemory; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { action: 'loadMemoryVariables', values } }], @@ -139,7 +140,7 @@ export function logWrapper( }; } else if (prop === 'saveContext' && 'saveContext' in target) { return async (input: InputValues, output: OutputValues): Promise => { - connectionType = NodeConnectionType.AiMemory; + connectionType = NodeConnectionTypes.AiMemory; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { action: 'saveContext', input, output } }], @@ -168,7 +169,7 @@ export function logWrapper( if (isBaseChatMessageHistory(originalInstance)) { if (prop === 'getMessages' && 'getMessages' in target) { return async (): Promise => { - connectionType = NodeConnectionType.AiMemory; + connectionType = NodeConnectionTypes.AiMemory; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { action: 'getMessages' } }], ]); @@ -189,7 +190,7 @@ export function logWrapper( }; } else if (prop === 'addMessage' && 'addMessage' in target) { return async (message: BaseMessage): Promise => { - connectionType = NodeConnectionType.AiMemory; + connectionType = NodeConnectionTypes.AiMemory; const payload = { action: 'addMessage', message }; const { index } = executeFunctions.addInputData(connectionType, [[{ json: payload }]]); @@ -214,7 +215,7 @@ export function logWrapper( query: string, config?: Callbacks | BaseCallbackConfig, ): Promise => { - connectionType = NodeConnectionType.AiRetriever; + connectionType = NodeConnectionTypes.AiRetriever; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { query, config } }], ]); @@ -255,7 +256,7 @@ export function logWrapper( // Docs -> Embeddings if (prop === 'embedDocuments' && 'embedDocuments' in target) { return async (documents: string[]): Promise => { - connectionType = NodeConnectionType.AiEmbedding; + connectionType = NodeConnectionTypes.AiEmbedding; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { documents } }], ]); @@ -276,7 +277,7 @@ export function logWrapper( // Query -> Embeddings if (prop === 'embedQuery' && 'embedQuery' in target) { return async (query: string): Promise => { - connectionType = NodeConnectionType.AiEmbedding; + connectionType = NodeConnectionTypes.AiEmbedding; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { query } }], ]); @@ -303,7 +304,7 @@ export function logWrapper( // Process All if (prop === 'processAll' && 'processAll' in target) { return async (items: INodeExecutionData[]): Promise => { - connectionType = NodeConnectionType.AiDocument; + connectionType = NodeConnectionTypes.AiDocument; const { index } = executeFunctions.addInputData(connectionType, [items]); const response = (await callMethodAsync.call(target, { @@ -322,7 +323,7 @@ export function logWrapper( // Process Each if (prop === 'processItem' && 'processItem' in target) { return async (item: INodeExecutionData, itemIndex: number): Promise => { - connectionType = NodeConnectionType.AiDocument; + connectionType = NodeConnectionTypes.AiDocument; const { index } = executeFunctions.addInputData(connectionType, [[item]]); const response = (await callMethodAsync.call(target, { @@ -346,7 +347,7 @@ export function logWrapper( if (originalInstance instanceof TextSplitter) { if (prop === 'splitText' && 'splitText' in target) { return async (text: string): Promise => { - connectionType = NodeConnectionType.AiTextSplitter; + connectionType = NodeConnectionTypes.AiTextSplitter; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { textSplitter: text } }], ]); @@ -370,7 +371,7 @@ export function logWrapper( if (isToolsInstance(originalInstance)) { if (prop === '_call' && '_call' in target) { return async (query: string): Promise => { - connectionType = NodeConnectionType.AiTool; + connectionType = NodeConnectionTypes.AiTool; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { query } }], ]); @@ -399,7 +400,7 @@ export function logWrapper( filter?: BiquadFilterType | undefined, _callbacks?: Callbacks | undefined, ): Promise => { - connectionType = NodeConnectionType.AiVectorStore; + connectionType = NodeConnectionTypes.AiVectorStore; const { index } = executeFunctions.addInputData(connectionType, [ [{ json: { query, k, filter } }], ]); diff --git a/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputFixingParser.ts b/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputFixingParser.ts index 2fb91bab47..fd58363cf0 100644 --- a/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputFixingParser.ts +++ b/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputFixingParser.ts @@ -4,7 +4,7 @@ import type { AIMessage } from '@langchain/core/messages'; import { BaseOutputParser, OutputParserException } from '@langchain/core/output_parsers'; import type { PromptTemplate } from '@langchain/core/prompts'; import type { ISupplyDataFunctions } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { N8nStructuredOutputParser } from './N8nStructuredOutputParser'; import { logAiEvent } from '../helpers'; @@ -33,7 +33,7 @@ export class N8nOutputFixingParser extends BaseOutputParser { * @throws Error if both parsing attempts fail */ async parse(completion: string, callbacks?: Callbacks) { - const { index } = this.context.addInputData(NodeConnectionType.AiOutputParser, [ + const { index } = this.context.addInputData(NodeConnectionTypes.AiOutputParser, [ [{ json: { action: 'parse', text: completion } }], ]); @@ -47,7 +47,7 @@ export class N8nOutputFixingParser extends BaseOutputParser { }); logAiEvent(this.context, 'ai-output-parsed', { text: completion, response }); - this.context.addOutputData(NodeConnectionType.AiOutputParser, index, [ + this.context.addOutputData(NodeConnectionTypes.AiOutputParser, index, [ [{ json: { action: 'parse', response } }], ]); @@ -68,14 +68,14 @@ export class N8nOutputFixingParser extends BaseOutputParser { const parsed = await this.outputParser.parse(resultText, callbacks); // Add the successfully parsed output to the context - this.context.addOutputData(NodeConnectionType.AiOutputParser, index, [ + this.context.addOutputData(NodeConnectionTypes.AiOutputParser, index, [ [{ json: { action: 'parse', response: parsed } }], ]); return parsed; } catch (autoParseError) { // If both attempts fail, add the error to the output and throw - this.context.addOutputData(NodeConnectionType.AiOutputParser, index, autoParseError); + this.context.addOutputData(NodeConnectionTypes.AiOutputParser, index, autoParseError); throw autoParseError; } } diff --git a/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputParser.ts b/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputParser.ts index 74a346f1be..51bd79591e 100644 --- a/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputParser.ts +++ b/packages/@n8n/nodes-langchain/utils/output_parsers/N8nOutputParser.ts @@ -1,5 +1,5 @@ import type { IExecuteFunctions } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { N8nItemListOutputParser } from './N8nItemListOutputParser'; import { N8nOutputFixingParser } from './N8nOutputFixingParser'; @@ -19,7 +19,7 @@ export async function getOptionalOutputParser( if (ctx.getNodeParameter('hasOutputParser', 0, true) === true) { outputParser = (await ctx.getInputConnectionData( - NodeConnectionType.AiOutputParser, + NodeConnectionTypes.AiOutputParser, 0, )) as N8nOutputParser; } diff --git a/packages/@n8n/nodes-langchain/utils/output_parsers/N8nStructuredOutputParser.ts b/packages/@n8n/nodes-langchain/utils/output_parsers/N8nStructuredOutputParser.ts index 08ba1735a2..641f84e5d5 100644 --- a/packages/@n8n/nodes-langchain/utils/output_parsers/N8nStructuredOutputParser.ts +++ b/packages/@n8n/nodes-langchain/utils/output_parsers/N8nStructuredOutputParser.ts @@ -2,7 +2,7 @@ import type { Callbacks } from '@langchain/core/callbacks/manager'; import { StructuredOutputParser } from 'langchain/output_parsers'; import get from 'lodash/get'; import type { ISupplyDataFunctions } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { z } from 'zod'; import { logAiEvent, unwrapNestedOutput } from '../helpers'; @@ -28,7 +28,7 @@ export class N8nStructuredOutputParser extends StructuredOutputParser< _callbacks?: Callbacks, errorMapper?: (error: Error) => Error, ): Promise { - const { index } = this.context.addInputData(NodeConnectionType.AiOutputParser, [ + const { index } = this.context.addInputData(NodeConnectionTypes.AiOutputParser, [ [{ json: { action: 'parse', text } }], ]); try { @@ -46,7 +46,7 @@ export class N8nStructuredOutputParser extends StructuredOutputParser< logAiEvent(this.context, 'ai-output-parsed', { text, response: result }); - this.context.addOutputData(NodeConnectionType.AiOutputParser, index, [ + this.context.addOutputData(NodeConnectionTypes.AiOutputParser, index, [ [{ json: { action: 'parse', response: result } }], ]); @@ -66,7 +66,7 @@ export class N8nStructuredOutputParser extends StructuredOutputParser< response: e.message ?? e, }); - this.context.addOutputData(NodeConnectionType.AiOutputParser, index, nodeError); + this.context.addOutputData(NodeConnectionTypes.AiOutputParser, index, nodeError); if (errorMapper) { throw errorMapper(e); } diff --git a/packages/@n8n/nodes-langchain/utils/sharedFields.ts b/packages/@n8n/nodes-langchain/utils/sharedFields.ts index ffc9640aaf..beb92b6f74 100644 --- a/packages/@n8n/nodes-langchain/utils/sharedFields.ts +++ b/packages/@n8n/nodes-langchain/utils/sharedFields.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType, type INodeProperties } from 'n8n-workflow'; +import { NodeConnectionTypes, type INodeProperties } from 'n8n-workflow'; export const metadataFilterField: INodeProperties = { displayName: 'Metadata Filter', @@ -43,36 +43,36 @@ export function getTemplateNoticeField(templateId: number): INodeProperties { } const connectionsString = { - [NodeConnectionType.AiAgent]: { + [NodeConnectionTypes.AiAgent]: { // Root AI view connection: '', locale: 'AI Agent', }, - [NodeConnectionType.AiChain]: { + [NodeConnectionTypes.AiChain]: { // Root AI view connection: '', locale: 'AI Chain', }, - [NodeConnectionType.AiDocument]: { - connection: NodeConnectionType.AiDocument, + [NodeConnectionTypes.AiDocument]: { + connection: NodeConnectionTypes.AiDocument, locale: 'Document Loader', }, - [NodeConnectionType.AiVectorStore]: { - connection: NodeConnectionType.AiVectorStore, + [NodeConnectionTypes.AiVectorStore]: { + connection: NodeConnectionTypes.AiVectorStore, locale: 'Vector Store', }, - [NodeConnectionType.AiRetriever]: { - connection: NodeConnectionType.AiRetriever, + [NodeConnectionTypes.AiRetriever]: { + connection: NodeConnectionTypes.AiRetriever, locale: 'Vector Store Retriever', }, }; type AllowedConnectionTypes = - | NodeConnectionType.AiAgent - | NodeConnectionType.AiChain - | NodeConnectionType.AiDocument - | NodeConnectionType.AiVectorStore - | NodeConnectionType.AiRetriever; + | typeof NodeConnectionTypes.AiAgent + | typeof NodeConnectionTypes.AiChain + | typeof NodeConnectionTypes.AiDocument + | typeof NodeConnectionTypes.AiVectorStore + | typeof NodeConnectionTypes.AiRetriever; function determineArticle(nextWord: string): string { // check if the next word starts with a vowel sound diff --git a/packages/@n8n/task-runner/src/js-task-runner/__tests__/test-data.ts b/packages/@n8n/task-runner/src/js-task-runner/__tests__/test-data.ts index 85a1235dc6..1b630122ec 100644 --- a/packages/@n8n/task-runner/src/js-task-runner/__tests__/test-data.ts +++ b/packages/@n8n/task-runner/src/js-task-runner/__tests__/test-data.ts @@ -1,5 +1,5 @@ import type { IDataObject, INode, INodeExecutionData, ITaskData } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { nanoid } from 'nanoid'; import type { JSExecSettings } from '@/js-task-runner/js-task-runner'; @@ -78,7 +78,7 @@ export const newDataRequestResponse = ( active: true, connections: { [manualTriggerNode.name]: { - main: [[{ node: codeNode.name, type: NodeConnectionType.Main, index: 0 }]], + main: [[{ node: codeNode.name, type: NodeConnectionTypes.Main, index: 0 }]], }, }, nodes: [manualTriggerNode, codeNode], diff --git a/packages/cli/src/__tests__/load-nodes-and-credentials.test.ts b/packages/cli/src/__tests__/load-nodes-and-credentials.test.ts index 50d2d8f74f..97b58f15ec 100644 --- a/packages/cli/src/__tests__/load-nodes-and-credentials.test.ts +++ b/packages/cli/src/__tests__/load-nodes-and-credentials.test.ts @@ -1,7 +1,7 @@ import { mock } from 'jest-mock-extended'; import type { DirectoryLoader } from 'n8n-core'; import type { INodeProperties, INodeTypeDescription } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { LoadNodesAndCredentials } from '../load-nodes-and-credentials'; @@ -51,8 +51,8 @@ describe('LoadNodesAndCredentials', () => { description: 'A test node', version: 1, defaults: {}, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: [NodeConnectionTypes.Main], + outputs: [NodeConnectionTypes.Main], properties: [], }, }; @@ -67,7 +67,7 @@ describe('LoadNodesAndCredentials', () => { it('should update inputs and outputs', () => { const result = instance.convertNodeToAiTool(fullNodeWrapper); expect(result.description.inputs).toEqual([]); - expect(result.description.outputs).toEqual([NodeConnectionType.AiTool]); + expect(result.description.outputs).toEqual([NodeConnectionTypes.AiTool]); }); it('should remove the usableAsTool property', () => { diff --git a/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts b/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts index 38e38c9803..628349bf85 100644 --- a/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts +++ b/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts @@ -1,7 +1,7 @@ import { Service } from '@n8n/di'; import { parse } from 'flatted'; import { ErrorReporter, Logger } from 'n8n-core'; -import { ExecutionCancelledError, NodeConnectionType, Workflow } from 'n8n-workflow'; +import { ExecutionCancelledError, NodeConnectionTypes, Workflow } from 'n8n-workflow'; import type { IDataObject, IRun, @@ -128,7 +128,7 @@ export class TestRunnerService { // Start nodes are the nodes that are connected to the trigger node const startNodes = workflowInstance - .getChildNodes(triggerNode, NodeConnectionType.Main, 1) + .getChildNodes(triggerNode, NodeConnectionTypes.Main, 1) .map((nodeName) => ({ name: nodeName, sourceData: { previousNode: pastExecutionTriggerNode }, diff --git a/packages/cli/src/executions/__tests__/constants.ts b/packages/cli/src/executions/__tests__/constants.ts index aeba0f1475..808b904239 100644 --- a/packages/cli/src/executions/__tests__/constants.ts +++ b/packages/cli/src/executions/__tests__/constants.ts @@ -1,5 +1,5 @@ import type { IWorkflowBase } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; /** * Workflow producing an execution whose data will be truncated by an instance crash. @@ -32,7 +32,7 @@ export const OOM_WORKFLOW: Partial = { [ { node: 'DebugHelper', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], diff --git a/packages/cli/src/load-nodes-and-credentials.ts b/packages/cli/src/load-nodes-and-credentials.ts index 2158d47f08..1a7bd2a355 100644 --- a/packages/cli/src/load-nodes-and-credentials.ts +++ b/packages/cli/src/load-nodes-and-credentials.ts @@ -26,7 +26,7 @@ import type { IVersionedNodeType, INodeProperties, } from 'n8n-workflow'; -import { deepCopy, NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow'; +import { deepCopy, NodeConnectionTypes, UnexpectedError, UserError } from 'n8n-workflow'; import path from 'path'; import picocolors from 'picocolors'; @@ -449,7 +449,7 @@ export class LoadNodesAndCredentials { if (isFullDescription(item.description)) { item.description.name += 'Tool'; item.description.inputs = []; - item.description.outputs = [NodeConnectionType.AiTool]; + item.description.outputs = [NodeConnectionTypes.AiTool]; item.description.displayName += ' Tool'; delete item.description.usableAsTool; diff --git a/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts b/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts index 05a6b2c31f..caa6ac9036 100644 --- a/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts +++ b/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { v4 as uuid } from 'uuid'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; @@ -160,7 +160,7 @@ test('should not report webhooks validated by direct children', async () => { [ { node: 'My Node', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], diff --git a/packages/cli/test/integration/shared/db/workflows.ts b/packages/cli/test/integration/shared/db/workflows.ts index 3feec218dd..b73e0a45c7 100644 --- a/packages/cli/test/integration/shared/db/workflows.ts +++ b/packages/cli/test/integration/shared/db/workflows.ts @@ -1,7 +1,7 @@ import { Container } from '@n8n/di'; import type { DeepPartial } from '@n8n/typeorm'; import type { IWorkflowBase } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { v4 as uuid } from 'uuid'; import { Project } from '@/databases/entities/project'; @@ -161,7 +161,9 @@ export async function createWorkflowWithTrigger( position: [780, 300], }, ], - connections: { Cron: { main: [[{ node: 'Set', type: NodeConnectionType.Main, index: 0 }]] } }, + connections: { + Cron: { main: [[{ node: 'Set', type: NodeConnectionTypes.Main, index: 0 }]] }, + }, ...attributes, }, user, diff --git a/packages/cli/test/integration/task-runners/js-task-runner-execution.integration.test.ts b/packages/cli/test/integration/task-runners/js-task-runner-execution.integration.test.ts index a69f60d198..5633df7340 100644 --- a/packages/cli/test/integration/task-runners/js-task-runner-execution.integration.test.ts +++ b/packages/cli/test/integration/task-runners/js-task-runner-execution.integration.test.ts @@ -12,7 +12,7 @@ import type { IWorkflowExecuteAdditionalData, WorkflowExecuteMode, } from 'n8n-workflow'; -import { createEnvProviderState, NodeConnectionType, Workflow } from 'n8n-workflow'; +import { createEnvProviderState, NodeConnectionTypes, Workflow } from 'n8n-workflow'; import { LocalTaskRequester } from '@/task-runners/task-managers/local-task-requester'; import { TaskRunnerModule } from '@/task-runners/task-runner-module'; @@ -78,7 +78,7 @@ describe('JS TaskRunner execution on internal mode', () => { [ { node: 'Code', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], diff --git a/packages/cli/test/integration/webhooks.api.test.ts b/packages/cli/test/integration/webhooks.api.test.ts index 8d1e7168f0..fa53ff239e 100644 --- a/packages/cli/test/integration/webhooks.api.test.ts +++ b/packages/cli/test/integration/webhooks.api.test.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'fs'; import type { IWorkflowBase } from 'n8n-workflow'; import { - NodeConnectionType, + NodeConnectionTypes, type INodeType, type INodeTypeDescription, type IWebhookFunctions, @@ -189,7 +189,7 @@ describe('Webhook API', () => { description: '', defaults: {}, inputs: [], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], webhooks: [ { name: 'default', diff --git a/packages/core/src/execution-engine/__tests__/workflow-execute.test.ts b/packages/core/src/execution-engine/__tests__/workflow-execute.test.ts index 9a40520502..89b80d333f 100644 --- a/packages/core/src/execution-engine/__tests__/workflow-execute.test.ts +++ b/packages/core/src/execution-engine/__tests__/workflow-execute.test.ts @@ -37,7 +37,7 @@ import type { import { ApplicationError, createDeferredPromise, - NodeConnectionType, + NodeConnectionTypes, NodeHelpers, Workflow, } from 'n8n-workflow'; @@ -805,10 +805,10 @@ describe('WorkflowExecute', () => { displayName: 'test', defaultVersion: 1, properties: [], - inputs: [{ type: NodeConnectionType.Main }], + inputs: [{ type: NodeConnectionTypes.Main }], outputs: [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.Main, category: 'error' }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.Main, category: 'error' }, ], }, }); @@ -836,7 +836,7 @@ describe('WorkflowExecute', () => { ], }, source: { - [NodeConnectionType.Main]: [ + [NodeConnectionTypes.Main]: [ { previousNode: 'previousNode', previousNodeOutput: 0, @@ -1138,8 +1138,8 @@ describe('WorkflowExecute', () => { }; const inputConnections: IConnection[] = [ - { node: 'node1', type: NodeConnectionType.Main, index: 0 }, - { node: 'node1', type: NodeConnectionType.Main, index: 1 }, + { node: 'node1', type: NodeConnectionTypes.Main, index: 0 }, + { node: 'node1', type: NodeConnectionTypes.Main, index: 1 }, ]; const result = workflowExecute.incomingConnectionIsEmpty(runData, inputConnections, 0); @@ -1149,7 +1149,7 @@ describe('WorkflowExecute', () => { test('should return true when input connection node does not exist in runData', () => { const runData: IRunData = {}; const inputConnections: IConnection[] = [ - { node: 'nonexistentNode', type: NodeConnectionType.Main, index: 0 }, + { node: 'nonexistentNode', type: NodeConnectionTypes.Main, index: 0 }, ]; const result = workflowExecute.incomingConnectionIsEmpty(runData, inputConnections, 0); @@ -1171,8 +1171,8 @@ describe('WorkflowExecute', () => { }; const inputConnections: IConnection[] = [ - { node: 'node1', type: NodeConnectionType.Main, index: 0 }, - { node: 'node1', type: NodeConnectionType.Main, index: 1 }, + { node: 'node1', type: NodeConnectionTypes.Main, index: 0 }, + { node: 'node1', type: NodeConnectionTypes.Main, index: 1 }, ]; const result = workflowExecute.incomingConnectionIsEmpty(runData, inputConnections, 0); @@ -1202,7 +1202,7 @@ describe('WorkflowExecute', () => { }; const inputConnections: IConnection[] = [ - { node: 'node1', type: NodeConnectionType.Main, index: 0 }, + { node: 'node1', type: NodeConnectionTypes.Main, index: 0 }, ]; expect(workflowExecute.incomingConnectionIsEmpty(runData, inputConnections, 0)).toBe(true); @@ -1221,7 +1221,7 @@ describe('WorkflowExecute', () => { }; const inputConnections: IConnection[] = [ - { node: 'node1', type: NodeConnectionType.Main, index: 0 }, + { node: 'node1', type: NodeConnectionTypes.Main, index: 0 }, ]; const result = workflowExecute.incomingConnectionIsEmpty(runData, inputConnections, 0); @@ -1600,7 +1600,7 @@ describe('WorkflowExecute', () => { workflow.connectionsByDestinationNode = { [node.name]: { - main: [[{ node: parentNode.name, type: NodeConnectionType.Main, index: 0 }]], + main: [[{ node: parentNode.name, type: NodeConnectionTypes.Main, index: 0 }]], }, }; @@ -1618,7 +1618,7 @@ describe('WorkflowExecute', () => { workflow.connectionsByDestinationNode = { [node.name]: { - main: [[{ node: parentNode.name, type: NodeConnectionType.Main, index: 0 }]], + main: [[{ node: parentNode.name, type: NodeConnectionTypes.Main, index: 0 }]], }, }; @@ -1637,7 +1637,7 @@ describe('WorkflowExecute', () => { workflow.connectionsByDestinationNode = { [node.name]: { - main: [[{ node: parentNode.name, type: NodeConnectionType.Main, index: 0 }]], + main: [[{ node: parentNode.name, type: NodeConnectionTypes.Main, index: 0 }]], }, }; diff --git a/packages/core/src/execution-engine/node-execution-context/__tests__/execute-context.test.ts b/packages/core/src/execution-engine/node-execution-context/__tests__/execute-context.test.ts index a888a5a7ff..3f71e2fa6f 100644 --- a/packages/core/src/execution-engine/node-execution-context/__tests__/execute-context.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/__tests__/execute-context.test.ts @@ -14,7 +14,7 @@ import type { INodeTypes, ICredentialDataDecryptedObject, } from 'n8n-workflow'; -import { ApplicationError, ExpressionError, NodeConnectionType } from 'n8n-workflow'; +import { ApplicationError, ExpressionError, NodeConnectionTypes } from 'n8n-workflow'; import { describeCommonTests } from './shared-tests'; import { ExecuteContext } from '../execute-context'; @@ -92,7 +92,7 @@ describe('ExecuteContext', () => { describe('getInputData', () => { const inputIndex = 0; - const connectionType = NodeConnectionType.Main; + const connectionType = NodeConnectionTypes.Main; afterEach(() => { inputData[connectionType] = [[{ json: { test: 'data' } }]]; @@ -105,10 +105,8 @@ describe('ExecuteContext', () => { }); it('should return an empty array if the input name does not exist', () => { - const connectionType = 'nonExistent'; - expect(executeContext.getInputData(inputIndex, connectionType as NodeConnectionType)).toEqual( - [], - ); + const connectionType = 'nonExistent' as typeof NodeConnectionTypes.Main; + expect(executeContext.getInputData(inputIndex, connectionType)).toEqual([]); }); it('should throw an error if the input index is out of range', () => { diff --git a/packages/core/src/execution-engine/node-execution-context/__tests__/execute-single-context.test.ts b/packages/core/src/execution-engine/node-execution-context/__tests__/execute-single-context.test.ts index 6c1b9f1089..daa83adb12 100644 --- a/packages/core/src/execution-engine/node-execution-context/__tests__/execute-single-context.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/__tests__/execute-single-context.test.ts @@ -14,7 +14,7 @@ import type { INodeTypes, ICredentialDataDecryptedObject, } from 'n8n-workflow'; -import { ApplicationError, NodeConnectionType } from 'n8n-workflow'; +import { ApplicationError, NodeConnectionTypes } from 'n8n-workflow'; import { describeCommonTests } from './shared-tests'; import { ExecuteSingleContext } from '../execute-single-context'; @@ -91,7 +91,7 @@ describe('ExecuteSingleContext', () => { describe('getInputData', () => { const inputIndex = 0; - const connectionType = NodeConnectionType.Main; + const connectionType = NodeConnectionTypes.Main; afterEach(() => { inputData[connectionType] = [[{ json: { test: 'data' } }]]; @@ -104,12 +104,10 @@ describe('ExecuteSingleContext', () => { }); it('should return an empty object if the input name does not exist', () => { - const connectionType = 'nonExistent'; + const connectionType = 'nonExistent' as typeof NodeConnectionTypes.Main; const expectedData = { json: {} }; - expect( - executeSingleContext.getInputData(inputIndex, connectionType as NodeConnectionType), - ).toEqual(expectedData); + expect(executeSingleContext.getInputData(inputIndex, connectionType)).toEqual(expectedData); }); it('should throw an error if the input index is out of range', () => { diff --git a/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts b/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts index 6a10c2bba5..7fe0f3093f 100644 --- a/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts @@ -10,7 +10,7 @@ import type { Workflow, WorkflowExecuteMode, } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { InstanceSettings } from '@/instance-settings'; @@ -178,27 +178,27 @@ describe('NodeExecutionContext', () => { describe('getNodeInputs', () => { it('should return static inputs array when inputs is an array', () => { - nodeType.description.inputs = [NodeConnectionType.Main, NodeConnectionType.AiLanguageModel]; + nodeType.description.inputs = [NodeConnectionTypes.Main, NodeConnectionTypes.AiLanguageModel]; const result = testContext.getNodeInputs(); expect(result).toEqual([ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel }, ]); }); it('should return input objects when inputs contains configurations', () => { nodeType.description.inputs = [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel, required: true }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel, required: true }, ]; const result = testContext.getNodeInputs(); expect(result).toEqual([ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel, required: true }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel, required: true }, ]); }); @@ -206,15 +206,15 @@ describe('NodeExecutionContext', () => { const inputsExpressions = '={{ ["main", "ai_languageModel"] }}'; nodeType.description.inputs = inputsExpressions; expression.getSimpleParameterValue.mockReturnValue([ - NodeConnectionType.Main, - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.Main, + NodeConnectionTypes.AiLanguageModel, ]); const result = testContext.getNodeInputs(); expect(result).toEqual([ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel }, ]); expect(expression.getSimpleParameterValue).toHaveBeenCalledWith( node, @@ -227,27 +227,30 @@ describe('NodeExecutionContext', () => { describe('getNodeOutputs', () => { it('should return static outputs array when outputs is an array', () => { - nodeType.description.outputs = [NodeConnectionType.Main, NodeConnectionType.AiLanguageModel]; - - const result = testContext.getNodeOutputs(); - - expect(result).toEqual([ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel }, - ]); - }); - - it('should return output objects when outputs contains configurations', () => { nodeType.description.outputs = [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel, required: true }, + NodeConnectionTypes.Main, + NodeConnectionTypes.AiLanguageModel, ]; const result = testContext.getNodeOutputs(); expect(result).toEqual([ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel, required: true }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel }, + ]); + }); + + it('should return output objects when outputs contains configurations', () => { + nodeType.description.outputs = [ + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel, required: true }, + ]; + + const result = testContext.getNodeOutputs(); + + expect(result).toEqual([ + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel, required: true }, ]); }); @@ -255,15 +258,15 @@ describe('NodeExecutionContext', () => { const outputsExpressions = '={{ ["main", "ai_languageModel"] }}'; nodeType.description.outputs = outputsExpressions; expression.getSimpleParameterValue.mockReturnValue([ - NodeConnectionType.Main, - NodeConnectionType.AiLanguageModel, + NodeConnectionTypes.Main, + NodeConnectionTypes.AiLanguageModel, ]); const result = testContext.getNodeOutputs(); expect(result).toEqual([ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiLanguageModel }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiLanguageModel }, ]); expect(expression.getSimpleParameterValue).toHaveBeenCalledWith( node, @@ -276,13 +279,13 @@ describe('NodeExecutionContext', () => { it('should add error output when node has continueOnFail error handling', () => { const nodeWithError = mock({ onError: 'continueErrorOutput' }); const contextWithError = new TestContext(workflow, nodeWithError, additionalData, mode); - nodeType.description.outputs = [NodeConnectionType.Main]; + nodeType.description.outputs = [NodeConnectionTypes.Main]; const result = contextWithError.getNodeOutputs(); expect(result).toEqual([ - { type: NodeConnectionType.Main, displayName: 'Success' }, - { type: NodeConnectionType.Main, displayName: 'Error', category: 'error' }, + { type: NodeConnectionTypes.Main, displayName: 'Success' }, + { type: NodeConnectionTypes.Main, displayName: 'Error', category: 'error' }, ]); }); }); @@ -299,10 +302,10 @@ describe('NodeExecutionContext', () => { return null; }); - const result = testContext.getConnectedNodes(NodeConnectionType.Main); + const result = testContext.getConnectedNodes(NodeConnectionTypes.Main); expect(result).toEqual([node1, node2]); - expect(workflow.getParentNodes).toHaveBeenCalledWith(node.name, NodeConnectionType.Main, 1); + expect(workflow.getParentNodes).toHaveBeenCalledWith(node.name, NodeConnectionTypes.Main, 1); }); it('should filter out disabled nodes', () => { @@ -316,7 +319,7 @@ describe('NodeExecutionContext', () => { return null; }); - const result = testContext.getConnectedNodes(NodeConnectionType.Main); + const result = testContext.getConnectedNodes(NodeConnectionTypes.Main); expect(result).toEqual([node1]); }); @@ -330,7 +333,7 @@ describe('NodeExecutionContext', () => { return null; }); - const result = testContext.getConnectedNodes(NodeConnectionType.Main); + const result = testContext.getConnectedNodes(NodeConnectionTypes.Main); expect(result).toEqual([node1]); }); diff --git a/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts b/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts index 54edbb3df9..c2bc248c73 100644 --- a/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts @@ -13,8 +13,9 @@ import type { INodeType, INodeTypes, ICredentialDataDecryptedObject, + NodeConnectionType, } from 'n8n-workflow'; -import { ApplicationError, NodeConnectionType } from 'n8n-workflow'; +import { ApplicationError, NodeConnectionTypes } from 'n8n-workflow'; import { describeCommonTests } from './shared-tests'; import { SupplyDataContext } from '../supply-data-context'; @@ -58,7 +59,7 @@ describe('SupplyDataContext', () => { resultData: { runData: {} }, }); const connectionInputData: INodeExecutionData[] = []; - const connectionType = NodeConnectionType.Main; + const connectionType = NodeConnectionTypes.Main; const inputData: ITaskDataConnections = { [connectionType]: [[{ json: { test: 'data' } }]] }; const executeData = mock(); const runIndex = 0; diff --git a/packages/core/src/execution-engine/node-execution-context/base-execute-context.ts b/packages/core/src/execution-engine/node-execution-context/base-execute-context.ts index f2d0aa8653..d413fb4db2 100644 --- a/packages/core/src/execution-engine/node-execution-context/base-execute-context.ts +++ b/packages/core/src/execution-engine/node-execution-context/base-execute-context.ts @@ -20,11 +20,12 @@ import type { IWorkflowDataProxyData, ISourceData, AiEvent, + NodeConnectionType, } from 'n8n-workflow'; import { ApplicationError, NodeHelpers, - NodeConnectionType, + NodeConnectionTypes, WAIT_INDEFINITELY, WorkflowDataProxy, } from 'n8n-workflow'; @@ -159,7 +160,7 @@ export class BaseExecuteContext extends NodeExecutionContext { return allItems; } - getInputSourceData(inputIndex = 0, connectionType = NodeConnectionType.Main): ISourceData { + getInputSourceData(inputIndex = 0, connectionType = NodeConnectionTypes.Main): ISourceData { if (this.executeData?.source === null) { // Should never happen as n8n sets it automatically throw new ApplicationError('Source data is missing'); diff --git a/packages/core/src/execution-engine/node-execution-context/execute-context.ts b/packages/core/src/execution-engine/node-execution-context/execute-context.ts index 47d679bc60..0d4389b64b 100644 --- a/packages/core/src/execution-engine/node-execution-context/execute-context.ts +++ b/packages/core/src/execution-engine/node-execution-context/execute-context.ts @@ -20,7 +20,7 @@ import { ApplicationError, createDeferredPromise, createEnvProviderState, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import { BaseExecuteContext } from './base-execute-context'; @@ -173,7 +173,7 @@ export class ExecuteContext extends BaseExecuteContext implements IExecuteFuncti ); } - getInputData(inputIndex = 0, connectionType = NodeConnectionType.Main) { + getInputData(inputIndex = 0, connectionType = NodeConnectionTypes.Main) { if (!this.inputData.hasOwnProperty(connectionType)) { // Return empty array because else it would throw error when nothing is connected to input return []; diff --git a/packages/core/src/execution-engine/node-execution-context/execute-single-context.ts b/packages/core/src/execution-engine/node-execution-context/execute-single-context.ts index d9d0561824..4282f534c6 100644 --- a/packages/core/src/execution-engine/node-execution-context/execute-single-context.ts +++ b/packages/core/src/execution-engine/node-execution-context/execute-single-context.ts @@ -11,7 +11,7 @@ import type { ITaskDataConnections, IExecuteData, } from 'n8n-workflow'; -import { ApplicationError, createDeferredPromise, NodeConnectionType } from 'n8n-workflow'; +import { ApplicationError, createDeferredPromise, NodeConnectionTypes } from 'n8n-workflow'; import { BaseExecuteContext } from './base-execute-context'; import { @@ -76,7 +76,7 @@ export class ExecuteSingleContext extends BaseExecuteContext implements IExecute return super.evaluateExpression(expression, itemIndex); } - getInputData(inputIndex = 0, connectionType = NodeConnectionType.Main) { + getInputData(inputIndex = 0, connectionType = NodeConnectionTypes.Main) { if (!this.inputData.hasOwnProperty(connectionType)) { // Return empty array because else it would throw error when nothing is connected to input return { json: {} }; diff --git a/packages/core/src/execution-engine/node-execution-context/supply-data-context.ts b/packages/core/src/execution-engine/node-execution-context/supply-data-context.ts index 8484b1128d..69b9bf346e 100644 --- a/packages/core/src/execution-engine/node-execution-context/supply-data-context.ts +++ b/packages/core/src/execution-engine/node-execution-context/supply-data-context.ts @@ -15,8 +15,9 @@ import type { IWorkflowExecuteAdditionalData, Workflow, WorkflowExecuteMode, + NodeConnectionType, } from 'n8n-workflow'; -import { createDeferredPromise, NodeConnectionType } from 'n8n-workflow'; +import { createDeferredPromise, NodeConnectionTypes } from 'n8n-workflow'; import { BaseExecuteContext } from './base-execute-context'; import { @@ -126,7 +127,7 @@ export class SupplyDataContext extends BaseExecuteContext implements ISupplyData this.closeFunctions, this.abortSignal, ); - context.addInputData(NodeConnectionType.AiTool, replacements.inputData); + context.addInputData(NodeConnectionTypes.AiTool, replacements.inputData); return context; } diff --git a/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts b/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts index 4e634a196e..2818f1a564 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts @@ -11,7 +11,7 @@ import type { INodeType, INodeTypes, } from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { ExecuteContext } from '../../execute-context'; @@ -67,16 +67,16 @@ describe('getInputConnectionData', () => { }); describe.each([ - NodeConnectionType.AiAgent, - NodeConnectionType.AiChain, - NodeConnectionType.AiDocument, - NodeConnectionType.AiEmbedding, - NodeConnectionType.AiLanguageModel, - NodeConnectionType.AiMemory, - NodeConnectionType.AiOutputParser, - NodeConnectionType.AiRetriever, - NodeConnectionType.AiTextSplitter, - NodeConnectionType.AiVectorStore, + NodeConnectionTypes.AiAgent, + NodeConnectionTypes.AiChain, + NodeConnectionTypes.AiDocument, + NodeConnectionTypes.AiEmbedding, + NodeConnectionTypes.AiLanguageModel, + NodeConnectionTypes.AiMemory, + NodeConnectionTypes.AiOutputParser, + NodeConnectionTypes.AiRetriever, + NodeConnectionTypes.AiTextSplitter, + NodeConnectionTypes.AiVectorStore, ] as const)('%s', (connectionType) => { const response = mock(); const node = mock({ @@ -231,7 +231,7 @@ describe('getInputConnectionData', () => { }); }); - describe(NodeConnectionType.AiTool, () => { + describe(NodeConnectionTypes.AiTool, () => { const mockTool = mock(); const toolNode = mock({ name: 'Test Tool', @@ -252,7 +252,7 @@ describe('getInputConnectionData', () => { .calledWith(toolNode.type, expect.anything()) .mockReturnValue(toolNodeType); workflow.getParentNodes - .calledWith(agentNode.name, NodeConnectionType.AiTool) + .calledWith(agentNode.name, NodeConnectionTypes.AiTool) .mockReturnValue([toolNode.name]); workflow.getNode.calledWith(toolNode.name).mockReturnValue(toolNode); workflow.getNode.calledWith(secondToolNode.name).mockReturnValue(secondToolNode); @@ -261,13 +261,13 @@ describe('getInputConnectionData', () => { it('should return empty array when no tools are connected and input is not required', async () => { agentNodeType.description.inputs = [ { - type: NodeConnectionType.AiTool, + type: NodeConnectionTypes.AiTool, required: false, }, ]; workflow.getParentNodes.mockReturnValueOnce([]); - const result = await executeContext.getInputConnectionData(NodeConnectionType.AiTool, 0); + const result = await executeContext.getInputConnectionData(NodeConnectionTypes.AiTool, 0); expect(result).toEqual([]); expect(supplyData).not.toHaveBeenCalled(); }); @@ -275,14 +275,14 @@ describe('getInputConnectionData', () => { it('should throw when required tool node is not connected', async () => { agentNodeType.description.inputs = [ { - type: NodeConnectionType.AiTool, + type: NodeConnectionTypes.AiTool, required: true, }, ]; workflow.getParentNodes.mockReturnValueOnce([]); await expect( - executeContext.getInputConnectionData(NodeConnectionType.AiTool, 0), + executeContext.getInputConnectionData(NodeConnectionTypes.AiTool, 0), ).rejects.toThrow('must be connected and enabled'); expect(supplyData).not.toHaveBeenCalled(); }); @@ -296,18 +296,18 @@ describe('getInputConnectionData', () => { agentNodeType.description.inputs = [ { - type: NodeConnectionType.AiTool, + type: NodeConnectionTypes.AiTool, required: true, }, ]; workflow.getParentNodes - .calledWith(agentNode.name, NodeConnectionType.AiTool) + .calledWith(agentNode.name, NodeConnectionTypes.AiTool) .mockReturnValue([disabledToolNode.name]); workflow.getNode.calledWith(disabledToolNode.name).mockReturnValue(disabledToolNode); await expect( - executeContext.getInputConnectionData(NodeConnectionType.AiTool, 0), + executeContext.getInputConnectionData(NodeConnectionTypes.AiTool, 0), ).rejects.toThrow('must be connected and enabled'); expect(supplyData).not.toHaveBeenCalled(); }); @@ -315,7 +315,7 @@ describe('getInputConnectionData', () => { it('should handle multiple connected tools', async () => { agentNodeType.description.inputs = [ { - type: NodeConnectionType.AiTool, + type: NodeConnectionTypes.AiTool, required: true, }, ]; @@ -325,10 +325,10 @@ describe('getInputConnectionData', () => { .mockReturnValue(secondToolNodeType); workflow.getParentNodes - .calledWith(agentNode.name, NodeConnectionType.AiTool) + .calledWith(agentNode.name, NodeConnectionTypes.AiTool) .mockReturnValue([toolNode.name, secondToolNode.name]); - const result = await executeContext.getInputConnectionData(NodeConnectionType.AiTool, 0); + const result = await executeContext.getInputConnectionData(NodeConnectionTypes.AiTool, 0); expect(result).toEqual([mockTool, secondMockTool]); expect(supplyData).toHaveBeenCalled(); expect(secondToolNodeType.supplyData).toHaveBeenCalled(); @@ -339,13 +339,13 @@ describe('getInputConnectionData', () => { agentNodeType.description.inputs = [ { - type: NodeConnectionType.AiTool, + type: NodeConnectionTypes.AiTool, required: true, }, ]; await expect( - executeContext.getInputConnectionData(NodeConnectionType.AiTool, 0), + executeContext.getInputConnectionData(NodeConnectionTypes.AiTool, 0), ).rejects.toThrow(`Error in sub-node ${toolNode.name}`); expect(supplyData).toHaveBeenCalled(); }); @@ -353,12 +353,12 @@ describe('getInputConnectionData', () => { it('should return the tool when there are no issues', async () => { agentNodeType.description.inputs = [ { - type: NodeConnectionType.AiTool, + type: NodeConnectionTypes.AiTool, required: true, }, ]; - const result = await executeContext.getInputConnectionData(NodeConnectionType.AiTool, 0); + const result = await executeContext.getInputConnectionData(NodeConnectionTypes.AiTool, 0); expect(result).toEqual([mockTool]); expect(supplyData).toHaveBeenCalled(); }); diff --git a/packages/core/src/execution-engine/node-execution-context/utils/get-input-connection-data.ts b/packages/core/src/execution-engine/node-execution-context/utils/get-input-connection-data.ts index d599d72841..c056f1e3a6 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/get-input-connection-data.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/get-input-connection-data.ts @@ -13,7 +13,7 @@ import type { AINodeConnectionType, } from 'n8n-workflow'; import { - NodeConnectionType, + NodeConnectionTypes, NodeOperationError, ExecutionBaseError, ApplicationError, @@ -92,7 +92,7 @@ export async function getInputConnectionData( ); if (!connectedNodeType.supplyData) { - if (connectedNodeType.description.outputs.includes(NodeConnectionType.AiTool)) { + if (connectedNodeType.description.outputs.includes(NodeConnectionTypes.AiTool)) { /** * This keeps track of how many times this specific AI tool node has been invoked. * It is incremented on every invocation of the tool to keep the output of each invocation separate from each other. @@ -104,7 +104,7 @@ export async function getInputConnectionData( handleToolInvocation: async (toolArgs) => { const runIndex = toolRunIndex++; const context = contextFactory(runIndex, {}); - context.addInputData(NodeConnectionType.AiTool, [[{ json: toolArgs }]]); + context.addInputData(NodeConnectionTypes.AiTool, [[{ json: toolArgs }]]); try { // Execute the sub-node with the proxied context @@ -116,7 +116,7 @@ export async function getInputConnectionData( const mappedResults = result?.[0]?.flatMap((item) => item.json); // Add output data to the context - context.addOutputData(NodeConnectionType.AiTool, runIndex, [ + context.addOutputData(NodeConnectionTypes.AiTool, runIndex, [ [{ json: { response: mappedResults } }], ]); @@ -124,7 +124,7 @@ export async function getInputConnectionData( return JSON.stringify(mappedResults); } catch (error) { const nodeError = new NodeOperationError(connectedNode, error as Error); - context.addOutputData(NodeConnectionType.AiTool, runIndex, nodeError); + context.addOutputData(NodeConnectionTypes.AiTool, runIndex, nodeError); return 'Error during node execution: ' + nodeError.description; } }, diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/clean-run-data.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/clean-run-data.test.ts index 1e46e40070..552ec43103 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/clean-run-data.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/clean-run-data.test.ts @@ -9,7 +9,7 @@ // XX denotes that the node is disabled // PD denotes that the node has pinned data -import { NodeConnectionType, type IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes, type IRunData } from 'n8n-workflow'; import { createNodeData, toITaskData } from './helpers'; import { cleanRunData } from '../clean-run-data'; @@ -140,7 +140,7 @@ describe('cleanRunData', () => { .addNodes(node1, rootNode, subNode) .addConnections( { from: node1, to: rootNode }, - { from: subNode, to: rootNode, type: NodeConnectionType.AiLanguageModel }, + { from: subNode, to: rootNode, type: NodeConnectionTypes.AiLanguageModel }, ); const runData: IRunData = { [node1.name]: [toITaskData([{ data: { value: 1 } }])], @@ -176,7 +176,7 @@ describe('cleanRunData', () => { .addConnections( { from: node1, to: node2 }, { from: node2, to: rootNode }, - { from: subNode, to: rootNode, type: NodeConnectionType.AiLanguageModel }, + { from: subNode, to: rootNode, type: NodeConnectionTypes.AiLanguageModel }, ); const runData: IRunData = { [node1.name]: [toITaskData([{ data: { value: 1 } }])], @@ -213,8 +213,8 @@ describe('cleanRunData', () => { .addConnections( { from: node1, to: rootNode1 }, { from: rootNode1, to: rootNode2 }, - { from: subNode, to: rootNode1, type: NodeConnectionType.AiLanguageModel }, - { from: subNode, to: rootNode2, type: NodeConnectionType.AiLanguageModel }, + { from: subNode, to: rootNode1, type: NodeConnectionTypes.AiLanguageModel }, + { from: subNode, to: rootNode2, type: NodeConnectionTypes.AiLanguageModel }, ); const runData: IRunData = { [node1.name]: [toITaskData([{ data: { value: 1 } }])], diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/directed-graph.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/directed-graph.test.ts index 7b4e090761..d4b53f9307 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/directed-graph.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/directed-graph.test.ts @@ -10,7 +10,7 @@ // PD denotes that the node has pinned data import type { INode } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { createNodeData, defaultWorkflowParameter } from './helpers'; import { DirectedGraph } from '../directed-graph'; @@ -327,7 +327,7 @@ describe('DirectedGraph', () => { expect(newConnections[0]).toEqual({ from: node0, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node2, }); @@ -372,7 +372,7 @@ describe('DirectedGraph', () => { expect(newConnections[0]).toEqual({ from: node0, outputIndex: 1, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 4, to: node2, }); diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/filter-disabled-nodes.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/filter-disabled-nodes.test.ts index 69348720f7..f923d94382 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/filter-disabled-nodes.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/filter-disabled-nodes.test.ts @@ -9,7 +9,7 @@ // XX denotes that the node is disabled // PD denotes that the node has pinned data -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { createNodeData } from './helpers'; import { DirectedGraph } from '../directed-graph'; @@ -104,7 +104,7 @@ describe('filterDisabledNodes', () => { .addNodes(trigger, root, aiModel, destination) .addConnections( { from: trigger, to: root }, - { from: aiModel, type: NodeConnectionType.AiLanguageModel, to: root }, + { from: aiModel, type: NodeConnectionTypes.AiLanguageModel, to: root }, { from: root, to: destination }, ); diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/find-subgraph.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/find-subgraph.test.ts index 429f8b7c4f..d22d6e2f50 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/find-subgraph.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/find-subgraph.test.ts @@ -9,7 +9,7 @@ // XX denotes that the node is disabled // PD denotes that the node has pinned data -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { createNodeData } from './helpers'; import { DirectedGraph } from '../directed-graph'; @@ -191,7 +191,7 @@ describe('findSubgraph', () => { // ┌┴──────┐ // │aiModel│ // └───────┘ - test('always retain connections that have a different type than `NodeConnectionType.Main`', () => { + test('always retain connections that have a different type than `NodeConnectionTypes.Main`', () => { // ARRANGE const trigger = createNodeData({ name: 'trigger' }); const destination = createNodeData({ name: 'destination' }); @@ -201,7 +201,7 @@ describe('findSubgraph', () => { .addNodes(trigger, destination, aiModel) .addConnections( { from: trigger, to: destination }, - { from: aiModel, type: NodeConnectionType.AiLanguageModel, to: destination }, + { from: aiModel, type: NodeConnectionTypes.AiLanguageModel, to: destination }, ); // ACT @@ -236,7 +236,7 @@ describe('findSubgraph', () => { .addNodes(trigger, root, aiModel, destination) .addConnections( { from: trigger, to: aiModel }, - { from: aiModel, type: NodeConnectionType.AiLanguageModel, to: root }, + { from: aiModel, type: NodeConnectionTypes.AiLanguageModel, to: root }, { from: root, to: destination }, ); diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts index 872a452aa7..d2d293d103 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts @@ -8,7 +8,7 @@ // PD denotes that the node has pinned data import type { IPinData } from 'n8n-workflow'; -import { NodeConnectionType, type IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes, type IRunData } from 'n8n-workflow'; import { createNodeData, toITaskData } from './helpers'; import { DirectedGraph } from '../directed-graph'; @@ -56,14 +56,14 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); expect(group1.connections[1]).toEqual({ from: source3, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); @@ -73,7 +73,7 @@ describe('getSourceDataGroups', () => { expect(group2.connections[0]).toEqual({ from: source2, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); @@ -120,14 +120,14 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); expect(group1.connections[1]).toEqual({ from: source3, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); @@ -137,7 +137,7 @@ describe('getSourceDataGroups', () => { expect(group2.connections[0]).toEqual({ from: source2, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); @@ -184,14 +184,14 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source2, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); expect(group1.connections[1]).toEqual({ from: source3, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); @@ -205,7 +205,7 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); @@ -261,14 +261,14 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source2, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); expect(group1.connections[1]).toEqual({ from: source3, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); @@ -282,14 +282,14 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); expect(group1.connections[1]).toEqual({ from: source4, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); @@ -341,14 +341,14 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); expect(group1.connections[1]).toEqual({ from: source3, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); @@ -358,7 +358,7 @@ describe('getSourceDataGroups', () => { expect(group2.connections[0]).toEqual({ from: source2, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 0, to: node, }); @@ -461,7 +461,7 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: -1, to: node, }); @@ -490,7 +490,7 @@ describe('getSourceDataGroups', () => { expect(group1.connections[0]).toEqual({ from: source1, outputIndex: 0, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, inputIndex: 1, to: node, }); diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/helpers.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/helpers.ts index 74976bba3e..0cc8e116db 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/helpers.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/helpers.ts @@ -1,5 +1,12 @@ -import { NodeConnectionType } from 'n8n-workflow'; -import type { INodeParameters, INode, ITaskData, IDataObject, IConnections } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; +import type { + INodeParameters, + INode, + ITaskData, + IDataObject, + IConnections, + NodeConnectionType, +} from 'n8n-workflow'; interface StubNode { name: string; @@ -38,7 +45,7 @@ export function toITaskData(taskData: TaskData[]): ITaskData { // NOTE: Here to make TS happy. result.data = result.data ?? {}; for (const taskDatum of taskData) { - const type = taskDatum.nodeConnectionType ?? NodeConnectionType.Main; + const type = taskDatum.nodeConnectionType ?? NodeConnectionTypes.Main; const outputIndex = taskDatum.outputIndex ?? 0; result.data[type] = result.data[type] ?? []; @@ -78,7 +85,7 @@ export function toIConnections(connections: Connection[]): IConnections { const result: IConnections = {}; for (const connection of connections) { - const type = connection.type ?? NodeConnectionType.Main; + const type = connection.type ?? NodeConnectionTypes.Main; const outputIndex = connection.outputIndex ?? 0; const inputIndex = connection.inputIndex ?? 0; diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts index 0f20896e21..f3652feacb 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts @@ -16,7 +16,7 @@ import type { IWaitingForExecution, IWaitingForExecutionSource, } from 'n8n-workflow'; -import { NodeConnectionType, type IPinData, type IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes, type IPinData, type IRunData } from 'n8n-workflow'; import { createNodeData, toITaskData } from './helpers'; import { DirectedGraph } from '../directed-graph'; @@ -516,7 +516,7 @@ describe('addWaitingExecution', () => { waitingExecution, nodeName1, 1, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 1, // inputIndex executionData, ); @@ -524,7 +524,7 @@ describe('addWaitingExecution', () => { [nodeName1]: { // runIndex 1: { - [NodeConnectionType.Main]: [undefined, executionData], + [NodeConnectionTypes.Main]: [undefined, executionData], }, }, }); @@ -536,7 +536,7 @@ describe('addWaitingExecution', () => { waitingExecution, nodeName1, 1, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 0, // inputIndex executionData, ); @@ -544,7 +544,7 @@ describe('addWaitingExecution', () => { [nodeName1]: { // runIndex 1: { - [NodeConnectionType.Main]: [executionData, executionData], + [NodeConnectionTypes.Main]: [executionData, executionData], }, }, }); @@ -556,7 +556,7 @@ describe('addWaitingExecution', () => { waitingExecution, nodeName1, 1, // runIndex - NodeConnectionType.AiMemory, + NodeConnectionTypes.AiMemory, 0, // inputIndex executionData, ); @@ -564,8 +564,8 @@ describe('addWaitingExecution', () => { [nodeName1]: { // runIndex 1: { - [NodeConnectionType.Main]: [executionData, executionData], - [NodeConnectionType.AiMemory]: [executionData], + [NodeConnectionTypes.Main]: [executionData, executionData], + [NodeConnectionTypes.AiMemory]: [executionData], }, }, }); @@ -577,7 +577,7 @@ describe('addWaitingExecution', () => { waitingExecution, nodeName1, 0, // runIndex - NodeConnectionType.AiChain, + NodeConnectionTypes.AiChain, 0, // inputIndex executionData, ); @@ -585,11 +585,11 @@ describe('addWaitingExecution', () => { [nodeName1]: { // runIndex 0: { - [NodeConnectionType.AiChain]: [executionData], + [NodeConnectionTypes.AiChain]: [executionData], }, 1: { - [NodeConnectionType.Main]: [executionData, executionData], - [NodeConnectionType.AiMemory]: [executionData], + [NodeConnectionTypes.Main]: [executionData, executionData], + [NodeConnectionTypes.AiMemory]: [executionData], }, }, }); @@ -601,7 +601,7 @@ describe('addWaitingExecution', () => { waitingExecution, nodeName2, 0, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 2, // inputIndex executionData, ); @@ -609,17 +609,17 @@ describe('addWaitingExecution', () => { [nodeName1]: { // runIndex 0: { - [NodeConnectionType.AiChain]: [executionData], + [NodeConnectionTypes.AiChain]: [executionData], }, 1: { - [NodeConnectionType.Main]: [executionData, executionData], - [NodeConnectionType.AiMemory]: [executionData], + [NodeConnectionTypes.Main]: [executionData, executionData], + [NodeConnectionTypes.AiMemory]: [executionData], }, }, [nodeName2]: { // runIndex 0: { - [NodeConnectionType.Main]: [undefined, undefined, executionData], + [NodeConnectionTypes.Main]: [undefined, undefined, executionData], }, }, }); @@ -631,7 +631,7 @@ describe('addWaitingExecution', () => { waitingExecution, nodeName2, 0, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 0, // inputIndex null, ); @@ -639,17 +639,17 @@ describe('addWaitingExecution', () => { [nodeName2]: { // runIndex 0: { - [NodeConnectionType.Main]: [null, undefined, executionData], + [NodeConnectionTypes.Main]: [null, undefined, executionData], }, }, [nodeName1]: { // runIndex 0: { - [NodeConnectionType.AiChain]: [executionData], + [NodeConnectionTypes.AiChain]: [executionData], }, 1: { - [NodeConnectionType.Main]: [executionData, executionData], - [NodeConnectionType.AiMemory]: [executionData], + [NodeConnectionTypes.Main]: [executionData, executionData], + [NodeConnectionTypes.AiMemory]: [executionData], }, }, }); @@ -674,7 +674,7 @@ describe('addWaitingExecutionSource', () => { waitingExecutionSource, nodeName1, 1, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 1, // inputIndex sourceData, ); @@ -682,7 +682,7 @@ describe('addWaitingExecutionSource', () => { [nodeName1]: { // runIndex 1: { - [NodeConnectionType.Main]: [undefined, sourceData], + [NodeConnectionTypes.Main]: [undefined, sourceData], }, }, }); @@ -694,7 +694,7 @@ describe('addWaitingExecutionSource', () => { waitingExecutionSource, nodeName1, 1, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 0, // inputIndex sourceData, ); @@ -702,7 +702,7 @@ describe('addWaitingExecutionSource', () => { [nodeName1]: { // runIndex 1: { - [NodeConnectionType.Main]: [sourceData, sourceData], + [NodeConnectionTypes.Main]: [sourceData, sourceData], }, }, }); @@ -714,7 +714,7 @@ describe('addWaitingExecutionSource', () => { waitingExecutionSource, nodeName1, 1, // runIndex - NodeConnectionType.AiMemory, + NodeConnectionTypes.AiMemory, 0, // inputIndex sourceData, ); @@ -722,8 +722,8 @@ describe('addWaitingExecutionSource', () => { [nodeName1]: { // runIndex 1: { - [NodeConnectionType.Main]: [sourceData, sourceData], - [NodeConnectionType.AiMemory]: [sourceData], + [NodeConnectionTypes.Main]: [sourceData, sourceData], + [NodeConnectionTypes.AiMemory]: [sourceData], }, }, }); @@ -735,7 +735,7 @@ describe('addWaitingExecutionSource', () => { waitingExecutionSource, nodeName1, 0, // runIndex - NodeConnectionType.AiChain, + NodeConnectionTypes.AiChain, 0, // inputIndex sourceData, ); @@ -743,11 +743,11 @@ describe('addWaitingExecutionSource', () => { [nodeName1]: { // runIndex 0: { - [NodeConnectionType.AiChain]: [sourceData], + [NodeConnectionTypes.AiChain]: [sourceData], }, 1: { - [NodeConnectionType.Main]: [sourceData, sourceData], - [NodeConnectionType.AiMemory]: [sourceData], + [NodeConnectionTypes.Main]: [sourceData, sourceData], + [NodeConnectionTypes.AiMemory]: [sourceData], }, }, }); @@ -759,7 +759,7 @@ describe('addWaitingExecutionSource', () => { waitingExecutionSource, nodeName2, 0, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 2, // inputIndex sourceData, ); @@ -767,17 +767,17 @@ describe('addWaitingExecutionSource', () => { [nodeName1]: { // runIndex 0: { - [NodeConnectionType.AiChain]: [sourceData], + [NodeConnectionTypes.AiChain]: [sourceData], }, 1: { - [NodeConnectionType.Main]: [sourceData, sourceData], - [NodeConnectionType.AiMemory]: [sourceData], + [NodeConnectionTypes.Main]: [sourceData, sourceData], + [NodeConnectionTypes.AiMemory]: [sourceData], }, }, [nodeName2]: { // runIndex 0: { - [NodeConnectionType.Main]: [undefined, undefined, sourceData], + [NodeConnectionTypes.Main]: [undefined, undefined, sourceData], }, }, }); @@ -789,7 +789,7 @@ describe('addWaitingExecutionSource', () => { waitingExecutionSource, nodeName2, 0, // runIndex - NodeConnectionType.Main, + NodeConnectionTypes.Main, 0, // inputIndex null, ); @@ -797,17 +797,17 @@ describe('addWaitingExecutionSource', () => { [nodeName1]: { // runIndex 0: { - [NodeConnectionType.AiChain]: [sourceData], + [NodeConnectionTypes.AiChain]: [sourceData], }, 1: { - [NodeConnectionType.Main]: [sourceData, sourceData], - [NodeConnectionType.AiMemory]: [sourceData], + [NodeConnectionTypes.Main]: [sourceData, sourceData], + [NodeConnectionTypes.AiMemory]: [sourceData], }, }, [nodeName2]: { // runIndex 0: { - [NodeConnectionType.Main]: [null, undefined, sourceData], + [NodeConnectionTypes.Main]: [null, undefined, sourceData], }, }, }); diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-iconnections.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-iconnections.test.ts index e5ea0e658a..9519df8dc6 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-iconnections.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-iconnections.test.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { createNodeData, toIConnections } from './helpers'; @@ -7,7 +7,7 @@ test('toIConnections', () => { const node2 = createNodeData({ name: 'Basic Node 2' }); expect( - toIConnections([{ from: node1, to: node2, type: NodeConnectionType.Main, outputIndex: 0 }]), + toIConnections([{ from: node1, to: node2, type: NodeConnectionTypes.Main, outputIndex: 0 }]), ).toEqual({ [node1.name]: { // output group @@ -17,7 +17,7 @@ test('toIConnections', () => { // first connection { node: node2.name, - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-itask-data.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-itask-data.test.ts index fe9c3f132a..13796bcd23 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-itask-data.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/to-itask-data.test.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { toITaskData } from './helpers'; @@ -25,7 +25,7 @@ test('toITaskData', function () { expect( toITaskData([ - { data: { value: 1 }, outputIndex: 1, nodeConnectionType: NodeConnectionType.AiAgent }, + { data: { value: 1 }, outputIndex: 1, nodeConnectionType: NodeConnectionTypes.AiAgent }, ]), ).toEqual({ executionStatus: 'success', @@ -33,7 +33,7 @@ test('toITaskData', function () { source: [], startTime: 0, data: { - [NodeConnectionType.AiAgent]: [null, [{ json: { value: 1 } }]], + [NodeConnectionTypes.AiAgent]: [null, [{ json: { value: 1 } }]], }, }); diff --git a/packages/core/src/execution-engine/partial-execution-utils/clean-run-data.ts b/packages/core/src/execution-engine/partial-execution-utils/clean-run-data.ts index c7d0551e94..33b9d32900 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/clean-run-data.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/clean-run-data.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType, type INode, type IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes, type INode, type IRunData } from 'n8n-workflow'; import type { DirectedGraph } from './directed-graph'; @@ -28,7 +28,7 @@ export function cleanRunData( for (const subNodeConnection of subNodeConnections) { // Sub nodes never use the Main connection type, so this filters out // the connection that goes upstream of the node to clean. - if (subNodeConnection.type === NodeConnectionType.Main) { + if (subNodeConnection.type === NodeConnectionTypes.Main) { continue; } diff --git a/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts b/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts index de4d55a6e7..d2302343ca 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts @@ -1,6 +1,6 @@ import * as a from 'assert'; -import type { IConnections, INode, WorkflowParameters } from 'n8n-workflow'; -import { NodeConnectionType, Workflow } from 'n8n-workflow'; +import type { IConnections, INode, WorkflowParameters, NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes, Workflow } from 'n8n-workflow'; export type GraphConnection = { from: INode; @@ -186,7 +186,7 @@ export class DirectedGraph { const connection: GraphConnection = { ...connectionInput, - type: connectionInput.type ?? NodeConnectionType.Main, + type: connectionInput.type ?? NodeConnectionTypes.Main, outputIndex: connectionInput.outputIndex ?? 0, inputIndex: connectionInput.inputIndex ?? 0, }; diff --git a/packages/core/src/execution-engine/partial-execution-utils/filter-disabled-nodes.ts b/packages/core/src/execution-engine/partial-execution-utils/filter-disabled-nodes.ts index af9ffb3512..50bff6619d 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/filter-disabled-nodes.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/filter-disabled-nodes.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { DirectedGraph } from './directed-graph'; @@ -9,7 +9,7 @@ export function filterDisabledNodes(graph: DirectedGraph): DirectedGraph { if (node.disabled) { filteredGraph.removeNode(node, { reconnectConnections: true, - skipConnectionFn: (c) => c.type !== NodeConnectionType.Main, + skipConnectionFn: (c) => c.type !== NodeConnectionTypes.Main, }); } } diff --git a/packages/core/src/execution-engine/partial-execution-utils/find-start-nodes.ts b/packages/core/src/execution-engine/partial-execution-utils/find-start-nodes.ts index a4aae17cdb..7b9a5f424f 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/find-start-nodes.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/find-start-nodes.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType, type INode, type IPinData, type IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes, type INode, type IPinData, type IRunData } from 'n8n-workflow'; import type { DirectedGraph } from './directed-graph'; import { getIncomingData, getIncomingDataFromAnyRun } from './get-incoming-data'; @@ -82,7 +82,7 @@ function findStartNodesRecursive( current.name, // last run -1, - NodeConnectionType.Main, + NodeConnectionTypes.Main, 0, ); diff --git a/packages/core/src/execution-engine/partial-execution-utils/find-subgraph.ts b/packages/core/src/execution-engine/partial-execution-utils/find-subgraph.ts index bbf5cd1e46..35781f237d 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/find-subgraph.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/find-subgraph.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType, type INode } from 'n8n-workflow'; +import { NodeConnectionTypes, type INode } from 'n8n-workflow'; import type { GraphConnection } from './directed-graph'; import { DirectedGraph } from './directed-graph'; @@ -57,7 +57,7 @@ function findSubgraphRecursive( // Skip parents that are connected via non-Main connection types. They are // only utility nodes for AI and are not part of the data or control flow // and can never lead too the trigger. - if (parentConnection.type !== NodeConnectionType.Main) { + if (parentConnection.type !== NodeConnectionTypes.Main) { continue; } @@ -107,7 +107,7 @@ export function findSubgraph(options: { const parentConnections = graph.getParentConnections(node); for (const connection of parentConnections) { - if (connection.type === NodeConnectionType.Main) { + if (connection.type === NodeConnectionTypes.Main) { continue; } diff --git a/packages/core/src/execution-engine/partial-execution-utils/recreate-node-execution-stack.ts b/packages/core/src/execution-engine/partial-execution-utils/recreate-node-execution-stack.ts index 95aced2515..40ea217e03 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/recreate-node-execution-stack.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/recreate-node-execution-stack.ts @@ -1,6 +1,7 @@ import * as a from 'assert/strict'; import { - NodeConnectionType, + NodeConnectionTypes, + type NodeConnectionType, type IExecuteData, type INode, type INodeExecutionData, @@ -99,7 +100,7 @@ export function recreateNodeExecutionStack( for (const startNode of startNodes) { const incomingStartNodeConnections = graph .getDirectParentConnections(startNode) - .filter((c) => c.type === NodeConnectionType.Main); + .filter((c) => c.type === NodeConnectionTypes.Main); let incomingData: INodeExecutionData[][] = []; let incomingSourceData: ITaskDataConnectionsSource | null = null; diff --git a/packages/core/src/execution-engine/routing-node.ts b/packages/core/src/execution-engine/routing-node.ts index e62bdfd34c..22944ff5e6 100644 --- a/packages/core/src/execution-engine/routing-node.ts +++ b/packages/core/src/execution-engine/routing-node.ts @@ -11,7 +11,7 @@ import { NodeApiError, NodeOperationError, sleep, - NodeConnectionType, + NodeConnectionTypes, } from 'n8n-workflow'; import type { ICredentialDataDecryptedObject, @@ -64,8 +64,8 @@ export class RoutingNode { } = context; const abortSignal = context.getExecutionCancelSignal(); - const items = (inputData[NodeConnectionType.Main] ?? - inputData[NodeConnectionType.AiTool])[0] as INodeExecutionData[]; + const items = (inputData[NodeConnectionTypes.Main] ?? + inputData[NodeConnectionTypes.AiTool])[0] as INodeExecutionData[]; const returnData: INodeExecutionData[] = []; let credentialDescription: INodeCredentialDescription | undefined; diff --git a/packages/core/src/execution-engine/workflow-execute.ts b/packages/core/src/execution-engine/workflow-execute.ts index 1d947390e6..244eb37ccf 100644 --- a/packages/core/src/execution-engine/workflow-execute.ts +++ b/packages/core/src/execution-engine/workflow-execute.ts @@ -44,7 +44,7 @@ import type { import { LoggerProxy as Logger, NodeHelpers, - NodeConnectionType, + NodeConnectionTypes, ApplicationError, sleep, ExecutionCancelledError, @@ -786,7 +786,7 @@ export class WorkflowExecute { // would mean that it has to get added to the list of nodes to process. const parentNodes = workflow.getParentNodes( inputData.node, - NodeConnectionType.Main, + NodeConnectionTypes.Main, -1, ); let nodeToAdd: string | undefined = inputData.node; @@ -889,7 +889,7 @@ export class WorkflowExecute { 'waitingExecution', connectionData.node, waitingNodeIndex!, - NodeConnectionType.Main, + NodeConnectionTypes.Main, ], null, ); @@ -2219,7 +2219,7 @@ export class WorkflowExecute { ); const outputs = NodeHelpers.getNodeOutputs(workflow, executionData.node, nodeType.description); const outputTypes = NodeHelpers.getConnectionTypes(outputs); - const mainOutputTypes = outputTypes.filter((output) => output === NodeConnectionType.Main); + const mainOutputTypes = outputTypes.filter((output) => output === NodeConnectionTypes.Main); const errorItems: INodeExecutionData[] = []; const closeFunctions: CloseFunction[] = []; @@ -2276,7 +2276,7 @@ export class WorkflowExecute { } else { const pairedItemInputIndex = pairedItemData.input || 0; - const sourceData = executionData.source[NodeConnectionType.Main][pairedItemInputIndex]; + const sourceData = executionData.source[NodeConnectionTypes.Main][pairedItemInputIndex]; const constPairedItem = dataProxy.$getPairedItem( sourceData!.previousNode, diff --git a/packages/core/test/helpers/constants.ts b/packages/core/test/helpers/constants.ts index e67caadd1e..6a7f28b1af 100644 --- a/packages/core/test/helpers/constants.ts +++ b/packages/core/test/helpers/constants.ts @@ -4,7 +4,7 @@ import type { INodeTypeData, WorkflowTestData, } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { If } from '../../../nodes-base/dist/nodes/If/If.node'; import { ManualTrigger } from '../../../nodes-base/dist/nodes/ManualTrigger/ManualTrigger.node'; @@ -56,8 +56,8 @@ export const predefinedNodesTypes: INodeTypeData = { name: 'Version Test', color: '#0000FF', }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: [NodeConnectionTypes.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: 'Display V1', @@ -115,8 +115,8 @@ export const predefinedNodesTypes: INodeTypeData = { name: 'Set', color: '#0000FF', }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: [NodeConnectionTypes.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: 'Value1', @@ -147,8 +147,8 @@ export const predefinedNodesTypes: INodeTypeData = { name: 'Set Multi', color: '#0000FF', }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: [NodeConnectionTypes.Main], + outputs: [NodeConnectionTypes.Main], properties: [ { displayName: 'Values', @@ -359,14 +359,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], [ { node: 'Merge6', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -377,7 +377,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge5', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -388,7 +388,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'NoOp2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -399,14 +399,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'IF4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -417,7 +417,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -428,14 +428,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -446,7 +446,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge7', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -457,7 +457,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge6', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -468,7 +468,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge5', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -479,7 +479,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -490,14 +490,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -508,17 +508,17 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'IF2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'IF3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -529,7 +529,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -710,7 +710,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -721,19 +721,19 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -744,7 +744,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -755,7 +755,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -766,12 +766,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -782,7 +782,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -793,17 +793,17 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -985,7 +985,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1063,12 +1063,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1079,7 +1079,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1251,12 +1251,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1267,7 +1267,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1278,7 +1278,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1289,7 +1289,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1300,7 +1300,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1311,7 +1311,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1322,12 +1322,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1338,17 +1338,17 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1529,7 +1529,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1540,14 +1540,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1558,12 +1558,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1574,7 +1574,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1733,7 +1733,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set0', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1744,7 +1744,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1755,7 +1755,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1766,7 +1766,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1777,7 +1777,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1788,7 +1788,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1908,7 +1908,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1919,14 +1919,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -1937,7 +1937,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -1948,7 +1948,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2054,7 +2054,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2065,7 +2065,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2076,19 +2076,19 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'NoOpTrue', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], [ { node: 'NoOpFalse', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2099,7 +2099,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2179,7 +2179,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'VersionTest1a', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2190,7 +2190,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'VersionTest1b', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2201,7 +2201,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'VersionTest2a', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2212,7 +2212,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'VersionTest2b', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2555,7 +2555,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2566,7 +2566,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2577,32 +2577,32 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait6', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait7', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait8', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait9', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2613,7 +2613,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2624,12 +2624,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -2640,12 +2640,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait10', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait11', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2656,7 +2656,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait5', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2667,7 +2667,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2678,7 +2678,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait13', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2689,7 +2689,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait12', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2700,7 +2700,7 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait14', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2711,12 +2711,12 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'IF1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2727,14 +2727,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait15', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Wait16', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2745,14 +2745,14 @@ export const legacyWorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait17', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Wait18', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2850,12 +2850,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -2866,7 +2866,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3044,12 +3044,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -3060,7 +3060,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3071,7 +3071,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3082,7 +3082,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3093,7 +3093,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -3104,7 +3104,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3115,12 +3115,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3131,17 +3131,17 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -3545,7 +3545,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3556,7 +3556,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3567,32 +3567,32 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait6', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait7', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait8', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait9', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3603,7 +3603,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3614,12 +3614,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -3630,12 +3630,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait10', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Wait11', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3646,7 +3646,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait5', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3657,7 +3657,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3668,7 +3668,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait13', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3679,7 +3679,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait12', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3690,7 +3690,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait14', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3701,12 +3701,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'IF1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3717,14 +3717,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait15', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Wait16', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3735,14 +3735,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Wait17', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Wait18', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3895,7 +3895,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3906,19 +3906,19 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3929,7 +3929,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -3940,7 +3940,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3951,12 +3951,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3967,7 +3967,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -3978,17 +3978,17 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4240,7 +4240,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4251,7 +4251,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4262,14 +4262,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'NoOp', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'NoOp1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4280,7 +4280,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4291,7 +4291,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4486,14 +4486,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], [ { node: 'Merge6', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4504,7 +4504,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge5', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4515,7 +4515,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'NoOp2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4526,14 +4526,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'IF4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4544,7 +4544,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4555,14 +4555,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Merge2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4573,7 +4573,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge7', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4584,7 +4584,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge6', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4595,7 +4595,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge5', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4606,7 +4606,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge4', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4617,14 +4617,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Merge1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4635,17 +4635,17 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'IF1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'IF2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'IF3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4656,7 +4656,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Set1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4920,12 +4920,12 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Edit Fields', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, { node: 'Edit Fields1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4936,7 +4936,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4947,7 +4947,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Merge', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 1, }, ], @@ -4958,7 +4958,7 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'If1', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], @@ -4969,14 +4969,14 @@ export const v1WorkflowExecuteTests: WorkflowTestData[] = [ [ { node: 'Edit Fields2', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], [ { node: 'Edit Fields3', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], diff --git a/packages/frontend/editor-ui/src/__tests__/data/canvas.ts b/packages/frontend/editor-ui/src/__tests__/data/canvas.ts index 08330730c3..ed7a6dc670 100644 --- a/packages/frontend/editor-ui/src/__tests__/data/canvas.ts +++ b/packages/frontend/editor-ui/src/__tests__/data/canvas.ts @@ -11,7 +11,8 @@ import type { ExecutionOutputMapData, } from '@/types'; import { CanvasConnectionMode, CanvasNodeRenderType } from '@/types'; -import { NodeConnectionType } from 'n8n-workflow'; +import type { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import type { GraphEdge, GraphNode, ViewportTransform } from '@vue-flow/core'; import type { EventBus } from '@n8n/utils/event-bus'; import { createEventBus } from '@n8n/utils/event-bus'; @@ -172,7 +173,7 @@ export function createCanvasNodeProvide({ export function createCanvasHandleProvide({ label = 'Handle', mode = CanvasConnectionMode.Input, - type = NodeConnectionType.Main, + type = NodeConnectionTypes.Main, index = 0, runData, isConnected = false, @@ -190,7 +191,9 @@ export function createCanvasHandleProvide({ isReadOnly?: boolean; isRequired?: boolean; } = {}) { - const maxConnections = [NodeConnectionType.Main, NodeConnectionType.AiTool].includes(type) + const maxConnections = ( + [NodeConnectionTypes.Main, NodeConnectionTypes.AiTool] as NodeConnectionType[] + ).includes(type) ? Infinity : 1; return { diff --git a/packages/frontend/editor-ui/src/__tests__/mocks.ts b/packages/frontend/editor-ui/src/__tests__/mocks.ts index 6db800e785..80e8de9fb6 100644 --- a/packages/frontend/editor-ui/src/__tests__/mocks.ts +++ b/packages/frontend/editor-ui/src/__tests__/mocks.ts @@ -11,7 +11,7 @@ import type { INodeTypeDescription, INodeIssues, } from 'n8n-workflow'; -import { NodeConnectionType, NodeHelpers, Workflow } from 'n8n-workflow'; +import { NodeConnectionTypes, NodeHelpers, Workflow } from 'n8n-workflow'; import { v4 as uuid } from 'uuid'; import { mock } from 'vitest-mock-extended'; @@ -52,8 +52,8 @@ export const mockNodeTypeDescription = ({ name = SET_NODE_TYPE, version = 1, credentials = [], - inputs = [NodeConnectionType.Main], - outputs = [NodeConnectionType.Main], + inputs = [NodeConnectionTypes.Main], + outputs = [NodeConnectionTypes.Main], codex = undefined, properties = [], }: { diff --git a/packages/frontend/editor-ui/src/components/CanvasChat/CanvasChat.test.ts b/packages/frontend/editor-ui/src/components/CanvasChat/CanvasChat.test.ts index f87ac93f00..5554006bf8 100644 --- a/packages/frontend/editor-ui/src/components/CanvasChat/CanvasChat.test.ts +++ b/packages/frontend/editor-ui/src/components/CanvasChat/CanvasChat.test.ts @@ -5,7 +5,7 @@ import { userEvent } from '@testing-library/user-event'; import { createRouter, createWebHistory } from 'vue-router'; import { computed, ref } from 'vue'; import type { INodeTypeDescription } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import CanvasChat from './CanvasChat.vue'; import { createComponentRenderer } from '@/__tests__/render'; @@ -77,8 +77,8 @@ const mockNodeTypes: INodeTypeDescription[] = [ defaults: { name: 'AI Agent', }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: [NodeConnectionTypes.Main], + outputs: [NodeConnectionTypes.Main], version: 0, group: [], description: '', @@ -96,7 +96,7 @@ const mockConnections = { [ { node: 'AI Agent', - type: NodeConnectionType.Main, + type: NodeConnectionTypes.Main, index: 0, }, ], diff --git a/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts b/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts index e30d4e4adb..128a82fdfb 100644 --- a/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts +++ b/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts @@ -2,7 +2,7 @@ import type { ComputedRef, Ref } from 'vue'; import { computed, ref } from 'vue'; import { v4 as uuid } from 'uuid'; import type { ChatMessage, ChatMessageText } from '@n8n/chat/types'; -import { NodeConnectionType, CHAT_TRIGGER_NODE_TYPE } from 'n8n-workflow'; +import { NodeConnectionTypes, CHAT_TRIGGER_NODE_TYPE } from 'n8n-workflow'; import type { ITaskData, INodeExecutionData, @@ -252,7 +252,7 @@ export function useChatMessaging({ const connectedMemoryInputs = workflow.value.connectionsByDestinationNode?.[connectedNode.value.name]?.[ - NodeConnectionType.AiMemory + NodeConnectionTypes.AiMemory ]; if (!connectedMemoryInputs) return []; @@ -263,7 +263,9 @@ export function useChatMessaging({ const nodeResultData = getWorkflowResultDataByNodeName(memoryConnection.node); const memoryOutputData = (nodeResultData ?? []) - .map((data) => get(data, ['data', NodeConnectionType.AiMemory, 0, 0, 'json']) as MemoryOutput) + .map( + (data) => get(data, ['data', NodeConnectionTypes.AiMemory, 0, 0, 'json']) as MemoryOutput, + ) .find((data) => data && data.action === 'saveContext'); return (memoryOutputData?.chatHistory ?? []).map((message, index) => { diff --git a/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatTrigger.ts b/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatTrigger.ts index 7d0cff0d8d..d0d86b0a00 100644 --- a/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatTrigger.ts +++ b/packages/frontend/editor-ui/src/components/CanvasChat/composables/useChatTrigger.ts @@ -2,7 +2,7 @@ import type { ComputedRef, MaybeRef } from 'vue'; import { ref, computed, unref } from 'vue'; import { CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE, - NodeConnectionType, + NodeConnectionTypes, NodeHelpers, } from 'n8n-workflow'; import type { INodeTypeDescription, Workflow, INode, INodeParameters } from 'n8n-workflow'; @@ -103,9 +103,9 @@ export function useChatTrigger({ // Validate if node has required AI connection types if ( - inputTypes.includes(NodeConnectionType.AiLanguageModel) && - inputTypes.includes(NodeConnectionType.Main) && - outputTypes.includes(NodeConnectionType.Main) + inputTypes.includes(NodeConnectionTypes.AiLanguageModel) && + inputTypes.includes(NodeConnectionTypes.Main) && + outputTypes.includes(NodeConnectionTypes.Main) ) { isCustomChainOrAgent = true; } diff --git a/packages/frontend/editor-ui/src/components/ExpressionEditModal.vue b/packages/frontend/editor-ui/src/components/ExpressionEditModal.vue index f6a5155857..517acf4e0d 100644 --- a/packages/frontend/editor-ui/src/components/ExpressionEditModal.vue +++ b/packages/frontend/editor-ui/src/components/ExpressionEditModal.vue @@ -11,7 +11,7 @@ import { createExpressionTelemetryPayload } from '@/utils/telemetryUtils'; import { useTelemetry } from '@/composables/useTelemetry'; import type { Segment } from '@/types/expressions'; import type { INodeProperties } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { outputTheme } from './ExpressionEditorModal/theme'; import ExpressionOutput from './InlineExpressionEditor/ExpressionOutput.vue'; import VirtualSchema from '@/components/VirtualSchema.vue'; @@ -172,7 +172,7 @@ const onResizeThrottle = useThrottleFn(onResize, 10); :search="appliedSearch" :nodes="parentNodes" :mapping-enabled="!isReadOnly" - :connection-type="NodeConnectionType.Main" + :connection-type="NodeConnectionTypes.Main" pane-type="input" /> diff --git a/packages/frontend/editor-ui/src/components/InputPanel.test.ts b/packages/frontend/editor-ui/src/components/InputPanel.test.ts index a6c27abe8b..7211df548c 100644 --- a/packages/frontend/editor-ui/src/components/InputPanel.test.ts +++ b/packages/frontend/editor-ui/src/components/InputPanel.test.ts @@ -6,7 +6,7 @@ import { useWorkflowsStore } from '@/stores/workflows.store'; import { createTestingPinia } from '@pinia/testing'; import { waitFor } from '@testing-library/vue'; import { - NodeConnectionType, + NodeConnectionTypes, type IConnections, type INodeExecutionData, type IRunData, @@ -32,18 +32,18 @@ const nodes = [ const render = (props: Partial = {}, pinData?: INodeExecutionData[], runData?: IRunData) => { const connections: IConnections = { [nodes[0].name]: { - [NodeConnectionType.Main]: [ - [{ node: nodes[1].name, type: NodeConnectionType.Main, index: 0 }], + [NodeConnectionTypes.Main]: [ + [{ node: nodes[1].name, type: NodeConnectionTypes.Main, index: 0 }], ], }, [nodes[1].name]: { - [NodeConnectionType.Main]: [ - [{ node: nodes[2].name, type: NodeConnectionType.Main, index: 0 }], + [NodeConnectionTypes.Main]: [ + [{ node: nodes[2].name, type: NodeConnectionTypes.Main, index: 0 }], ], }, [nodes[3].name]: { - [NodeConnectionType.AiMemory]: [ - [{ node: nodes[2].name, type: NodeConnectionType.AiMemory, index: 0 }], + [NodeConnectionTypes.AiMemory]: [ + [{ node: nodes[2].name, type: NodeConnectionTypes.AiMemory, index: 0 }], ], }, }; diff --git a/packages/frontend/editor-ui/src/components/InputPanel.vue b/packages/frontend/editor-ui/src/components/InputPanel.vue index 436e4608bc..5ad70f4e3d 100644 --- a/packages/frontend/editor-ui/src/components/InputPanel.vue +++ b/packages/frontend/editor-ui/src/components/InputPanel.vue @@ -14,7 +14,7 @@ import { waitingNodeTooltip } from '@/utils/executionUtils'; import { uniqBy } from 'lodash-es'; import { N8nIcon, N8nRadioButtons, N8nText, N8nTooltip } from '@n8n/design-system'; import type { INodeInputConfiguration, INodeOutputConfiguration, Workflow } from 'n8n-workflow'; -import { NodeConnectionType, NodeHelpers } from 'n8n-workflow'; +import { type NodeConnectionType, NodeConnectionTypes, NodeHelpers } from 'n8n-workflow'; import { storeToRefs } from 'pinia'; import { computed, ref, watch } from 'vue'; import { useNDVStore } from '../stores/ndv.store'; @@ -143,8 +143,8 @@ const isActiveNodeConfig = computed(() => { return ( inputs.length === 0 || - (inputs.every((input) => filterOutConnectionType(input, NodeConnectionType.Main)) && - outputs.find((output) => filterOutConnectionType(output, NodeConnectionType.Main))) + (inputs.every((input) => filterOutConnectionType(input, NodeConnectionTypes.Main)) && + outputs.find((output) => filterOutConnectionType(output, NodeConnectionTypes.Main))) ); }); diff --git a/packages/frontend/editor-ui/src/components/NDVFloatingNodes.vue b/packages/frontend/editor-ui/src/components/NDVFloatingNodes.vue index 399588c912..0265bdb955 100644 --- a/packages/frontend/editor-ui/src/components/NDVFloatingNodes.vue +++ b/packages/frontend/editor-ui/src/components/NDVFloatingNodes.vue @@ -4,7 +4,7 @@ import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { computed, onMounted, onBeforeUnmount } from 'vue'; import NodeIcon from '@/components/NodeIcon.vue'; -import { NodeConnectionType, type INodeTypeDescription } from 'n8n-workflow'; +import { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow'; interface Props { rootNode: INodeUi; @@ -72,10 +72,10 @@ const connectedNodes = computed< workflow.getChildNodes(rootName, 'ALL_NON_MAIN'), ), [FloatingNodePosition.right]: getINodesFromNames( - workflow.getChildNodes(rootName, NodeConnectionType.Main, 1), + workflow.getChildNodes(rootName, NodeConnectionTypes.Main, 1), ).reverse(), [FloatingNodePosition.left]: getINodesFromNames( - workflow.getParentNodes(rootName, NodeConnectionType.Main, 1), + workflow.getParentNodes(rootName, NodeConnectionTypes.Main, 1), ), }; }); diff --git a/packages/frontend/editor-ui/src/components/NDVSubConnections.test.ts b/packages/frontend/editor-ui/src/components/NDVSubConnections.test.ts index c269e8e7f1..d557c766eb 100644 --- a/packages/frontend/editor-ui/src/components/NDVSubConnections.test.ts +++ b/packages/frontend/editor-ui/src/components/NDVSubConnections.test.ts @@ -4,17 +4,17 @@ import { setActivePinia } from 'pinia'; import { createTestingPinia } from '@pinia/testing'; import type { INodeUi } from '@/Interface'; import type { INodeTypeDescription, WorkflowParameters } from 'n8n-workflow'; -import { NodeConnectionType, Workflow } from 'n8n-workflow'; +import { NodeConnectionTypes, Workflow } from 'n8n-workflow'; const nodeType: INodeTypeDescription = { displayName: 'OpenAI', name: '@n8n/n8n-nodes-langchain.openAi', version: [1], inputs: [ - { type: NodeConnectionType.Main }, - { type: NodeConnectionType.AiTool, displayName: 'Tools' }, + { type: NodeConnectionTypes.Main }, + { type: NodeConnectionTypes.AiTool, displayName: 'Tools' }, ], - outputs: [NodeConnectionType.Main], + outputs: [NodeConnectionTypes.Main], credentials: [ { name: 'openAiApi', diff --git a/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts b/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts index e92097bbdd..c7014f3f69 100644 --- a/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts +++ b/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts @@ -1,7 +1,7 @@ import { computed } from 'vue'; import { CHAIN_LLM_LANGCHAIN_NODE_TYPE, - NodeConnectionType, + NodeConnectionTypes, type IDataObject, type INodeParameters, } from 'n8n-workflow'; @@ -249,7 +249,7 @@ export const useActions = () => { if (shouldPrependLLMChain(addedNodes)) { addedNodes.unshift({ type: CHAIN_LLM_LANGCHAIN_NODE_TYPE, isAutoAdd: true }); connections.push({ - from: { nodeIndex: 2, type: NodeConnectionType.AiLanguageModel }, + from: { nodeIndex: 2, type: NodeConnectionTypes.AiLanguageModel }, to: { nodeIndex: 1 }, }); } diff --git a/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts b/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts index 679fd05284..63db6efc22 100644 --- a/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts +++ b/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts @@ -1,4 +1,4 @@ -import { NodeConnectionType, type INodeProperties, type INodeTypeDescription } from 'n8n-workflow'; +import { NodeConnectionTypes, type INodeProperties, type INodeTypeDescription } from 'n8n-workflow'; import { useActionsGenerator } from './composables/useActionsGeneration'; describe('useActionsGenerator', () => { @@ -14,8 +14,8 @@ describe('useActionsGenerator', () => { defaults: { name: 'Test', }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: [NodeConnectionTypes.Main], + outputs: [NodeConnectionTypes.Main], properties: [], }; diff --git a/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts b/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts index 6e718a7fc2..21c255cd62 100644 --- a/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts +++ b/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts @@ -62,7 +62,8 @@ import { useI18n } from '@/composables/useI18n'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import type { SimplifiedNodeType } from '@/Interface'; import type { INodeTypeDescription, Themed } from 'n8n-workflow'; -import { NodeConnectionType } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; +import type { NodeConnectionType } from 'n8n-workflow'; import { useTemplatesStore } from '@/stores/templates.store'; import type { BaseTextKey } from '@/plugins/i18n'; import { camelCase } from 'lodash-es'; @@ -219,7 +220,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_DOCUMENT_LOADERS, info: getSubcategoryInfo(AI_CATEGORY_DOCUMENT_LOADERS), icon: 'file-import', - ...getAISubcategoryProperties(NodeConnectionType.AiDocument), + ...getAISubcategoryProperties(NodeConnectionTypes.AiDocument), }, }, { @@ -229,7 +230,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_LANGUAGE_MODELS, info: getSubcategoryInfo(AI_CATEGORY_LANGUAGE_MODELS), icon: 'language', - ...getAISubcategoryProperties(NodeConnectionType.AiLanguageModel), + ...getAISubcategoryProperties(NodeConnectionTypes.AiLanguageModel), }, }, { @@ -239,7 +240,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_MEMORY, info: getSubcategoryInfo(AI_CATEGORY_MEMORY), icon: 'brain', - ...getAISubcategoryProperties(NodeConnectionType.AiMemory), + ...getAISubcategoryProperties(NodeConnectionTypes.AiMemory), }, }, { @@ -249,7 +250,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_OUTPUTPARSER, info: getSubcategoryInfo(AI_CATEGORY_OUTPUTPARSER), icon: 'list', - ...getAISubcategoryProperties(NodeConnectionType.AiOutputParser), + ...getAISubcategoryProperties(NodeConnectionTypes.AiOutputParser), }, }, { @@ -259,7 +260,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_RETRIEVERS, info: getSubcategoryInfo(AI_CATEGORY_RETRIEVERS), icon: 'search', - ...getAISubcategoryProperties(NodeConnectionType.AiRetriever), + ...getAISubcategoryProperties(NodeConnectionTypes.AiRetriever), }, }, { @@ -269,7 +270,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_TEXT_SPLITTERS, info: getSubcategoryInfo(AI_CATEGORY_TEXT_SPLITTERS), icon: 'grip-lines-vertical', - ...getAISubcategoryProperties(NodeConnectionType.AiTextSplitter), + ...getAISubcategoryProperties(NodeConnectionTypes.AiTextSplitter), }, }, { @@ -280,7 +281,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_TOOLS, info: getSubcategoryInfo(AI_CATEGORY_TOOLS), icon: 'tools', - ...getAISubcategoryProperties(NodeConnectionType.AiTool), + ...getAISubcategoryProperties(NodeConnectionTypes.AiTool), sections: [ { key: 'popular', @@ -297,7 +298,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_EMBEDDING, info: getSubcategoryInfo(AI_CATEGORY_EMBEDDING), icon: 'vector-square', - ...getAISubcategoryProperties(NodeConnectionType.AiEmbedding), + ...getAISubcategoryProperties(NodeConnectionTypes.AiEmbedding), }, }, { @@ -307,7 +308,7 @@ export function AINodesView(_nodes: SimplifiedNodeType[]): NodeView { title: AI_CATEGORY_VECTOR_STORES, info: getSubcategoryInfo(AI_CATEGORY_VECTOR_STORES), icon: 'project-diagram', - ...getAISubcategoryProperties(NodeConnectionType.AiVectorStore), + ...getAISubcategoryProperties(NodeConnectionTypes.AiVectorStore), }, }, { diff --git a/packages/frontend/editor-ui/src/components/NodeDetailsView.vue b/packages/frontend/editor-ui/src/components/NodeDetailsView.vue index 6add05c56f..d924b98486 100644 --- a/packages/frontend/editor-ui/src/components/NodeDetailsView.vue +++ b/packages/frontend/editor-ui/src/components/NodeDetailsView.vue @@ -1,8 +1,8 @@