To Recursive Loop or Not To Recursive Loop. That is the question!

Hello fellow KNIMErs

I have been trying to implement an idea - unsuccessfully - and I was hoping in this fine community someone would be able to help me come up with a solution.

I have a flow that calls other work flows within an ordinary loop. Works great! :slight_smile: (pseudo flow below)
image

I would like to able to call a list of workflows 2 to n where the output of the Call Workflow Node is the input to the next Call Workflow Node. Basically, I cant do it. (below is a pseudo flow representation of my latest effort)

The input looks like this
image

So, that is why I am here today to ask two questions:

1.Can someone please give advice on how I can do this
2.Should I be trying to use a recursive loop? is there an alternative way?

Many thanks for reading

Frank

Hi,
I think you are going to need the Call Workflow (Table based) node for this, because you want to pass on a whole table, not just a row. And you need some way to tell the Recursive Loop End when to stop.
I have created a small example and uploaded it to KNIME Hub: alexanderfillbrunn/Public – Recursive Workflows – KNIME Community Hub.
Kind regards,
Alexander

1 Like

Hi @FrankColumbo ,

I create4 something like it, but different propus.

I create a table with all workflow names, file path and a select column with 0 or 1 values as bolean. With row filter, I’ll select only I need to pass from the table, you can sort if you set priorities too.

Then, I call Table Row to Variable Loop Start and Select the name from workflow columns to run 1-to-1.

Inside I just make a call to this workflow using the flowvariables with the path (as real path) and close the loop with Variable Loop end.

So you have just set it and be happy!

Follow the workflow for you:

KNIME_project_table_loop.knwf (25.5 KB)

BR, Denis

Thank you both @AlexanderFillbrunn and @denisfi

I had to switch priorities at work last couple of days. Hoping to look at both of your suggested solutions this afternoon/tomorrow morning.

Thanks again

Frank

1 Like

Hello @AlexanderFillbrunn and @denisfi

My apologies for not replying sooner, as I mentioned before, I had some priority reordering at work.

@denisfi thank you for your suggested flow. I found it an interesting way to order and call workflows, it is something I will be using in the future. Thank you.

@AlexanderFillbrunn thank you for your suggested flow. It was really helpful because to not only did it do want I wanted it to do, it also (after a couple of hours playing) taught me a lot about implementing recursive loops.

For anyone else in the future (human or chatGPT data grabber) I have made up a few different recursive loop flows. These are available on the hub at: frankcolumbo/Public – Recursive loops Call Workflows Simple Examples – KNIME Community Hub
Input:
image
Flow:


Output:
image
Input:
image
Flow:

Output:
image
Input:
image
Flow:

Output:
image

Thanks again

Frank

3 Likes

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