Node-RED 4.02
Node v20.15.1
I'm very excited about the "Customising config nodes in Subflows" feature that was added in version 4.0, but it seems I've run into a problem.
In the subflow, I can't use the second environment config nodes to save. This problem is very reproducible.
[
{
"id": "e54169906b92fd0f",
"type": "subflow",
"name": "Subflow 3",
"info": "",
"category": "",
"in": [],
"out": [],
"env": [
{
"name": "one",
"type": "mqtt-broker",
"value": "",
"ui": {
"type": "conf-types"
}
},
{
"name": "tow",
"type": "mqtt-broker",
"value": "",
"ui": {
"type": "conf-types"
}
}
],
"meta": {},
"color": "#DDAA99"
},
{
"id": "4a7c38167d88f367",
"type": "mqtt out",
"z": "e54169906b92fd0f",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "${one}",
"x": 130,
"y": 120,
"wires": []
}
]
Colin
4 September 2024 08:52
2
I don't understand exactly what is not working for you. Please give detailed instructions on how to replicate the problem.
E1cid
4 September 2024 09:16
3
I think you have a miss understanding of how to use the env config var.
You would still set all your mqtt configs in the mqtt config node.
Then in the subflow properties env config you set the env var to a config type and select the mqtt config.
Then you can select which mqtt config (server) to use when you add a new instance of the subflow.
The [env] one
show it the mqtt config, but they are not editable there as the are just marker to show that there are subflow envs set using the mqtt config.
@Colin
@E1cid
Thanks for your reply. I am not a native English speaker, so some of my answers may not be clear.
I want to use [env] two
as the mqtt configuration of this mqtt node in the subflow, but when I close the editor, it returns to [env] one
.
My subflow will use multiple mqtt configurations, so I used the subflow envs set. If there are other implementation methods, you can also tell me.
Colin
4 September 2024 10:04
5
I see you are right, it is not possible to set it to to anything other than the first one. I will submit a bug report and post the link back here.
E1cid
4 September 2024 10:17
6
It looks like only one env config is accept per type of config node.
[edit to clarify]
Colin
4 September 2024 10:54
8
Did you mean only one per subflow?
E1cid
4 September 2024 11:00
9
No, per type of config node. Or i would of said per subflow.
Colin
4 September 2024 11:17
10
OK, understood, only on env config is accept per type of config node (that isn't actually what you wrote originally, hence my confusion).
system
Closed
3 December 2024 11:49
12
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.