Help Needed - Run all IF conditions in parallel

Hi All,

I am building a flow in which i want to run all IF conditions simultaneously.

Steps in flow:

  1. read excel file with 100 questions
  2. split questions into batch of 5
  3. IF conditions to process answers of each questions ( each IF condition is calling a subflow)

Issue - Each if condition is run one by one. I want all the IF nodes to run at the same time.

Thanks

Hey @Priyanka !

Welcome!

Nodes and branches are executes in this order:

From left to right and from top to bottom from their position on canvas.

Achieving the true “parallel“ executions in same workflow sound doable.

Cheers!

How can i run all the IF branches at the same time ?

How can i run all the IF branches at the same time ?

Hi @Priyanka ,

I’m new in n8n too. Here 's my point.

  1. the wait node is not necessary between your set and code.
  2. i don’t understand why you use code to split in batch, since the same output goes to all parallel braches. maybe you use different conditions in IFs, then you can try switch or split instead of code and those IFs.
  3. you don’t use the loop node correctly. the final set ( edit fields ) node should comes from the “done” output of loop node.
  4. i don’t understand why you need those braches to be excuted at the same time. maybe you want the whole workflow to run fast, then you should’t use loop before subflows.

Hopefully it’s helpful. Good day !

Hi @murphyagi

Thanks for response

With regards to point 4-

I want all the branches to run at the same time to receive quicker response.

Is there any way i can run all the switch statements at once?

PFA image of revised flow -

switch statement contains below conditions - I want to process questions (9) question in each branch

{{
$json.itemIndex <= 9 && $json.itemIndex >= 0 ? 0 :
$json.itemIndex <= 19 && $json.itemIndex > 9 ? 1 :
$json.itemIndex > 19 && $json.itemIndex <= 29 ? 2 :
$json.itemIndex > 29 && $json.itemIndex <= 39 ? 3 :
$json.itemIndex > 39 && $json.itemIndex <= 49 ? 4 :
$json.itemIndex > 49 && $json.itemIndex <= 59 ? 5 :
0
}}

I’ve implemented steps 1,2 and 3 -