# My journey into "Sub flows"

**URL:** https://discourse.nodered.org/t/my-journey-into-sub-flows/7754
**Category:** General
**Created:** [8 February 2019 21:13 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754 "2019-02-08T21:13:01Z")
**Posts on this page:** 10
**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: [8 February 2019 21:13 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/1 "2019-02-08T21:13:01Z")

</div>

After a lot of thought, I am starting my journey into sub-flows.

I get that it can only have one input and have multiple outputs.

So putting aside the "problem" with only 1 input as that is true with all other nodes, so really it just gets down to structuring this node as any other node.

So, I see there is an option to add comments for the node if you double click on the tab at the top of the screen.

To set the input/output(s) you click at the top of the screen and you get input and output nodes appear to connect to the flow.

Again: Ok.

I was thinking to do like other well built nodes and put a description on the output pins explaining their function.

Alas I don't think that is supported.

(Same for the input node I just realised.)

Just wanting to check before I submit a request for that.

Am I missing anything about the comments and how you can not set separate ones for input and output?

(Via edit)

Oh, I also see that you can't use `node.status` in the sub nodes and see what is going on.  
That is a bit annoying.

Is this also something I am missing in how to implement?

---

<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: [8 February 2019 22:14 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/2 "2019-02-08T22:14:21Z")

</div>

I put comment nodes inside the subflow against the input and outputs to describe what they are. That is much easier to see than comments inside the subflow config.

---

<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: [8 February 2019 22:31 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/3 "2019-02-08T22:31:38Z")

</div>

> [@Trying\_to\_learn](#):
>
> Oh, I also see that you can't use `node.status` in the sub nodes and see what is going on.  
> That is a bit annoying.

Did you see the post earlier today describing new subflow features available in the next version of node-red?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [8 February 2019 22:44 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/4 "2019-02-08T22:44:11Z")

</div>

Meanwhile - even in the existing version you can set input and output labels on the pins if you like

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/77fdabacb89b648dcd29eea9b49f78be2d2461b2.png)

You can also use `node.status` - and use a status node outside to catch that status (it just doesn't show underneath like other nodes... - but as Colin says that is coming in 0.20)

---

<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 February 2019 22:49 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/5 "2019-02-08T22:49:43Z")

</div>

> [@Trying\_to\_learn](#):
>
> Am I missing anything about the comments and how you can not set separate ones for input and output?

If you double-click on any of the Input or Output nodes inside a subflow it will open the Edit Properties dialog (the same one if you click the 'edit properties' button in the toolbar.

As with other nodes, you can go to the 'Appearance' tab and set labels for the inputs and outputs.

 ![Local_Node-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/75da216e6aa18619633865667f80855c64994bd9.png)

These are the labels that appear when you hover the mouse over the input/output ports of the node in the main workspace.

![Local_Node-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/92ddf8ca2ee50f0db55732b22d3140cfae30cdf0.png)

You do not currently get to see these labels when editing the subflow itself - that isn't something I'd thought of but will look at adding as it makes sense to do so.

> [@Trying\_to\_learn](#):
>
> Oh, I also see that you can't use `node.status` in the sub nodes and see what is going on.  
> That is a bit annoying.

You _can_ use node.status() in nodes within the subflow. The status event can be handled by a Status node however the status event will _not_ appear against the subflow instance node - in otherwords, you won't get the text appearing below subflow instance node.

As @colin mentioned, we just released the [next beta of 0.20](https://discourse.nodered.org/t/node-red-0-20-0-beta-5-released/7739) which adds some new subflow capabilities, including better handling of 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 February 2019 04:01 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/6 "2019-02-09T04:01:13Z")

</div>

Colin: No I missed the update to the new version.

DCeeJay: thanks. I hardly ever look at that part of the node. Oops.

Nick: Sorry, I don't see [This picture](https://discourse.nodered.org/uploads/short-url/gOzcOthI9rkRC9PC5rOPSHwAkxb.png)

But that could be because I am only using 0.19.5

 ![Screenshot%20from%202019-02-09%2015-00-37](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3ba88ae49ba24bb747d4a10a22006c9910e154bb.png)

Could you help me understand where this is?

Oh, and back to the `node properties` part.  
That can't be set at the subflow creation level then?

As much as I can copy/paste the node with the data, pulling it out of the list of nodes, all the outputs are blanks.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 February 2019 06:59 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/7 "2019-02-09T06:59:24Z")

</div>

The picture i posted was from 0.19.5 that shows where to set the in and out labels. (Nicks was the equivalent from 0.20)

---

<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 February 2019 07:03 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/8 "2019-02-09T07:03:32Z")

</div>

DC,

Yeah, thanks.

I got the stuff you posted. As I explained: I seldom look at that part. Sorry. (My favourite word, it seems.)

While doing some testing, I got an error 401. Shall post when I get time.  
It got parked when I got that and I am looking at some other logic I need to implement in different parts of the flow.

---

<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: [9 February 2019 09:18 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/9 "2019-02-09T09:18:48Z")

</div>

@Trying_to_learn one quick word of caution before you delve too deep.

You _cannot_ use dashboard nodes inside a subflow. Won't get into all the details of why, but just don't try it. It leads to unexpected layouts and you'll waste a lot of time trying to figure it out.

---

<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 February 2019 09:20 UTC](https://discourse.nodered.org/t/my-journey-into-sub-flows/7754/10 "2019-02-09T09:20:53Z")

</div>

Yeah, ok.

I don't have any dashboard nodes....

Just for "parity":

 ![Screenshot%20from%202019-02-09%2020-19-45](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/eb62257f0d9084d72ad58122ed4d693c17e38211.png)
