Need node to watch directory to start automated process! Please Help!

Hello!

I really need a node that will watch a directory for a new file and then start a workflow. If the directory is empty, it should just wait until the directory is not empty and then run the rest of the workflow.

I have tried several solutions connecting different nodes together and there are many issues with these solutions because they are not specifically built to work in this way. There are several people in the forum asking for this and many were interested in this type of node at the Summit as well. An example of one forum topic from many years ago is below. I can provide more details on what I have tried and why this is not working if it is helpful.

Can someone please develop this node? Thanks in advance!

Gina Righi
DuPont

Hi @GinaRighi,
so you basically want an additional option for the wait node:

Instead of waiting for the creation of a specific file, you want the option to wait for that folder containing at least one file?

I created a component for you that simulates this:
https://hub.knime.com/gab1one/space/Wait%20for%20file%20in%20folder

best,
Gabriel

13 Likes

Hello,

I am a relatively new user. I was trying to use the component and it seems like there are some flow variables (in the “list files” node, the variable that I am trying to pass in is not working). I am not sure if I am doing something wrong that is simple to fix or I am not using correctly. It seems like the variable that I need is there, but the “list files” node won’t use if correctly and always gets an error.

Any help would be appreciated.

Hi @jwfott,

Thank you for your interest in this component, I created an updated version using the new filehandling nodes and made a little video for you that should show you how to use this:

Peek 2021-02-22 11-41

You can find the updated component here:

best,
Gabriel

4 Likes

BTW if you want to learn about components in depth take a look here:

https://docs.knime.com/2020-12/analytics_platform_components_guide/index.html

5 Likes

Hi gab1one,

Is it possible that instead of waiting time, can i change it that it will run if there are modifications made in the files in folder X? :slight_smile: What i’m hoping for really is that my workflow to be executed once there are changes and/or creation to files in my folder but I’m not entirely sure how to do that.

Hello @Ana914,

with node Files/Folders Meta Info you can find out last modified date. Then checking if last modified date (date given by current node’s execution) is bigger (or just different) from last modified date (previous node execution) you see if file got modified and thus run your logic downstream.

Br,
Ivan

4 Likes

Thanks, ipazin! :slight_smile:

2 Likes

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