From 5c29feec635387dfdbd436da3a4879a33bd266f8 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 2 Aug 2022 00:05:21 +0100 Subject: [PATCH] Register subflow module instance node with parent flow Fixes #3798 --- packages/node_modules/@node-red/runtime/lib/flows/util.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/flows/util.js b/packages/node_modules/@node-red/runtime/lib/flows/util.js index 0f3435b77..7c98fc041 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/util.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/util.js @@ -134,10 +134,12 @@ function createNode(flow,config) { subflowInstanceConfig, instanceConfig ); + // Register this subflow as an instance node of the parent flow. + // This allows nodes inside the subflow to get ahold of each other + // such as a node accessing its config node + flow.subflowInstanceNodes[config.id] = subflow subflow.start(); return subflow.node; - - Log.error(Log._("nodes.flow.unknown-type", {type:type})); } } catch(err) { Log.error(err);