Pass subflow info under the node info

Hi, just discovered the subflow feature and it is great.
I would like to go further and have the same feature than some other nodes, means show the main values under the node icon like this home assistant node, like the result & a status color.

image

Is it documented ? And where ?

Welcome to the forum @usky73

What sort of nodes do you want to show a Status display for? You can do it for Function nodes (see Writing Functions : Node-RED) but for other nodes the status shown is determined by the node author.

I finally find my answer here : https://community.home-assistant.io/t/tuto-building-subflows-with-node-status-how-i-keep-it-simple/337239

FWIW.
A subflow has a status node output option.

Screenshot 2023-11-25 at 10.16.30

and to set the status.

{
  payload: {
    fill: "green",
    shape: "dot",
    text: "connected"
  }
}

Screenshot 2023-11-25 at 10.18.49

https://nodered.org/docs/creating-nodes/status

2 Likes

I misinterpreted the question, I thought you meant that you know how to do it with subflows, but wanted to add status to other nodes.

@marcus-j-davies is correct, but it isn't quite that simple.

You have to add/include the status node in the sub-flow and (what caught me a few times):
Select only the nodes who are sending their STATUS information

If you leave it as ALL NODES (default) you are not going to see what you want, as EVERY NODE will send their status to the status node.

Or - another way (as @marcus-j-davies may have meant) - make a message and send it out of a function node's extra (added/new) output.

2 Likes

Correct!

To "forward" so to speak an internal Node status out of the subflow, but I don't know if it includes the icon, colour - Have never really used the status node myself

(Sorry to seem to be taking over the thread)

As I play with subflows a lot, I discovered a painful lesson.

I made a subflow with a function node that used node.status to indicate what it is doing.

I ticked the status option and connected a status node to it.
(Nothing extra done. The subflow had a few other nodes in it too.)

I was wondering why I wasn't seeing the status when looking at the subflow.
Then I realised all the OTHER NODE'S status messages were also being shown. And as they were also included: the desired message was overwritten by the other ones.

Went into the subflow, opened the status node and said only selected nodes and ticked my function node.

All good from there on in.

Yes, I could have done it a different way and added an extra output and sent the messages directly to the status node's input.
But to keep things generic......
(and if ever you want to see the status of a non-function node.....

So just to share that bit of knowledge.
Just because other nodes don't show a status message, doesn't mean they don't; and in subflows: this matters.

Thanks to all of you for your quick support.
Very interesting.

I have a last question, if I use this status method

{
  payload: {
    fill: "green",
    shape: "dot",
    text: "connected"
  }
}

How to track if there is an error in the subflow execution ?

I think you can use the catch node inside your subflow.

And then use the message property from it to display in the status.

{
  payload: {
    fill: "red",
    shape: "dot",
    text: msg.error.message
  }
}

Screenshot 2023-11-26 at 08.16.56

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