Parallel Repeat

The current Parallel block of the NodeJS server target doesn’t allow to parallelize an array, only a series of hard-coded steps - meaning you cannot do a database query and parallelize actions over each element/row/item.

An example makes it easier to understand. Let’s say you have a table “websites” with URLs, such as:

https://wappler.io
https://microsoft.com
https://bing.com
https://google.com
https://youtube.com

If you want to perform an API Action (fetch those websites) in parallel, you can’t - the only way to do so is to hard-code those API Actions inside the Parallel block - you cannot iterate the database query “websites” and have it perform parallel requests.

Previous post of mine, once posted privately to the Wappler team and Ambassadors:

I think a Parallel Repeat would be nice, to repeat whatever is inside the repeat in parallel. Probably you’d need to add some sort of safety to limit the number of stuff in parallel, I found this:
https://caolan.github.io/async/v3/docs.html#parallelLimit

(scroll upwards on that page to see an example of a regular parallel)

Example usage:

Set Value urls = ["http://example.com", "https://wappler.com"]
ParallelRepeat urls:
    API Action $value

So those requests would be fetched in parallel. Anything that goes inside the repeat would run in parallel as a group (iteration 1 is parallel 1, iteration 2 is parallel 2 and so on)

In the parallel step options you can add the option of a parallel limit, default value e.g.: 5

Community Page
Last updated: