diff --git a/src/store/utils/connectedInputs.ts b/src/store/utils/connectedInputs.ts index d5250e21..563699a1 100644 --- a/src/store/utils/connectedInputs.ts +++ b/src/store/utils/connectedInputs.ts @@ -229,7 +229,8 @@ export function getConnectedInputsPure( if (dimmedNodeIds && dimmedNodeIds.has(sourceNode.id)) return; // Array batch mode — send all items as textItems instead of a single item - if (sourceNode.type === "array" && (edge.data as Record | undefined)?.arrayBatchAll === true) { + // Derive from source node's current batchMode (not edge metadata which can go stale) + if (sourceNode.type === "array" && (sourceNode.data as ArrayNodeData).batchMode === true) { const arrayData = sourceNode.data as ArrayNodeData; const items = arrayData.outputItems; if (items.length > 0) { diff --git a/src/store/workflowStore.ts b/src/store/workflowStore.ts index a76508cf..5ec2c5d3 100644 --- a/src/store/workflowStore.ts +++ b/src/store/workflowStore.ts @@ -146,11 +146,8 @@ function buildConnectionEdgeData( if (sourceNode?.type === "array" && (connection.sourceHandle || "text") === "text") { const sourceData = sourceNode.data as Record; - // Batch mode: all items sent through a single connection - if (sourceData.batchMode === true) { - baseData.arrayBatchAll = true; - return baseData; - } + // Batch mode is now derived dynamically in connectedInputs.ts from + // the source node's batchMode — no need to stamp edge metadata. const selectedIndex = sourceData.selectedOutputIndex; const outputItems = Array.isArray(sourceData.outputItems) ? sourceData.outputItems : [];