# Unable to save the second Customising config nodes in Subflows

**URL:** <https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701>\
**Category:** General\
**Created:** [4 September 2024 07:24 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701 "2024-09-04T07:24:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![molingran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molingran/32/94210_2.png) [@molingran](https://discourse.nodered.org/u/molingran)\
**Post date:** [4 September 2024 07:24 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/1 "2024-09-04T07:24:07Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d4f56dae02278b7605b75b889079695b600308d.png)

```json
[
    {
        "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": []
    }
]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2024 08:52 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/2 "2024-09-04T08:52:45Z")

</div>

> [@molingran](#):
>
> In the subflow, I can't use the second environment config nodes to save. This problem is very reproducible.

I don't understand exactly what is not working for you. Please give detailed instructions on how to replicate the problem.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [4 September 2024 09:16 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/3 "2024-09-04T09:16:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![molingran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molingran/32/94210_2.png) [@molingran](https://discourse.nodered.org/u/molingran)\
**Post date:** [4 September 2024 09:25 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/4 "2024-09-04T09:25:32Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2024 10:04 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/5 "2024-09-04T10:04:48Z")

</div>

> [@molingran](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [4 September 2024 10:17 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/6 "2024-09-04T10:17:30Z")

</div>

It looks like only one env config is accept per type of config node.  
[edit to clarify]

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2024 10:19 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/7 "2024-09-04T10:19:45Z")

</div>

See [Unable to select which subflow config property to use when more than one configured · Issue #4863 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/4863)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2024 10:54 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/8 "2024-09-04T10:54:01Z")

</div>

> [@E1cid](#):
>
> It looks like only on env config is accept per config node.

Did you mean only one per subflow?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [4 September 2024 11:00 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/9 "2024-09-04T11:00:09Z")

</div>

No, per type of config node. Or i would of said per subflow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 September 2024 11:17 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/10 "2024-09-04T11:17:57Z")

</div>

OK, understood, only on env config is accept per _type_ of config node (that isn't actually what you wrote originally, hence my confusion).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 December 2024 11:49 UTC](https://discourse.nodered.org/t/unable-to-save-the-second-customising-config-nodes-in-subflows/90701/12 "2024-12-03T11:49:12Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
