mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Remove executeSingle (no-changelog) (#4853)
This commit is contained in:
committed by
GitHub
parent
3db2707b8e
commit
9194d8bb0e
@@ -1228,7 +1228,6 @@ export interface INodeType {
|
||||
execute?(
|
||||
this: IExecuteFunctions,
|
||||
): Promise<INodeExecutionData[][] | NodeExecutionWithMetadata[][] | null>;
|
||||
executeSingle?(this: IExecuteSingleFunctions): Promise<INodeExecutionData>;
|
||||
poll?(this: IPollFunctions): Promise<INodeExecutionData[][] | null>;
|
||||
trigger?(this: ITriggerFunctions): Promise<ITriggerResponse | undefined>;
|
||||
webhook?(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
||||
|
||||
@@ -1181,17 +1181,13 @@ export class Workflow {
|
||||
}
|
||||
|
||||
let connectionInputData: INodeExecutionData[] = [];
|
||||
if (
|
||||
nodeType.execute ||
|
||||
nodeType.executeSingle ||
|
||||
(!nodeType.poll && !nodeType.trigger && !nodeType.webhook)
|
||||
) {
|
||||
// Only stop if first input is empty for execute & executeSingle runs. For all others run anyways
|
||||
if (nodeType.execute || (!nodeType.poll && !nodeType.trigger && !nodeType.webhook)) {
|
||||
// Only stop if first input is empty for execute runs. For all others run anyways
|
||||
// because then it is a trigger node. As they only pass data through and so the input-data
|
||||
// becomes output-data it has to be possible.
|
||||
|
||||
if (inputData.hasOwnProperty('main') && inputData.main.length > 0) {
|
||||
// We always use the data of main input and the first input for executeSingle
|
||||
// We always use the data of main input and the first input for execute
|
||||
connectionInputData = inputData.main[0] as INodeExecutionData[];
|
||||
}
|
||||
|
||||
@@ -1226,35 +1222,7 @@ export class Workflow {
|
||||
inputData = newInputData;
|
||||
}
|
||||
|
||||
if (nodeType.executeSingle) {
|
||||
const returnPromises: Array<Promise<INodeExecutionData>> = [];
|
||||
|
||||
for (let itemIndex = 0; itemIndex < connectionInputData.length; itemIndex++) {
|
||||
const thisArgs = nodeExecuteFunctions.getExecuteSingleFunctions(
|
||||
this,
|
||||
runExecutionData,
|
||||
runIndex,
|
||||
connectionInputData,
|
||||
inputData,
|
||||
node,
|
||||
itemIndex,
|
||||
additionalData,
|
||||
executionData,
|
||||
mode,
|
||||
);
|
||||
|
||||
returnPromises.push(nodeType.executeSingle.call(thisArgs));
|
||||
}
|
||||
|
||||
if (returnPromises.length === 0) {
|
||||
return { data: null };
|
||||
}
|
||||
|
||||
const promiseResults = await Promise.all(returnPromises);
|
||||
if (promiseResults) {
|
||||
return { data: [promiseResults] };
|
||||
}
|
||||
} else if (nodeType.execute) {
|
||||
if (nodeType.execute) {
|
||||
const thisArgs = nodeExecuteFunctions.getExecuteFunctions(
|
||||
this,
|
||||
runExecutionData,
|
||||
|
||||
Reference in New Issue
Block a user