directory monitor in a loop


I am trying to handle new files content in a long time loop.
I found the component “Directory Monitor” which watches a folder and executes, when a new file arrived. Then I can do something with the new file content.
But how can I continue to wait for the next new file? My recursive loop only works one time.

How to handle nested loops?

Best regards

Hi Sabine,

The recursive loop is most likely the wrong choice. Read the node definitions. The loop will only run a second time if the lower input port has some data which will then be passed back to the loop start. I don’t think that is what you want.

You could use the “Generic loop start” with the “Variable condition loop end” and simply never meet the set condition so it will loop forever. Still, is that really what you want?

Personally I would create a workflow that reads all the files in the directory and processes each one of them. You can then run this workflow either on knime server or via batch mode and windows scheduler (or other appropriate scheduling tool for you OS).

1 Like


thank you for your answer!
I started with a “Generic Loop Start/Variable Condition Loop End” yesterday, but had problems. Today I added a CSV-Writer node at the end and now it works (don’t really knowing why).
Thanks again,