# Disable during deployment the config node if no active node

**URL:** <https://discourse.nodered.org/t/disable-during-deployment-the-config-node-if-no-active-node/72355>\
**Category:** Developing Nodes\
**Created:** [17 December 2022 17:18 UTC](https://discourse.nodered.org/t/disable-during-deployment-the-config-node-if-no-active-node/72355 "2022-12-17T17:18:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [17 December 2022 17:18 UTC](https://discourse.nodered.org/t/disable-during-deployment-the-config-node-if-no-active-node/72355/1 "2022-12-17T17:18:42Z")

</div>

Hi all,  
I am developing a node whose config node establishes a connection with a server. When all nodes are disabled, the config node remains active and establishes a connection.  
Would it be possible to add an option during deployment that disables the config node if no node is active so as not to establish a connection?  
Thanks for your answers.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [17 December 2022 20:14 UTC](https://discourse.nodered.org/t/disable-during-deployment-the-config-node-if-no-active-node/72355/2 "2022-12-17T20:14:58Z")

</div>

Hey @GogoVega

So, this is my take on it.  
A config node, should be self aware of what dependants it has.

As an example:  
my config nodes (ZWave V9 - WIP) has 2 methods....  
`registerInterest `, `deregisterInterest `

These are used by the child nodes -\> `self.configNode.registerInterest`  
With this, the config nodes has a state of what it is responsible for.

ideally, one could decide to NOT connect to anything, if it has no active dependants.  
The moment a child node calls `registerInterest` (as an example)

you can then make a connection to some service, and on the flip side, if `deregisterInterest` is called, and you remove the state of the last child node, disconnect the service.

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [17 December 2022 21:15 UTC](https://discourse.nodered.org/t/disable-during-deployment-the-config-node-if-no-active-node/72355/3 "2022-12-17T21:15:39Z")

</div>

Thanks Marcus,  
I use something similar to show the connection status with my server on each child node. I can consider this idea for my concern but my question is more general (not just for my nodes) would it be smarter to completely disable this node config rather than having to register active child nodes?  
The idea may seem stupid but it happens to me during my tests to disable one or more flows and that's where these problems occur.

---

<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:** [15 February 2023 21:15 UTC](https://discourse.nodered.org/t/disable-during-deployment-the-config-node-if-no-active-node/72355/4 "2023-02-15T21:15:52Z")

</div>

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