Best way to check the connected state of an MQTT node before publishing?

You can use a Status node to tell you the current state of the connection.