The idea is:
These days all languages support parallel execution.
E.g. Java had this since Java5 I remember.
(Of course behind the scenes, CPU power is distributed between different cores and different threads - which makes it in reality more / less “really” parallel - but this matters not for the user).
I do believe it can matter for the user to have, in n8n, a construct to simulate such parallellisme.
I believe this could be done with just 2 Nodes and 2 variables:
- A splitting Node (from where parallel paths start), simultaneously
- A Merging Node (where parallel paths come together)
- A boolean variable added to Nodes in a parallel path to signal whether or not to execute this Node in atomic way (although I would advocate to default this to “Yes”; to avoid a Node execution is broken up).
- A (boolean) Variable at the Merge Node signaling whether to wait for all paths to come together before proceeding or not (i.e. is a simultaneous exit required? Sometimes all results need to come in before proceeding, not just partial results).
What I’m not clear about yet is what to do @error (e.g. 1 Node keeps its Thread in wait state, blocking the entire setup → Ignore or throw error/…? Maybe this (and a timeout) could also be set in the Merge/Split Node.
Use case:
Cf. the many questions on this here.