How to use a loop with multiple input and output files

Hi,

I have a very extensive workflow that I manually execute on a monthly basis. This workflow starts with a “Create file/folder variable” (which I change manually each month) and ends with a “CSV writer”. The filename of the CSV writer output is based on a variable that changes automatically each month based on the data in the workflow.

My problem is that sometimes I find an issue in my workflow which is requiring me to run the workflow for all previous times. As the months continue need to keep executing it more and more which each error I find.

I’d like to create a loop whereby the Create File/Folder variable node is provided with multiple paths so that every month is processed automatically instead of my running it manually automatically. I know how to do this with a “Table to variable” with a “List file/folder node”.

My problem is with the CSV writer as I want to have an output file per month. How can I arrange this?

Below I’ve made a screenshot of my workflow. It’s a bit messy, but I can make it a bit more structured once I know how to fix it.

In the grey metanode are multiple csv readers that are all depending on the red variable line from the create file/folder variable node.

Hi,
How about to put another loop around the whole workflow? I would create a table with “Create Table” Node and add all months/years you need. Then pass the table to a “table row to variable” loop start. Use the variables in the reader nodes and so on.

That could be an option I think, but that would require me to update the table manually. Ideally it would be fully automated.

My main issue is that I don’t know how to close the loop after the CSV writer (and go back to the beginning again). The CSV writer doesn’t have an output to end a loop.

Ah there’s a “variable loop end”

The “Table Creator” is just an example. If you like you can create this table with other nodes like “create time range” or similar

1 Like

It’s working in a test flow, but I’m not able to get it into my production workflow. But I know how it should work, so I’ll figure it out somehow!
Thanks for your help!

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