Reconnecting automatically

You should be able to pickup node status change with "Status" node and then if necessary restart your flows via NodeRed API

Restart flows using Node Red API (first link using forum search)