feat(Execute Workflow Node): Run once for each item mode (#7289)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Michael Kret
2023-10-06 18:04:33 +03:00
committed by GitHub
parent 597669aa62
commit c8c14ca0af
3 changed files with 152 additions and 57 deletions

View File

@@ -3,6 +3,7 @@ import type {
IDisplayOptions,
INodeExecutionData,
INodeProperties,
IPairedItemData,
} from 'n8n-workflow';
import { jsonParse } from 'n8n-workflow';
@@ -291,3 +292,14 @@ export function flattenObject(data: IDataObject) {
}
return returnData;
}
/**
* Generate Paired Item Data by length of input array
*
* @param {number} length
*/
export function generatePairedItemData(length: number): IPairedItemData[] {
return Array.from({ length }, (_, item) => ({
item,
}));
}