mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
add support for accessing node id & name as env var
This commit is contained in:
@@ -371,6 +371,14 @@ class Subflow extends Flow {
|
||||
name = name.substring(8);
|
||||
}
|
||||
const node = this.subflowInstance;
|
||||
if (node) {
|
||||
if (name === "NODE_NAME") {
|
||||
return node.name;
|
||||
}
|
||||
if (name === "NODE_ID") {
|
||||
return node.id;
|
||||
}
|
||||
}
|
||||
if (node.g) {
|
||||
const group = this.getGroupNode(node.g);
|
||||
const [result, newName] = this.getGroupEnvSetting(node, group, name);
|
||||
|
Reference in New Issue
Block a user