# Share signal over some flows

**URL:** <https://discourse.nodered.org/t/share-signal-over-some-flows/59010>\
**Category:** General\
**Created:** [26 February 2022 06:46 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010 "2022-02-26T06:46:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![goony](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@goony](https://discourse.nodered.org/u/goony)\
**Post date:** [26 February 2022 06:46 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/1 "2022-02-26T06:46:42Z")

</div>

I want to share a signal / status / command over more than one flows.

I can use global.get(signal) and global.set(signal,signal\_status). But this list may become very long and confusing.

Are there other possibilities to get signals from one flow to the next?  
Thank you!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 February 2022 06:53 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/2 "2022-02-26T06:53:57Z")

</div>

It depends on _who_ wants to use it.

And _how many_ flows.

Though a bit messy, what you could do is something like this:

In a `changed` node set the _names_ to the desired values to `flow` context.  
(Hang on!)

But rather than connect the node _directly_ to the output of the previous node, use a `link out` and `link in` node.

So it would look something like this (example)

 ![Screenshot from 2022-02-26 17-52-08](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6cef4d39e92b86f042346720c4e1be33a122a049.png)

Now, the blue rectangle....

Select those two nodes. COPY them.  
Go to the other flows and PASTE them there.  
Do that to how ever many flows needed.

Not perfect, but....

---

<div class="post-metadata">

**Author:** ![goony](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@goony](https://discourse.nodered.org/u/goony)\
**Post date:** [26 February 2022 07:00 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/3 "2022-02-26T07:00:18Z")

</div>

Thank you for the fast answer.  
That's exactly I need!!!!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 February 2022 07:01 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/4 "2022-02-26T07:01:22Z")

</div>

(Gee two people I have helped.)

---

<div class="post-metadata">

**Author:** ![goony](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@goony](https://discourse.nodered.org/u/goony)\
**Post date:** [26 February 2022 07:12 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/5 "2022-02-26T07:12:34Z")

</div>

😄

I followed your learning curve for some weeks!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 February 2022 07:13 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/6 "2022-02-26T07:13:15Z")

</div>

Just now my learning curve is flat. ☹😉

---

<div class="post-metadata">

**Author:** ![goony](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@goony](https://discourse.nodered.org/u/goony)\
**Post date:** [26 February 2022 07:14 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/7 "2022-02-26T07:14:23Z")

</div>

But you asked a lot questions I also had 😄  
So, thank you!

---

<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:** [26 February 2022 08:33 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/8 "2022-02-26T08:33:57Z")

</div>

> [@goony](#):
>
> this list may become very long and confusing.

That is exactly why I avoid flow and global context wherever possible. Instead I do it the node-red way which is to pass data to where it is needed using messages. Sometimes this means I need to use Join nodes to merge data from multiple messages together, but I think this is a small price to pay.

---

<div class="post-metadata">

**Author:** ![goony](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@goony](https://discourse.nodered.org/u/goony)\
**Post date:** [26 February 2022 08:52 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/9 "2022-02-26T08:52:19Z")

</div>

Thank you.

could you supply an example?  
There is no node "messages" or so.

each node sends a message. But I think this is not meant.

---

<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:** [26 February 2022 09:09 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/10 "2022-02-26T09:09:41Z")

</div>

> [@goony](#):
>
> There is no node "messages" or so

I didn't mean a particular node, I just meant to use node-red wires and pass messages containing the information required. You said you wanted to use a signal in various flows and to do that you save the value in context. Instead of saving it in context I would just wire it to wherever it is needed. One big advantage of that can be that you get automatically informed when it changes and can take appropriate action.

Perhaps you can give a specific example, preferably one that is not too complex, so I can consider how I would solve it myself.

---

<div class="post-metadata">

**Author:** ![goony](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@goony](https://discourse.nodered.org/u/goony)\
**Post date:** [26 February 2022 09:14 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/11 "2022-02-26T09:14:10Z")

</div>

Ok, I think we both mean the same thing.

Of course I wire the messages between nodes. But until [Share signal over some flows - #2 by Trying\_to\_learn](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/2) showed "linkin -linkout" I didn't get the information to different flows.  
Is there a different possibility beside to linkin -linkout ?

My global variables I normaly use are only for asyncronious using.

---

<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:** [26 February 2022 09:31 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/12 "2022-02-26T09:31:52Z")

</div>

Sorry, yes, I misinterpreted your question completely. I concentrated on the sentence about context vars, but that was not the question.

---

<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:** [12 March 2022 09:32 UTC](https://discourse.nodered.org/t/share-signal-over-some-flows/59010/13 "2022-03-12T09:32:08Z")

</div>

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