How to recalculate previous node values when the current node value changes?

I’m not sure how best to explain this so bare with me.
Let’s say I have a workflow as follows:

I’m going to develop an extension that consists of these yellow and blue nodes. If the input value to a blue node changes, I would like to re-run everything from the beginning yellow node to the finish node. How can I do that?

Hi @azsb1g19,

You can do this in the workflow by creating a red variable connection between the white nodes “3 and 4” and the “Begin” node. Like this:

But I understand that this is cumbersome. I’ll check back with the developers how to implement this functionality correctly.


Can you elaborate a bit more what you mean with changing input? I’m not sure I understand this correctly. Generally speaking, nodes can only execute when all upstream nodes are finished, i.e. the output will not change anymore.

In your screenshot, the purple end node is connected to the yellow begin node. By the time the blue node #3 can execute, the output of the white nodes won’t change anymore.
If the white nodes are reset and re-executed, the entire yellow block will be reset.

If the yellow block is a loop, like in Gabriel’s example, those Flow Variable connections aren’t needed, because reseting any node within a finished loop block will reset the entire loop. For other cases, such as a Component, the Flow Variable connections should do the trick they way I understand your problem.

1 Like

You are correct but my use case is a bit strange.

I’m essentially feeding a series of tables into a python program and that program looks at the differences between tables to make some kind of outpujt. During execution it creates and caches files before making some kind of final output. The program assumes it will not ‘re-trace’ its steps like you would in KNIME. Since I’m making a proof of concept I don’t intend to modify the python program to do that because I didn’t write it.

That’s interesting, I’ll play around with this. Say I had more nodes between the white 3 and 4 nodes. Would I still only connect nodes 3 and 4 or would all the nodes between these also have to be connected?

I still don’t understand what you’re doing, sorry. If Gabriel’s suggestion is working for you, then a Flow Variable connection to the first node you want to “re-run” will do the trick.

Hi @azsb1g19 , I don’t quite understand either what you are trying to do. I actually started responding right after you posted your message, and the general idea was to suggest what @gab1one has suggested, which was to use the Flow Variable ports to connect the nodes.

However, as I looked closer at your design, it looked to me that what you are asking should automatically work with your design. For the sake of more clarity, let’s name your blue node 3 as 33 and your blue node 4 as 44 just to differentiate from your white nodes. As you know in Knime, your node 2 will execute only after node 1 is complete, similarly for your node 4 will only execute after node 3 is complete. This also means that if you ever change something in node 1, node 2 will reset, similarly if node 3 is changed, node 4 is reset and will need to be re-run.

Continuing further in your design, 33 will run only if Begin and node 3 is complete, meaning if node 3 changes, node 33 will be reset, and consequently as a domino effect, nodes 4 and 44 will also reset. The same applies if node 4 is changed. But more importantly, if you want to “package” everything from begin to finish either as a component or as a node (extension), it will be plugged and connected after node 3 and 4.

From the look of it, the design is already in place so that nodes 33 and 44 will need to re-run whenever node 3 or node 4 is changed.

That was what I had written so far in my original attempt. However, as I tried to come up with an example, I could not really understand what node 33 and node 44 could be, so I could not come up with an example to support what I wrote, so I ended up scrapping everything :rofl:

1 Like

Yeah you’re right actually. I was just a bit confused.

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