mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
✨ Add "Execute Once" node-setting
This commit is contained in:
@@ -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>> = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user