Add "Execute Once" node-setting

This commit is contained in:
Jan Oberhauser
2020-08-08 20:31:04 +02:00
parent 4c275513b4
commit da0ef0d94c
3 changed files with 28 additions and 1 deletions

View File

@@ -1128,6 +1128,18 @@ export class Workflow {
throw error;
}
if (node.executeOnce === true) {
// If node should be executed only use only the first input item
connectionInputData = connectionInputData.slice(0, 1);
const newInputData: ITaskDataConnections = {};
for (const inputName of Object.keys(inputData)) {
newInputData[inputName] = inputData[inputName].map(input => {
return input && input.slice(0, 1);
});
}
inputData = newInputData;
}
if (nodeType.executeSingle) {
const returnPromises: Array<Promise<INodeExecutionData>> = [];