# SUB FLOWS - something is going on

**URL:** https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851
**Category:** General
**Created:** [7 April 2019 06:04 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851 "2019-04-07T06:04:01Z")
**Posts on this page:** 7
**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: [7 April 2019 06:04 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/1 "2019-04-07T06:04:01Z")

</div>

Hi again folks.

Yet another problem has me stumped.

I had/have _messy_ flows for things and monitoring my network.

One of the flows had a **lot** of nodes and a lot of repitative stuff.  
I got into the _subflow_ mode and replaced a lot of stuff with the _subflow_ stuff.

Strangely it reduced the processor load as I was going through replacing the "groups of nodes" with the one "subflow". (Beats me)

Anyway, it is working. As machines come up the flow is doing the right thing and I am getting the right signals coming out and "all is nice".  
Alas there is a **but** in this.

I had done maybe all but one RPI. Probably because I am not needing it to be online just now and it is a RPIZ(w).

Anyway, today I powered it up and it connected. Then the problem started.  
(See attached)

The **yellow** machine is that RPI.

I've just found something which could be a problem so I shall chase it now before continuing with this, other than:

I thought I read that in the newer NR version/s the sub-flow allowed node-status to work?

I have NR 0.20.3

---

<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: [7 April 2019 06:48 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/2 "2019-04-07T06:48:52Z")

</div>

I hope you haven't started reading this.

Ok, back to the original "problem":

How can I get the `subflow` to show node-status and how do I go into it to look at the inner workings?

---

<div class="post-metadata">

### Author: ![jtmoderate876](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jtmoderate876/32/6423_2.png) [@jtmoderate876](https://discourse.nodered.org/u/jtmoderate876)
#### Post date: [7 April 2019 13:17 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/3 "2019-04-07T13:17:31Z")

</div>

I don't know how to do node status for a subflow but...

for troubleshooting subflows I always end up:

1. double clicking on the subflow in the palette sidebar to "open" the subflow
2. copy the subflow to a regular flow (perhaps temporary flow)
3. troubleshoot it in this regular flow
4. copy and paste the working content back to the subflow

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [7 April 2019 13:49 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/4 "2019-04-07T13:49:01Z")

</div>

> [@Trying\_to\_learn](#):
>
> How can I get the `subflow` to show node-status

Does this help? [Version 0.20 released : Node-RED](https://nodered.org/blog/2019/03/12/version-0-20-released#subflow-status)

---

<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: [8 April 2019 21:19 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/5 "2019-04-08T21:19:48Z")

</div>

Thanks Nick.

I knew I saw it somewhere.

 ![](https://nodered.org/blog/content/images/2019/03/sf-add-output.png)

How do I connect the status _output_ to the node?

I get that my node is ....... complicated. That's my problem.

But looking at the instructions, they don't explain how to set up the (I'm taking it as a) function node output?

Yes it is possibly obvious, but I want to check. I have this habit of running down rabbit holes and getting the wrong idea/s.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [8 April 2019 21:42 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/6 "2019-04-08T21:42:21Z")

</div>

> [@Trying\_to\_learn](#):
>
> How do I connect the status _output_ to the node?

You click the 'status node' button and the status node appears. You can then treat that as any other node - you wire it into your flow and pass it messages.

Passing it any of the following messages will emit the status `"hi"`:

```auto
{
   payload: "hi"
}

```

```auto
{
   payload: {fill:"green",shape:"dot",text:"hi"}
}

```

```auto
{
   status: {fill:"green",shape:"dot",text:"hi"}
}

```

The format of the status property is described here: [Node status : Node-RED](https://nodered.org/docs/creating-nodes/status)

---

<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: [9 April 2019 01:22 UTC](https://discourse.nodered.org/t/sub-flows-something-is-going-on/9851/7 "2019-04-09T01:22:44Z")

</div>

Thanks the link was good.

Just to mention:  
Ok, to _get it all working_ with the `node-status`, you tick the box in the sub-flow window.  
That gives you a _status_ output node.

The example shown depicts connection to a function node with a specific output for `node-status`, which is not exactly standard.

To capture the entire sub\_flow's status-s you put a `catch-all` node and connect its output to the status node.

That is shown, but the explination:

> ##### Redirecting status events from inside a subflow

Is slightly misleading.

Maybe: Redirecting status events **from all nodes** inside the subflow would be better.

(space for separation)

This whole first part:

> #### Subflow Status
> 
> There is a new option to add a ‘status’ output to a subflow. This can be used to update the \>Status of subflow instance nodes. With subflows currently, if any node inside the subflow emits \>a status event, it would pass up to the flow containing the subflow instance - but it wouldn’t \>appear to have come _from_ the subflow instance. Now, if this new status output is used, only \>messages passed to it will get passed to the parent flow and they _will_ be properly identified \>as having come from the subflow. This gives a lot more control and flexibility of working with \>status events and subflows.
> 
> ##### Adding a status output:
> 
> ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a117f0a5649e5805ffd224e1b26283e22b1df104.png)
> 
> ##### Status appears against the subflow instance node just like any other node with status
> 
> ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c2ec8df3ab7dab493b9f91cfaaaa2f659fc17565.png)

Is misleading and not really explained correctly - to me because rather than _catching_ the node-status message, you have to re-write the code in said node and send it to the `status` node.

Anyway, I think I have it working now.
