# Many flows to one

**URL:** <https://discourse.nodered.org/t/many-flows-to-one/60503>\
**Category:** General\
**Created:** [29 March 2022 17:32 UTC](https://discourse.nodered.org/t/many-flows-to-one/60503 "2022-03-29T17:32:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rex](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rex/32/59848_2.png) [@rex](https://discourse.nodered.org/u/rex)\
**Post date:** [29 March 2022 17:32 UTC](https://discourse.nodered.org/t/many-flows-to-one/60503/1 "2022-03-29T17:32:42Z")

</div>

I have some sensors acquired via MQTT. These sensors have similar management, so I'll like to collect them on a common flow or sub-flow.  
The data received from MQTT are asynchronous so they can arrive together.  
I think an architecture similar to that in the figure.  
 ![immagine](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/4/042abdc3796dcb87d1acf2a33ac277778c8cd6e6.png)

What I'm not able to understand is what happens in case of simultaneous arrival of messages.

The other question is, can I share a sub-flow or a flow with other flows. I try to explain, every MQTT messages need a pre-management, that I want to develop on their own flow, before coming into a common operation.

Thanks for the help,  
F.

---

<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:** [29 March 2022 17:41 UTC](https://discourse.nodered.org/t/many-flows-to-one/60503/2 "2022-03-29T17:41:38Z")

</div>

> [@rex](#):
>
> What I'm not able to understand is what happens in case of simultaneous arrival of messages

Hi Rex. Messages will NEVER arrive at the same time.

So long as you are only adding/updating properties on the `msg` object then the messages passing through the function will all be unique and isolated.

> [@rex](#):
>
> The other question is, can I share a sub-flow or a flow with other flows. I try to explain, every MQTT messages need a pre-management, that I want to develop on their own flow, before coming into a common operation

Subflows have context so while not a problem, you'd be better off with a link-call node instead of subflow.

---

<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:** [28 May 2022 17:42 UTC](https://discourse.nodered.org/t/many-flows-to-one/60503/3 "2022-05-28T17:42:25Z")

</div>

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