fix(Split In Batches Node): Fix issue with pairedItem (#4873)

fix(SplitInBatches Node): Fix issue with pairedItem
This commit is contained in:
Jan Oberhauser
2022-12-09 13:39:06 +01:00
committed by GitHub
parent 19e0e96271
commit 38d7300d2a
4 changed files with 73 additions and 9 deletions

View File

@@ -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 {

View File

@@ -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) {