Merge pull request #5297 from node-red/5264-fix-sfpath-envvar

Ensure flow property is set on sf instance nodes so NR_SUBFLOW_PATH c…
This commit is contained in:
Nick O'Leary
2025-10-10 11:26:39 +01:00
committed by GitHub

View File

@@ -268,6 +268,9 @@ class Flow {
try {
var subflowDefinition = this.flow.subflows[node.subflow]||this.global.subflows[node.subflow]
// console.log("NEED TO CREATE A SUBFLOW",id,node.subflow);
// Ensure the path property is set on the instance node so NR_SUBFLOW_PATH env is evaluated properly
Object.defineProperty(node,'_path', {value: `${this.path}/${node._alias||node.id}`, enumerable: false, writable: true })
this.subflowInstanceNodes[id] = true;
var subflow = Subflow.create(
this,