# How to program flow to redeploy itself?

**URL:** <https://discourse.nodered.org/t/how-to-program-flow-to-redeploy-itself/21988>\
**Category:** General\
**Created:** [19 February 2020 16:01 UTC](https://discourse.nodered.org/t/how-to-program-flow-to-redeploy-itself/21988 "2020-02-19T16:01:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hornynkz](https://avatars.discourse-cdn.com/v4/letter/h/ee59a6/32.png) [@Hornynkz](https://discourse.nodered.org/u/Hornynkz)\
**Post date:** [19 February 2020 16:01 UTC](https://discourse.nodered.org/t/how-to-program-flow-to-redeploy-itself/21988/1 "2020-02-19T16:01:35Z")

</div>

HI,

I have an issue with node-red-contrib-iiot-opcua and node-red-contrib-opcua. From time to time when my OPC-UA server has to be rebooted, the client nodes fail to reconnect, leaving the node in error. Only redeploying the flow fixes it.

Is there a way to program a function which would be something like this?  
if(msg.playload.indexOf('Error')!= -1){ REDEPLOY FLOW }

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [19 February 2020 18:56 UTC](https://discourse.nodered.org/t/how-to-program-flow-to-redeploy-itself/21988/2 "2020-02-19T18:56:12Z")

</div>

I think the better solution would be fixing the node in question instead of working around these problems.

If the node is maintained on Github, you could open an issue there.

---

<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:** [19 April 2020 18:56 UTC](https://discourse.nodered.org/t/how-to-program-flow-to-redeploy-itself/21988/3 "2020-04-19T18:56:14Z")

</div>

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