Adding a Delay within Group Loop

I’m currently experiencing a problem similar to this post My Loop Runs too fast. In my workflow I have table of data with an identifier column. I’m simply using the group loop to output each group of like identifiers to different excel sheets. When executing the loop, the first couple of groups get correctly assigned to a different sheet. However, my loop is executing to the point where its trying to write to a new sheet prior to previous one finishing. In my console I’m getting an error message that reads “The process cannot access the file because it is being used by another process.” A solution would be to implement some sort of delay before the excel writer node, but I’m not sure how to achieve this. Thanks for any suggestions
Knime Loop

Hi @JGebhard , I’m surprised at the problem. Are you saying it is still locked by the Excel Writer writing from the previous iteration of the group loop? Is the file on a network share, which could mean it takes a little longer to tidy up?

I guess you could add a Wait… node

between the Excel Writer and the Variable Loop End, with a delay of say a couple of seconds, or whatever it takes.

I’m trying to understand your workflow though. What is being supplied or orchestrated by the flow from outside of the loop? Is the sheet name being supplied by a flow variable from the Group Loop Start, or from elsewhere? Are you sure the problem isn’t that you have some kind of “race condition” going on here?

Perhaps you could post a wider screenshot showing how the group loop fits in with the rest of the workflow, in case something else is a problem.


Hey Brain, I’m not fully sure what the exact problem was, but implementing a wait node was a solution. Thanks so much, John

1 Like

Great!. Glad to hear it resolved it. And thanks for marking it as the solution :slight_smile:

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