Local File Trigger spawns workflow instance for each file

I have a workflow with a Local File Trigger node that watches, processes and stores csv files. When active, I see the workflow spawns n number of times each with an unique id where n is number of files moved to the watched folder at once

I also do a post-processing Execute command at the end of the workflow. This command expects all the n files to be processed and ready in tmp directory. Is it possible to await all the workflow instances before executing this final node (command)?

For now I am sleeping the Python script until file count matches. Is there a better solution?

Note: all env variables are default.

Hi @Gowthaman_Prabhu, this is the expected behaviour I am afraid (as each new file would ususally be a change on its own).

There’s no built in-way to check if all workflow instances have finished unfortunately and I can’t think of an easy way of implementing this for your specific use case.

Perhaps it could be easier to use the interval node and regularly check all the files in a folder using the Read Binary Files node? That way you’d have only one execution rather than one execution per file.

1 Like

Understood. Thanks…