Wait in a loop is not waiting

What I thought would be a simple workflow just doesn’t seem to work, even though I have spent a lot of time going through KNIME forums and found some references that seem to solve the problem, but don’t.

This is the setup. There is a folder on my laptop which keeps receiving CSV files throughout the day in a directory/folder. Each time a new file arrives, I want to do some calculations on it, append those variables to the file, and then place the file in another directory (eliminating it from the original directory/folder so it doesn’t get processed again).

It would seem that the Wait node (wait for file) inside of a simple loop would do the job, starting with Generic Loop Start and ending with Loop End. If there are files in the original directory/folder, it processes them.

But then it does not loop back to wait again. Instead, the Wait node executes, instead of waiting, and immediately passes nothing to the CSV reader, which then generates a “no files” error message and the whole workflow stops.

Am I using the wrong loop controls? Is this something that the Wait node really cannot do? Any suggestions would be very much appreciated.

@njacknis you could check this example of looking at a folder every few minutes and then taking action if something has changed

Are you using the file creation event? Maybe you can set up a sample workflow or at least show a screenshot of the loop and the settings.

Although I’m not certain why it works, I found a useful suggestion at Error message from Loop End with Empty Table Switch - #2 by takbb . It worked when I added an End IF switch before an outer Loop-End.