you can use the MP block for such a purpose. Set the MP:pwidth parameter to e.g. 5 seconds and set the MP:RPTF parameter to ON.
From your ESP32, you'll periodically write ON to MP:BSTATE parameter (e.g. once per second) via REST API of REXYGEN. As long as the ESP32 keeps communicating, the output MP:Y will be ON. If there is no communication from ESP32 for more than 5 seconds, the MP:Y output will turn OFF.
In other words, the MP block acts as a communication watchdog in this case.
Hope it helps, let me know.