# Help with sub-flow and \`node.status\`

**URL:** <https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617>\
**Category:** General\
**Created:** [5 January 2021 21:35 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617 "2021-01-05T21:35:28Z")\
**Posts on this page:** 13\
**Page:** 1

<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:** [5 January 2021 21:35 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/1 "2021-01-05T21:35:28Z")

</div>

I am wanting to make the node show either a red or green filled circle depending on the condition.

The _message_ I send...... Is the important stuff in `payload` or do I have to put it in `status`?  
(Semi rhetorical, but I have to ask)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 January 2021 21:44 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/2 "2021-01-05T21:44:21Z")

</div>

Haven't used it in a subflow, but assume it's the same...

```auto
[{"id":"685d4506.0d2e2c","type":"function","z":"c9c4eeb8.bad8e","name":"","func":"if (msg.payload == \"yes\") {\n node.status({fill:\"green\",shape:\"dot\",text:\"Yes\"});\n} else if (msg.payload == \"no\") {\n node.status({fill:\"red\",shape:\"dot\",text:\"No\"});\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":2140,"wires":[[]]},{"id":"76b5853a.f401fc","type":"inject","z":"c9c4eeb8.bad8e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"yes","payloadType":"str","x":240,"y":2120,"wires":[["685d4506.0d2e2c"]]},{"id":"c6343d.5d309bc","type":"inject","z":"c9c4eeb8.bad8e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"no","payloadType":"str","x":240,"y":2180,"wires":[["685d4506.0d2e2c"]]}]

```

---

<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:** [5 January 2021 21:45 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/3 "2021-01-05T21:45:09Z")

</div>

Yeah, ok.

It is `msg.payload` and has to be like this:  
` msg.payload = ({fill: "green",text:"Good"});`

And that is sent to the `node.status` output.

Sorry folks.

All good now.

 ![Screenshot from 2021-01-06 08-46-33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a40094667c5b217b015c9ba391d4b03a67e46289.png)

 ![Screenshot from 2021-01-06 08-46-37](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/665c7542172f3595a85c34d5c943f1e6c7f1b6e8.png)

Like that it seems to work.  
(I get the message and colours as shown)

---

<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:** [5 January 2021 21:48 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/4 "2021-01-05T21:48:49Z")

</div>

Thanks Paul. Alas not quite from what I got working.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 January 2021 21:56 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/5 "2021-01-05T21:56:45Z")

</div>

> [@Trying\_to\_learn](#):
>
> I am wanting to make the node show either a red or green filled circle

I'm not seeing any `node.status` indicator in your screenshot above, all you seem to be doing is creating conditional statements to format the payload.

---

<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:** [5 January 2021 21:58 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/6 "2021-01-05T21:58:23Z")

</div>

My bad for not editing the piccie.

 ![Screenshot from 2021-01-06 08-46-33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/343815c0e2770409c728bff16941976c79afcd63.png)

That appears when I tick the box to have a `status` output.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 January 2021 22:00 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/7 "2021-01-05T22:00:04Z")

</div>

> [@Trying\_to\_learn](#):
>
> My bad for not editing the piccie.

But I'm still not seeing a red or green filled `node.status` circle, like you described in post #1?

---

<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:** [5 January 2021 22:01 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/8 "2021-01-05T22:01:47Z")

</div>

Ok, this is what I am seeing when I am testing it.

 ![Screenshot from 2021-01-06 08-59-03](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/967b07dca84c4d113b25725c892f0c7933f00a88.png)

 ![Screenshot from 2021-01-06 08-59-15](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c6cd194f3cdb7c8fa3dcb53b885fd8e4c17d021a.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 January 2021 22:04 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/9 "2021-01-05T22:04:31Z")

</div>

Aah right, I see what you are doing now. You are using the subflow status node 👍

---

<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:** [5 January 2021 22:10 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/10 "2021-01-05T22:10:16Z")

</div>

Sorry, I thought that was understood.

No problems.

All good.

Thanks though for the checking.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 January 2021 22:15 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/11 "2021-01-05T22:15:39Z")

</div>

> [@Trying\_to\_learn](#):
>
> Sorry, I thought that was understood.

I should have spotted the status node in your screenshot. It's been a long day!!  
You are probably more familiar with subflows than me, I must learn to make more use of them.

---

<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:** [5 January 2021 22:17 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/12 "2021-01-05T22:17:46Z")

</div>

Don't worry. I am as guilty of that as anyone.

Don't stress. All good.  
But again: Thanks for the replies. I like/need sanity checks to keep me on the _straight and narrow_.

---

<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:** [19 January 2021 22:17 UTC](https://discourse.nodered.org/t/help-with-sub-flow-and-node-status/38617/13 "2021-01-19T22:17:48Z")

</div>

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