# Directing several flows in 1 function node

**URL:** <https://discourse.nodered.org/t/directing-several-flows-in-1-function-node/33831>\
**Category:** General\
**Created:** [6 October 2020 12:56 UTC](https://discourse.nodered.org/t/directing-several-flows-in-1-function-node/33831 "2020-10-06T12:56:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ward](https://avatars.discourse-cdn.com/v4/letter/w/439d5e/32.png) [@Ward](https://discourse.nodered.org/u/Ward)\
**Post date:** [6 October 2020 12:56 UTC](https://discourse.nodered.org/t/directing-several-flows-in-1-function-node/33831/1 "2020-10-06T12:56:55Z")

</div>

Hi,

Just a question in my project i'm sending several inputs into 1 function node. (or is it discouraged?)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/adf0a29387c9290b4ecab2b84d01802b6f6157c9.png)

It works but i'm wondering how node red handles this? Is it's storing all the flows at the beginning and treats it one at a time or are all the flows treated at the same time in parrallel?

And if it's handles the flows 1 at a time, what's the max storage of the flows before? (guessing the system memory).

Thanks at advance!  
Kind regards,  
Ward

---

<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:** [6 October 2020 13:05 UTC](https://discourse.nodered.org/t/directing-several-flows-in-1-function-node/33831/2 "2020-10-06T13:05:23Z")

</div>

Your terminology is a bit mixed up.

Whats happening is each time a message object (`msg`) is emitted from a node (e.g. from your green nodes on the left), they travel down the wires and are operated on by the nodes they flow to/through.

The code in the last function simply does its thing everytime a msg hits it.

> [@Ward](#):
>
> is it discouraged

That mostly depends on what you are doing in the function nodes. But no, this is a perfectly legitimate setup and use of nodes.

> [@Ward](#):
>
> And if it's handles the flows 1 at a time, what's the max storage of the flows before?

The messages are kinda serial as in they travel down the wires singularly (nodejs is single threaded) and unless you have a HUGE number of msgs travelling down the wires, you are unlikely to be facing any issues. (I have no details on what that HUGE number would be - possibly memory limited)

---

<div class="post-metadata">

**Author:** ![Ward](https://avatars.discourse-cdn.com/v4/letter/w/439d5e/32.png) [@Ward](https://discourse.nodered.org/u/Ward)\
**Post date:** [6 October 2020 13:37 UTC](https://discourse.nodered.org/t/directing-several-flows-in-1-function-node/33831/3 "2020-10-06T13:37:40Z")

</div>

@Steve-Mcl thanks for the quick reply.

> [@Steve-Mcl](#):
>
> Your terminology is a bit mixed up.

I've got to work on that 😅 😉

But now i know for certain it's never gonna drop a msg if the node is busy.

---

<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:** [5 December 2020 13:37 UTC](https://discourse.nodered.org/t/directing-several-flows-in-1-function-node/33831/4 "2020-12-05T13:37:45Z")

</div>

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