mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Split In Batches Node): Fix issue with pairedItem (#4873)
fix(SplitInBatches Node): Fix issue with pairedItem
This commit is contained in:
@@ -619,6 +619,7 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn & {
|
||||
getContext(type: string): IContextObject;
|
||||
getCredentials(type: string, itemIndex?: number): Promise<ICredentialDataDecryptedObject>;
|
||||
getInputData(inputIndex?: number, inputName?: string): INodeExecutionData[];
|
||||
getInputSourceData(inputIndex?: number, inputName?: string): ISourceData;
|
||||
getMode(): WorkflowExecuteMode;
|
||||
getNode(): INode;
|
||||
getWorkflowDataProxy(itemIndex: number): IWorkflowDataProxyData;
|
||||
@@ -654,6 +655,7 @@ export interface IExecuteSingleFunctions {
|
||||
getContext(type: string): IContextObject;
|
||||
getCredentials(type: string): Promise<ICredentialDataDecryptedObject>;
|
||||
getInputData(inputIndex?: number, inputName?: string): INodeExecutionData;
|
||||
getInputSourceData(inputIndex?: number, inputName?: string): ISourceData;
|
||||
getItemIndex(): number;
|
||||
getMode(): WorkflowExecuteMode;
|
||||
getNode(): INode;
|
||||
@@ -926,6 +928,7 @@ export interface IBinaryKeyData {
|
||||
export interface IPairedItemData {
|
||||
item: number;
|
||||
input?: number; // If undefined "0" gets used
|
||||
sourceOverwrite?: ISourceData;
|
||||
}
|
||||
|
||||
export interface INodeExecutionData {
|
||||
|
||||
@@ -710,6 +710,10 @@ export class WorkflowDataProxy {
|
||||
|
||||
let sourceData: ISourceData | null = incomingSourceData;
|
||||
|
||||
if (pairedItem.sourceOverwrite) {
|
||||
sourceData = pairedItem.sourceOverwrite;
|
||||
}
|
||||
|
||||
if (typeof pairedItem === 'number') {
|
||||
pairedItem = {
|
||||
item: pairedItem,
|
||||
@@ -871,6 +875,10 @@ export class WorkflowDataProxy {
|
||||
|
||||
nodeBeforeLast = sourceData.previousNode;
|
||||
sourceData = taskData.source[pairedItem.input || 0] || null;
|
||||
|
||||
if (pairedItem.sourceOverwrite) {
|
||||
sourceData = pairedItem.sourceOverwrite;
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceData === null) {
|
||||
|
||||
Reference in New Issue
Block a user