1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add NR_SUBFLOW_NAME/ID/PATH env vars

Closes #4239
This commit is contained in:
Nick O'Leary 2023-07-14 17:14:39 +01:00
parent 3fad690d1e
commit ec7e594ec1
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -341,13 +341,13 @@ class Subflow extends Flow {
getSetting(key) {
const node = this.subflowInstance;
if (node) {
if (key === "NR_NODE_NAME") {
if (key === "NR_NODE_NAME" || key === "NR_SUBFLOW_NAME") {
return node.name;
}
if (key === "NR_NODE_ID") {
if (key === "NR_NODE_ID" || key === "NR_SUBFLOW_ID") {
return node.id;
}
if (key === "NR_NODE_PATH") {
if (key === "NR_NODE_PATH" || key === "NR_SUBFLOW_PATH") {
return node._path;
}
}