From 236fceea5f0c8e473e683f990f972e8c056a8085 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Mon, 29 Jul 2024 13:16:12 +0300 Subject: [PATCH 1/2] fix --- packages/editor-ui/src/composables/useNodeHelpers.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/editor-ui/src/composables/useNodeHelpers.ts b/packages/editor-ui/src/composables/useNodeHelpers.ts index 00f18041b0225..9525934c66627 100644 --- a/packages/editor-ui/src/composables/useNodeHelpers.ts +++ b/packages/editor-ui/src/composables/useNodeHelpers.ts @@ -8,6 +8,7 @@ import { FORM_TRIGGER_NODE_TYPE, NODE_OUTPUT_DEFAULT_KEY, PLACEHOLDER_FILLED_AT_EXECUTION_TIME, + SPLIT_IN_BATCHES_NODE_TYPE, WEBHOOK_NODE_TYPE, } from '@/constants'; @@ -597,6 +598,10 @@ export function useNodeHelpers() { return []; } + if (node?.type === SPLIT_IN_BATCHES_NODE_TYPE) { + outputIndex = 0; + } + return getInputData(data, outputIndex, connectionType); } From ead29c366a5431cf872fa4d5f0682b2e5e34f87c Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Wed, 31 Jul 2024 15:20:54 +0300 Subject: [PATCH 2/2] update --- .../editor-ui/src/composables/useNodeHelpers.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/composables/useNodeHelpers.ts b/packages/editor-ui/src/composables/useNodeHelpers.ts index 7dbf362390f58..a8c763b11f5a2 100644 --- a/packages/editor-ui/src/composables/useNodeHelpers.ts +++ b/packages/editor-ui/src/composables/useNodeHelpers.ts @@ -572,6 +572,16 @@ export function useNodeHelpers() { paneType: NodePanelType = 'output', connectionType: ConnectionTypes = NodeConnectionType.Main, ): INodeExecutionData[] { + //TODO: check if this needs to be fixed in different place + if ( + node?.type === SPLIT_IN_BATCHES_NODE_TYPE && + paneType === 'input' && + runIndex !== 0 && + outputIndex !== 0 + ) { + runIndex = runIndex - 1; + } + if (node === null) { return []; } @@ -600,10 +610,6 @@ export function useNodeHelpers() { return []; } - if (node?.type === SPLIT_IN_BATCHES_NODE_TYPE) { - outputIndex = 0; - } - return getInputData(data, outputIndex, connectionType); }