How to make KNIME wait for DB Update before continuing to the next loop iteration?

Hi everyone!

I’m working on a KNIME workflow that reads data from a PostgreSQL table, processes each row, generates a JSON payload, sends it via a POST Request, evaluates the response, and then updates the original row in the database using a DB Update node.

Currently, I’m using a Chunk Loop Start node to process the data in batches. However, I’m facing an issue where the next iteration begins before the DB Update has fully completed. This creates problems with record-level consistency and timing.

:mag: What I want to achieve:

I need the loop to work strictly sequentially, like this:

• One row is processed

• JSON is sent

• The response is checked

• The database is updated

Only after all of that, the next row should be processed

:bulb: Question:

What’s the proper way to build such a loop in KNIME?

Should I use Table Row to Variable Loop Start + Variable Loop End?

Or is there a better best practice for this case?

Any advice, pattern, or example workflow would be much appreciated!

Hi @_1234567891011

Add a Wait node between the DB Update and Loop End node.
image

gr. Hans

2 Likes

Hello, Hans!
Thanks a lot for ur advice

Can you confirm please if correctly understood ur advice?
I do post, then wait for next post and continue cycle

1 Like

Hi @_1234567891011

I think this should work. Don’t forget to configure the Wait node.
gr. Hans

1 Like

Thanks a lot, Hans!
You helped me!

1 Like

Hi,
I thought that the DB Update node shows “green light” if the update process is finished. Does it not?

Do you update the database line by line? When using this node I tried to do this batch wise with larger chunks like 500 rows.

Andreas