You need to execute the same workflow multiple times with just 1 changing parameters? You need to go through a list of values and process them step by step?
Then you can simulate a classic “for” loop with the
Create a first
Test activity is then setup as follow (equivalent):
- Label: End of loop? - Conditions - Label Yes: vars.index >= vars.indexMax - Default branching - Use Default connection: No
In the loop, you can use the array anytime with
var current = JSON.parse(vars.array)[vars.index]; logInfo('Current index: '+vars.index+', current value: '+current);
End of loop
At the end of the loop, a simple
vars.index++; gets the job done!
Workflow 'WKF999' is being run Workflow restarted (operator 'Florian Courgey') js3 Current index: 0, current value: France js3 Current index: 1, current value: Spain js3 Current index: 2, current value: UK Workflow finished