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

@@ -39,6 +39,7 @@ import {
IOAuth2Options,
IPollFunctions,
IRunExecutionData,
ISourceData,
ITaskDataConnections,
ITriggerFunctions,
IWebhookData,
@@ -2320,6 +2321,13 @@ export function getExecuteFunctions(
return inputData[inputName][inputIndex] as INodeExecutionData[];
},
getInputSourceData: (inputIndex = 0, inputName = 'main') => {
if (executeData?.source === null) {
// Should never happen as n8n sets it automatically
throw new Error('Source data is missing!');
}
return executeData.source[inputName][inputIndex];
},
getNodeParameter: (
parameterName: string,
itemIndex: number,
@@ -2580,6 +2588,13 @@ export function getExecuteSingleFunctions(
return allItems[itemIndex];
},
getInputSourceData: (inputIndex = 0, inputName = 'main') => {
if (executeData?.source === null) {
// Should never happen as n8n sets it automatically
throw new Error('Source data is missing!');
}
return executeData.source[inputName][inputIndex] as ISourceData;
},
getItemIndex() {
return itemIndex;
},