# 500 parallel flow in Nodered

**URL:** <https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237>\
**Category:** General\
**Created:** [28 November 2023 05:24 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237 "2023-11-28T05:24:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shershah](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@shershah](https://discourse.nodered.org/u/shershah)\
**Post date:** [28 November 2023 05:24 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237/1 "2023-11-28T05:24:13Z")

</div>

Hi All,

I am trying to find if we can create 500 parallel flow in Nodered. Can we? Will there be any performance issue? If it is feasible, how can we maintain queue to avoid data loss?

Regards,  
Shershah

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [28 November 2023 07:08 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237/2 "2023-11-28T07:08:14Z")

</div>

> [@shershah](#):
>
> Can we?

Yes. At least in theory.

> [@shershah](#):
>
> Will there be any performance issue?

Depends where the flows are running and what they do...  
500 computing intensive flows on a Raspberry will not work.

> [@shershah](#):
>
> how can we maintain queue to avoid data loss?

We don't know the queue you are talking about.

AFAIK, as node.js in single threaded, then, running 500 things in parallel will not really be in parallel...

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 November 2023 08:01 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237/3 "2023-11-28T08:01:09Z")

</div>

If these 500 flows all do the same task, it may be more efficient to have a single flow that does 500 tasks, but it is pure speculation as you have not provided any detail. The devil is in the details.

---

<div class="post-metadata">

**Author:** ![shershah](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@shershah](https://discourse.nodered.org/u/shershah)\
**Post date:** [28 November 2023 08:22 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237/4 "2023-11-28T08:22:20Z")

</div>

We have few different kind of sensor category like environment sensoe, boom barrier, temperture capture, speed capture likewise. Now we have multiple device to capture all the parameters. Now there are two approaches:

1. We can have flow for each sensor category
2. or flow for each sensor

If we have different flow for each sensor then I get the benefit of managing individual sensor, onboarding new sensor and create alert if sensor server connectivity lost or reconnect

If I use flow for each category then I have to write many if else to accommodate sensor Id.

We have both kind of operation where we updating something on the server and receiving telemetry data.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [28 November 2023 08:53 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237/5 "2023-11-28T08:53:19Z")

</div>

> [@shershah](#):
>
> If I use flow for each category then I have to write many if else to accommodate sensor Id.

Any reason you can’t create a flow per category, and use a `switch` node to split out each sensor (by its id) for that sensor category?

Then onboarding a new sensor is just a case of adding an entry in the `switch` node?

Having a flow per sensor seems overkill IMO

💁‍♂️

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 January 2024 08:54 UTC](https://discourse.nodered.org/t/500-parallel-flow-in-nodered/83237/6 "2024-01-27T08:54:11Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
