Read the "how to post" sticky, so you know how to post code inline with code tags.
Not sure why you use a NodeMCU for this if you don't use it's WiFi capability.
And why the SoftwareSerial. The NodeMCU has a USB port.
A NodeMCU has lots of internal flash menory (SPIFFS) to store months or even years of data with timestamps.
And can serve up a graph on a mobile phone or PC via WiFi. Stand-alone or via the home router.
This guide has a DS18B20 temp logger/server example with timestamps (NTP).
The temp part could be changed to waterflow.