# Loop from split need to give msg to other flow

**URL:** https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068
**Category:** General
**Created:** [29 March 2023 20:36 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068 "2023-03-29T20:36:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![hameljc](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hameljc](https://discourse.nodered.org/u/hameljc)
#### Post date: [29 March 2023 20:36 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/1 "2023-03-29T20:36:54Z")

</div>

NodeJS 16.17.1  
Node-RED 3.0.2

I have a split occurring in **flow 1** and I want the loop to send the message to **flow 2** without waiting for a response.

Basically I want the loop of the split to continue with the next item in the array as soon as the msg has been given to the **flow 2**.

This way, each item of the array of the split will run in **parallel's instances** of **flow 2**.

I have read about **link in, link call** and **link out** but it looks like with those, the loop would wait for the **flow 2** to finish before handling the next item.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [29 March 2023 20:54 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/2 "2023-03-29T20:54:56Z")

</div>

> [@hameljc](#):
>
> I want the loop to send the message to **flow 2** without waiting for a response.

Just send a message to flow 2 then. You can have multiple wires coming from single node, so you can send one message off to flow 2 (via a Link Out node if it is on a different tab) and meanwhile carry on with flow 1. However, all those messages will go to the one and only instance of flow 2. What is it that is in flow2 that would allow parallel processing?

---

<div class="post-metadata">

### Author: ![hameljc](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hameljc](https://discourse.nodered.org/u/hameljc)
#### Post date: [29 March 2023 20:59 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/3 "2023-03-29T20:59:00Z")

</div>

My understanding is that a flow, when it is called multiple time, will run multi-threaded.

So if my loop call it 7 times, 7 instance of that flow would run in parallel instead of the same flow running 7 times sequentially.

My loop calls a flow that take a file an convert it to something else. If my loop, loops 7 times and the conversion takes 2 minutes , I don't want the whole thing to take 14 minutes but 2 minutes, or close too.

Hope this is clearer.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [29 March 2023 21:09 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/4 "2023-03-29T21:09:58Z")

</div>

> [@hameljc](#):
>
> My understanding is that a flow, when it is called multiple time, will run multi-threaded.

You don't call a flow, you pass it a message. Arguably the Link Call sequence can be thought of a 'calling' but actually you send it a message and then when it is done it sends one back.  
However, you can have multiple messages flowing through a sequence of nodes (a flow) at once if that is what you mean. So if you have a flow that reads a file, processes it, and writes another file, and you send it two messages one after the other then the File node will read one file and pass it on the processing nodes. Then it will immediately start reading the next file (which is done in a different process in the OS) and while it is reading it the processing may proceed. If the processing is processor intensive, however, then it can only process one at a time, unless you pass the processing off to multiple separate processes outside node-red.  
Sorry, there seem to be a lot of instances of the word 'process' and its derivatives in those sentences, but hopefully you get what I am meaning.

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [30 March 2023 11:47 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/5 "2023-03-30T11:47:03Z")

</div>

> [@hameljc](#):
>
> My understanding is that a flow, when it is called multiple time, will run multi-threaded.

No - that's wrong for a standard flow:

- A flow is a collection of nodes organized as a linked list.
- Each node is instantiated exactly once.
- You may use (the functionality provided by) a node more than once in a flow (like all of us do e.g. with the `debug` node). Each time, you drop its representation in the editor, a new instance of it is created - so we're back at the second bullet point.

> [@hameljc](#):
>
> I have a split occurring in **flow 1** and I want the loop to send the message to **flow 2** without waiting for a response.

I'm not quite sure what you reference as "the loop" ... but: Sending messages is always `Fire & Forget`. A node receives a message, does his job (occasionally multi-threaded!) and then emits the result of his doing as a message. If there's still job left to be done, the node continues his doing ... until he assumes things are settled. There's no feedback to the node if his message was received...

---

<div class="post-metadata">

### Author: ![hameljc](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hameljc](https://discourse.nodered.org/u/hameljc)
#### Post date: [30 March 2023 14:18 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/6 "2023-03-30T14:18:57Z")

</div>

Thank you all for your answers.

---

<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: [29 May 2023 14:19 UTC](https://discourse.nodered.org/t/loop-from-split-need-to-give-msg-to-other-flow/77068/7 "2023-05-29T14:19:23Z")

</div>

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