Flow.Documentation
ProfessionalWorkflows

Stop the loop and Next item

7 steps± 5 minVideoVerified 22 Oct 2026
  1. Step 1 · Open Flow and create a workflow
  2. Step 2 · A list of products and a loop
  3. Step 3 · A rule inside the loop
  4. Step 4 · Yes: Next item
  5. Step 5 · No: remember and Stop the loop
  6. Step 6 · Put the steps in one line and save
  7. Step 7 · Run

Inside a loop you sometimes do not want to finish everything. With Next item (continue) you skip the rest of this pass and go on with the next item. With Stop the loop (break) you stop altogether: the workflow continues after the loop. Both only exist inside a loop, usually after an If / Else. Here you look for the first product that is sold out.

Watch the whole guide as a video7 steps in one film
Step 1 / 7

Open Flow and create a workflow

In the portal, under Environments, click Development and there Open; Flow opens in a new tab. There, click + next to General, choose New workflow and give it a name. A new workflow starts with an Event trigger: the point where it begins.

  1. Click Development
Open Flow and create a workflow · Click Development
  1. Click Open ↗
Open Flow and create a workflow · Click Open ↗
  1. Click Add to General
Open Flow and create a workflow · Click Add to General
  1. Click New workflow
Open Flow and create a workflow · Click New workflow
  1. In Workflow name, type Guide · first sold-out product
Open Flow and create a workflow · In Workflow name, type Guide · first sold-out product
Step 2 / 7

A list of products and a loop

Put a list of products with their stock in the trigger's sample data. Add a Loop over products and call the current item product.

  1. Click the step ‘Event trigger’
A list of products and a loop · Click the step ‘Event trigger’
  1. Click Code
A list of products and a loop · Click Code
  1. In the sample data, type `{
A list of products and a loop · In the sample data, type `{; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
  1. Click Add node
A list of products and a loop · Click Add node
  1. Click Loop
A list of products and a loop · Click Loop
  1. In Name, type Per product
  2. In Which list do you want to process? The list comes from the previous node., type products
  3. In Name of the current item Steps read the item as {{product.naam}}., type product
A list of products and a loop · In Name, type Per product; In Which list do you want to process? The list comes from the previous node., type products; In Name of the current item Steps read the item as {{product.naam}}., type product
  1. Click the dot of ‘Event trigger’
A list of products and a loop · Click the dot of ‘Event trigger’
  1. Click the dot of ‘Per product’
A list of products and a loop · Click the dot of ‘Per product’
Step 3 / 7

A rule inside the loop

At the bottom of the loop, choose If / Else under Add step: is product.stock greater than 0?

  1. In Add step, choose If / Else
A rule inside the loop · In Add step, choose If / Else
  1. In Name, type In stock?
  2. In Which field to check?, type product.stock
  3. In **Comparison Equals Does not equal Is greater than Is greater than or equal to Is **, choose Is greater than
  4. In Value, type 0
A rule inside the loop · In Name, type In stock?; In Which field to check?, type product.stock; In **Comparison Equals Does not equal Is greater than Is greater than or equal to Is **, choose Is greater than; In Value, type 0
Step 4 / 7

Yes: Next item

If the product is in stock, there is nothing to do: choose Next item under Add step and connect the Yes exit to it. Whatever would come after it in this pass is skipped.

  1. In Add step, choose Next item
Yes: Next item · In Add step, choose Next item
  1. Click exit Yes of ‘In stock?’
Yes: Next item · Click exit Yes of ‘In stock?’
  1. Click the dot of ‘Next item’
Yes: Next item · Click the dot of ‘Next item’
Step 5 / 7

No: remember and Stop the loop

If the stock is 0, remember the name with Transform data (sold_out = {{product.name}}) and then choose Stop the loop. Connect No → Remember product → Stop the loop. The rest of the list is not looked at any more.

  1. In Add step, choose Transform data
No: remember and Stop the loop · In Add step, choose Transform data
  1. In Name, type Remember product
No: remember and Stop the loop · In Name, type Remember product
  1. Click Remove field
No: remember and Stop the loop · Click Remove field
  1. Click Remove field
No: remember and Stop the loop · Click Remove field
  1. In New field, type sold_out
  2. In sold_out, type {{product.name}}
No: remember and Stop the loop · In New field, type sold_out; In sold_out, type {{product.name}}
  1. In Add step, choose Stop the loop
No: remember and Stop the loop · In Add step, choose Stop the loop
  1. Click exit No of ‘In stock?’
No: remember and Stop the loop · Click exit No of ‘In stock?’
  1. Click the dot of ‘Remember product’
No: remember and Stop the loop · Click the dot of ‘Remember product’
  1. Click the dot of ‘Remember product’
No: remember and Stop the loop · Click the dot of ‘Remember product’
  1. Click the dot of ‘Stop the loop’
No: remember and Stop the loop · Click the dot of ‘Stop the loop’
Step 6 / 7

Put the steps in one line and save

Select the steps (click the first, and the others while holding Shift) and click Align horizontally: they then stand in one line and you read the workflow from left to right; a branch (such as No of an If / Else) gets its own row below. Fit to view puts everything in sight; then Save.

  1. Click ‘Event trigger’
Put the steps in one line and save · Click ‘Event trigger’
  1. Click ‘Per product’ while holding Shift
Put the steps in one line and save · Click ‘Per product’ while holding Shift
  1. Click Align horizontally
Put the steps in one line and save · Click Align horizontally
  1. Click Fit to view
Put the steps in one line and save · Click Fit to view
  1. Click Save
Put the steps in one line and save · Click Save
Step 7 / 7

Run

At the bread and the croissant the loop went on to the next item. At the apple pie it stopped: after three passes, the currant bun was not looked at. After the loop the product found is ready, and loop.stopped is true.

  1. Click Run
Run · Click Run
Run · Status: Completed.
Run · On to the next item.
Run · Loop stopped after 3 passes.
Run · sold_out: Apple pie.

This guide was carried out step by step on 22 Oct 2026 by an automated test on Flow (version 3e563176).