Node-red is going to sleep mode after few minutes?

Hi
I’m using Node-Red for Home Assistant as a broker from MQTT (on HA) to Modbus TCP (Wago 750).
Basically it is working ok, I have quite simple flow:
MQTT in node (for MQTT topics) → Function (with payload, address in Wago) → Modbus Flex Write

I use it for turn ON/OFF relays. If I switch it one by one it is ok, but if there is a delay between switches, (for example 5 minutes) the first signal is not going to WAGO.

I did many tests, for example using “mbpoll” and for sure this is not a problem with Wago. Also alone MQTT is working properly.

Looks like Node-Red is going to kind of sleep mode after few minutes, and to wake up I need to click for something, that 1st click will not send MQTT topic, and 2nd click will sent MQTT topic properly. Later 3rd, 4th… are working properly, untill next few minutes delay between clicks.

This is big problem because if I will try to turn off something after 1 hour activity, then from HA perspective something is turned off, but the turn off signal never came to Wago.

I checked already all settings, timeout parameters etc, but I did not find anything.
Any suggestions?

What are you using to start the flow? If you havent already download and install mqtt explorer on a pc. Connect it to your mqtt broker. Have it running and connected when you try to trigger the flow and look to see if the message is making it to the broker on the first click.

The flow is like:
[MQTT in node] → [function node] → [Modbus-Flex-Write node]

I have analyzed MQTT and it is ok, I mean if I click on HomeAssistant, it sends MQTT properly always. Problem that the 1st click after 5 minutes the MQTT is published, but Node-Red is not sending anything. 2nd click MQTT is published properly as well but this time Node-Red is sending Modbus command.

I have added Catch-all node and Debug to my flow and 1st click - nothing, debug window is empty, 2nd click - I see messages.

In my opinion definitely the Node-Red is going to kind of suspended mode, if I’m using it a lot, without that 5-minutes breaks it is working properly whole time.
But I do not see any option to disable that “suspended mode”

I resolved the problem by adding one mosquitto_pub in cron (every 1 minute) which is received by node-red and because of that, node-red is sending every 1 minute signal to my WAGO via modbus to non-existing coli (some big number, 300 or something).
Works perfectly.