mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Merge Node): Overhaul, v3 (#9528)
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com> Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,7 @@ export const EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE = 'n8n-nodes-base.executeWorkflo
|
||||
export const CODE_NODE_TYPE = 'n8n-nodes-base.code';
|
||||
export const FUNCTION_NODE_TYPE = 'n8n-nodes-base.function';
|
||||
export const FUNCTION_ITEM_NODE_TYPE = 'n8n-nodes-base.functionItem';
|
||||
export const MERGE_NODE_TYPE = 'n8n-nodes-base.merge';
|
||||
|
||||
export const STARTING_NODE_TYPES = [
|
||||
MANUAL_TRIGGER_NODE_TYPE,
|
||||
|
||||
@@ -876,6 +876,7 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
|
||||
inputIndex?: number,
|
||||
): Promise<unknown>;
|
||||
getInputData(inputIndex?: number, inputName?: string): INodeExecutionData[];
|
||||
getNodeInputs(): INodeInputConfiguration[];
|
||||
getNodeOutputs(): INodeOutputConfiguration[];
|
||||
putExecutionToWait(waitTill: Date): Promise<void>;
|
||||
sendMessageToUI(message: any): void;
|
||||
@@ -1760,11 +1761,12 @@ export interface INodeInputFilter {
|
||||
}
|
||||
|
||||
export interface INodeInputConfiguration {
|
||||
category?: string;
|
||||
displayName?: string;
|
||||
maxConnections?: number;
|
||||
required?: boolean;
|
||||
filter?: INodeInputFilter;
|
||||
type: ConnectionTypes;
|
||||
filter?: INodeInputFilter;
|
||||
maxConnections?: number;
|
||||
}
|
||||
|
||||
export interface INodeOutputConfiguration {
|
||||
@@ -2320,6 +2322,7 @@ export interface INodeGraphItem {
|
||||
agent?: string; //@n8n/n8n-nodes-langchain.agent
|
||||
prompts?: IDataObject[] | IDataObject; //ai node's prompts, cloud only
|
||||
toolSettings?: IDataObject; //various langchain tool's settings
|
||||
sql?: string; //merge node combineBySql, cloud only
|
||||
}
|
||||
|
||||
export interface INodeNameIndex {
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
HTTP_REQUEST_NODE_TYPE,
|
||||
HTTP_REQUEST_TOOL_LANGCHAIN_NODE_TYPE,
|
||||
LANGCHAIN_CUSTOM_TOOLS,
|
||||
MERGE_NODE_TYPE,
|
||||
OPENAI_LANGCHAIN_NODE_TYPE,
|
||||
STICKY_NODE_TYPE,
|
||||
WEBHOOK_NODE_TYPE,
|
||||
@@ -206,6 +207,8 @@ export function generateNodesGraph(
|
||||
|
||||
if (node.type === AGENT_LANGCHAIN_NODE_TYPE) {
|
||||
nodeItem.agent = (node.parameters.agent as string) ?? 'conversationalAgent';
|
||||
} else if (node.type === MERGE_NODE_TYPE) {
|
||||
nodeItem.operation = node.parameters.mode as string;
|
||||
} else if (node.type === HTTP_REQUEST_NODE_TYPE && node.typeVersion === 1) {
|
||||
try {
|
||||
nodeItem.domain = new URL(node.parameters.url as string).hostname;
|
||||
@@ -398,6 +401,10 @@ export function generateNodesGraph(
|
||||
nodeItem.prompts =
|
||||
(((node.parameters?.messages as IDataObject) ?? {}).messageValues as IDataObject[]) ?? [];
|
||||
}
|
||||
|
||||
if (node.type === MERGE_NODE_TYPE && node.parameters?.operation === 'combineBySql') {
|
||||
nodeItem.sql = node.parameters?.query as string;
|
||||
}
|
||||
}
|
||||
|
||||
nodeGraph.nodes[index.toString()] = nodeItem;
|
||||
|
||||
Reference in New Issue
Block a user