There isn't any headway to make, the environment variables-per-tab is already definable using the property window for the tab. Basically the flow above already uses that feature of flow tabs.
See flow above. If you want to modify that to use subflows, then you need to understand the format of the flows.json file. It's not too hard: create a subflow, export using the export dialog, copy the entire flow to the clipboard (don't use the compacted json) and paste the result into your favourite editor. You can then examine the json that makes a flows.json. It's a very simple structure: one long array of node objects including a subflow type.
FWIW: The following flow is an improvement on the one above because SendFlow does support setting the hostname in the message object - forgot to RTFM.
[{"id":"5ab82d98c1827e0a","type":"tab","label":"Brain Flow","disabled":false,"info":"","env":[]},{"id":"b7963e843fc65614","type":"tab","label":"Flow for HostOne","disabled":false,"info":"","env":[{"name":"HOSTNAME","value":"HostOne.example.com","type":"str"}]},{"id":"6c8a81cb81cc394c","type":"tab","label":"Flow for HostTwo","disabled":false,"info":"","env":[{"name":"HOSTNAME","value":"HostTwo.example.com","type":"str"}]},{"id":"b465425b102e89a3","type":"FlowCompareCfg","name":"FlowCompare","data":"some default value"},{"id":"5bb493c5edf9bd35","type":"NodeFactorySidebarCfg","pkgname":"node-red-dashboard","pkgversion":"latest","otptype":"totp","algorithm":"SHA1","secret":"OTP_SECRET","secretType":"env","issuer":"","otplabel":"","digits":6,"counter":0,"period":30},{"id":"45272418474d3011","type":"Flow2MermaidCfg","name":"Flow2Uml","direction":"TB","genmereditor":""},{"id":"847d6326d7e26ff0","type":"AdressBookCfg","name":"AdressBook","data":"some default value"},{"id":"6d154550387389a5","type":"auto_layout_config","name":"AutoLayout","algorithm":"dagre_lr","settings":"{\"dagre_lr\":{\"rankdir\":\"LR\",\"marginx\":20,\"marginy\":20,\"nodesep\":30,\"ranksep\":50},\"dagre_longest_path\":{\"rankdir\":\"LR\",\"marginx\":2,\"marginy\":2,\"ranker\":\"longest-path\",\"nodesep\":2,\"ranksep\":2},\"elkjs_mr_tree\":{\"algorithm\":\"mrtree\",\"childAreaHeight\":4500,\"childAreaWidth\":4500,\"org.eclipse.elk.direction\":\"RIGHT\"},\"elkjs_layered_upwards\":{\"algorithm\":\"org.eclipse.elk.layered\",\"elk.direction\":\"UP\",\"cycleBreaking.strategy\":\"INTERACTIVE\",\"layering.strategy\":\"INTERACTIVE\",\"crossingMinimization.semiInteractive\":true,\"separateConnectedComponents\":true,\"nodePlacement.strategy\":\"NETWORK_SIMPLEX\",\"spacing.nodeNode\":70,\"spacing.nodeNodeBetweenLayers\":25,\"spacing.edgeNode\":25,\"spacing.edgeNodeBetweenLayers\":20,\"spacing.edgeEdge\":20,\"spacing.edgeEdgeBetweenLayers\":15,\"elk.hierarchyHandling\":\"INCLUDE_CHILDREN\",\"elk.layered.spacing.edgeNodeBetweenLayers\":40,\"elk.layered.nodePlacement.bk.fixedAlignment\":\"BALANCED\",\"layering.layerConstraint\":\"FIRST\"},\"elkjs_layered_downwards\":{\"algorithm\":\"org.eclipse.elk.layered\",\"elk.direction\":\"DOWN\",\"cycleBreaking.strategy\":\"INTERACTIVE\",\"layering.strategy\":\"INTERACTIVE\",\"crossingMinimization.semiInteractive\":true,\"separateConnectedComponents\":true,\"nodePlacement.strategy\":\"NETWORK_SIMPLEX\",\"spacing.nodeNode\":70,\"spacing.nodeNodeBetweenLayers\":25,\"spacing.edgeNode\":25,\"spacing.edgeNodeBetweenLayers\":20,\"spacing.edgeEdge\":20,\"spacing.edgeEdgeBetweenLayers\":15},\"elkjs_box\":{\"algorithm\":\"org.eclipse.elk.box\",\"childAreaHeight\":3000,\"childAreaWidth\":3000},\"pull_request_2267\":{}}"},{"id":"35e1b422f6dcbd17","type":"ScratchPadCfg","name":"ScratchPad","scratches":[]},{"id":"6430b03743370eb5","type":"FlowHubCfg","apiToken":"","apiTokenType":"","fullname":"","email":"","flowid":"","flowrevision":"","notab":false,"pushcomment":"","pushnewflows":false,"forcepush":false,"tokens":[],"flowrevisions":{}},{"id":"f3a47d3a31f06a51","type":"FlowCompareCfg","name":"FlowCompare","data":"some default value"},{"id":"efee16432ff2c2f9","type":"NodeFactorySidebarCfg","pkgname":"node-red-dashboard","pkgversion":"latest","otptype":"totp","algorithm":"SHA1","secret":"OTP_SECRET","secretType":"env","issuer":"","otplabel":"","digits":6,"counter":0,"period":30},{"id":"f10d91b7f099c2bb","type":"Flow2MermaidCfg","name":"Flow2Uml","direction":"TB","genmereditor":""},{"id":"0df0401150d3bedc","type":"AdressBookCfg","name":"AdressBook","data":"some default value"},{"id":"08e45227d9c1c5c6","type":"auto_layout_config","name":"AutoLayout","algorithm":"dagre_lr","settings":"{\"dagre_lr\":{\"rankdir\":\"LR\",\"marginx\":20,\"marginy\":20,\"nodesep\":30,\"ranksep\":50},\"dagre_longest_path\":{\"rankdir\":\"LR\",\"marginx\":2,\"marginy\":2,\"ranker\":\"longest-path\",\"nodesep\":2,\"ranksep\":2},\"elkjs_mr_tree\":{\"algorithm\":\"mrtree\",\"childAreaHeight\":4500,\"childAreaWidth\":4500,\"org.eclipse.elk.direction\":\"RIGHT\"},\"elkjs_layered_upwards\":{\"algorithm\":\"org.eclipse.elk.layered\",\"elk.direction\":\"UP\",\"cycleBreaking.strategy\":\"INTERACTIVE\",\"layering.strategy\":\"INTERACTIVE\",\"crossingMinimization.semiInteractive\":true,\"separateConnectedComponents\":true,\"nodePlacement.strategy\":\"NETWORK_SIMPLEX\",\"spacing.nodeNode\":70,\"spacing.nodeNodeBetweenLayers\":25,\"spacing.edgeNode\":25,\"spacing.edgeNodeBetweenLayers\":20,\"spacing.edgeEdge\":20,\"spacing.edgeEdgeBetweenLayers\":15,\"elk.hierarchyHandling\":\"INCLUDE_CHILDREN\",\"elk.layered.spacing.edgeNodeBetweenLayers\":40,\"elk.layered.nodePlacement.bk.fixedAlignment\":\"BALANCED\",\"layering.layerConstraint\":\"FIRST\"},\"elkjs_layered_downwards\":{\"algorithm\":\"org.eclipse.elk.layered\",\"elk.direction\":\"DOWN\",\"cycleBreaking.strategy\":\"INTERACTIVE\",\"layering.strategy\":\"INTERACTIVE\",\"crossingMinimization.semiInteractive\":true,\"separateConnectedComponents\":true,\"nodePlacement.strategy\":\"NETWORK_SIMPLEX\",\"spacing.nodeNode\":70,\"spacing.nodeNodeBetweenLayers\":25,\"spacing.edgeNode\":25,\"spacing.edgeNodeBetweenLayers\":20,\"spacing.edgeEdge\":20,\"spacing.edgeEdgeBetweenLayers\":15},\"elkjs_box\":{\"algorithm\":\"org.eclipse.elk.box\",\"childAreaHeight\":3000,\"childAreaWidth\":3000},\"pull_request_2267\":{}}"},{"id":"56351154c2e0b4ef","type":"ScratchPadCfg","name":"ScratchPad","scratches":[]},{"id":"4f0e9d9e0d720207","type":"FlowHubCfg","apiToken":"","apiTokenType":"","fullname":"","email":"","flowid":"","flowrevision":"","notab":false,"pushcomment":"","pushnewflows":false,"forcepush":false,"tokens":[],"flowrevisions":{}},{"id":"e8336c71d651ad51","type":"inject","z":"5ab82d98c1827e0a","name":"deploy flows to hosts","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":161,"y":140,"wires":[["37124cb7e9f22efe"]]},{"id":"37124cb7e9f22efe","type":"ClientCode","z":"5ab82d98c1827e0a","name":"get all defined flows in the frontend","clientcode":"msg.all_flows = RED.nodes.createCompleteNodeSet(false);\n\nlet flows = {}\nlet hosts = {}\n\nmsg.all_flows.map( nde => {\n if (nde.type == \"tab\") nde.z = nde.id;\n\n flows[nde.z] = flows[nde.z] || []\n flows[nde.z].push(nde)\n \n if (nde.type == \"tab\") {\n for (var idx = 0; idx < nde.env.length; idx++) {\n if (nde.env[idx].name == \"HOSTNAME\") {\n hosts[nde.env[idx].value] = flows[nde.z]\n }\n }\n }\n})\n\n\nmsg.payload = Object.keys(hosts).map( h => [[h,hosts[h]]])\n\nnode.send(msg)","format":"javascript","x":492,"y":305,"wires":[["a6c0f3363cef9149"]]},{"id":"5ffa605af6e4331e","type":"SendFlow","z":"5ab82d98c1827e0a","name":"send to host","hostUrl":"hostname","hostUrlType":"msg","flowVersion":"v1","useAuthentication":false,"apiUsername":"","apiUsernameType":"env","apiPassword":"","apiPasswordType":"env","x":660,"y":365,"wires":[[]]},{"id":"a6c0f3363cef9149","type":"split","z":"5ab82d98c1827e0a","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":335,"y":365,"wires":[["699b517ea96cec46"]]},{"id":"699b517ea96cec46","type":"change","z":"5ab82d98c1827e0a","name":"set hostname and flow data","rules":[{"t":"set","p":"hostname","pt":"msg","to":"payload[0]","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload[1]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":489,"y":423,"wires":[["5ffa605af6e4331e"]]},{"id":"ad924d79aea684e7","type":"inject","z":"b7963e843fc65614","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":232,"y":167,"wires":[["86a38b150c13900b"]]},{"id":"86a38b150c13900b","type":"debug","z":"b7963e843fc65614","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":412,"y":373,"wires":[]},{"id":"ed605f5c1b06e711","type":"inject","z":"6c8a81cb81cc394c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":479,"wires":[["ccedc5f796093cda"]]},{"id":"ccedc5f796093cda","type":"debug","z":"6c8a81cb81cc394c","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":449,"y":576,"wires":[]}]