From fb54c05d9f79a9eae6d4b84d4b535a7d06cb6db8 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 29 Nov 2023 16:12:12 +0000 Subject: [PATCH] Ensure subflow instances keep track of their groups --- .../@node-red/runtime/lib/flows/Subflow.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js b/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js index 5d52beeb7..32714f4dd 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js @@ -73,9 +73,20 @@ class Subflow extends Flow { id: subflowInstance.id, configs: {}, nodes: {}, + groups: {}, subflows: {} } + if (subflowDef.groups) { + // Clone all of the subflow group definitions and give them new IDs + for (i in subflowDef.groups) { + if (subflowDef.groups.hasOwnProperty(i)) { + node = createNodeInSubflow(subflowInstance.id,subflowDef.groups[i]); + node_map[node._alias] = node; + subflowInternalFlowConfig.groups[node.id] = node; + } + } + } if (subflowDef.configs) { // Clone all of the subflow config node definitions and give them new IDs for (i in subflowDef.configs) {