Access to Name of SubNode-Instance

The basis is a subnode name as “SubFunc” in Node-Red.
Now the subnode is instantiated and a name “DoSomething01” is assigned to this instance in the UI.
How can I access the assigned name of this instance in the subnode?

When i use node.name in the subnode i only get "SubFunc".

The usual way of expanding the msg in an additional function node beforehand is not a solution for me.

According to my research, the name of the instance is only saved in the Node-Red UI.

Is this correct or is there a way?

I think this is what you are looking for:

let subnodeName = env.get("NR_SUBFLOW_NAME");

But you need Node-Red >= 3.1 (see here)

Perfect! That's exactly what I was looking for.

Thank you so much!

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