How to stop nodes processing too quickly?

I am currently working on creating a Dashboard in MS Excel, using Node-RED to get the data from the source system. In order not to have to import all the gathered data all the time, I created a flow that checks for a file (specifically "ImportSuccess.csv") to be existent using "node-red-contrib-fs-ops 1.6.0", specifically fs-ops-access.

If no, then the message will head into a Join-Node and will be appended to an array.

If yes, then the ImportSuccess.csv should be deleted, the message triggering this will get the "msg.complete" attribute and will be passed into the aforementioned Join-Node and trigger it to send out the whole array into a csv-file, overwriting its previous contents. In Excel, I then get the data from that csv-file and create a new "ImportSuccess.csv" to communicate to Node-RED that my tool is ready for a new batch of data.

Following problem occurs: Due to checking for existence and deleting the file being two different steps, a second message can successfully pass through the existence-check which results in double overwriting of the storage csv-file which causes loss of data.

Is there a way to prevent this from happening?

Part of the used flow

From my understanding, I need to "force" that the upper branch is fully finished before a next message gets to pass through the "File Access"-Node.

Found a solution by programming a function node that does what my previous snippet of flow did, but all in one function. If somebody has a better way or any tips, I'm always happy to hear them as I am quite new to Node-RED

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.