---
title: "Loops"
description: "Repeat a nested body over a range, list, object, or until a return says stop."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/loops"
---
# Loops

> Repeat a nested body over a range, list, object, or until a return says stop.

**Loop** blocks sit in the builder palette under **Basic → Loops**. They run a nested body once per iteration, then continue on the main **out** path. Shared graph rules are on [Workflows](https://docs.vettero.com/build/workflows); each page covers **Config** for that type.

**Callback** is a **new callback scope**, not the next step on the main path. Connect it to a [Lambda](https://docs.vettero.com/build/workflows/blocks/module/lambda) block. Everything after Lambda runs only inside that iteration (named variables from outside plus this loop’s `args.*`). End the body with [Return](https://docs.vettero.com/build/workflows/blocks/module/return) so the loop can collect a value. That return is for the callback, not for the whole workflow. [While](https://docs.vettero.com/build/workflows/blocks/loops/while) and [Do While](https://docs.vettero.com/build/workflows/blocks/loops/do-while) use a **required condition** on the block to decide whether to run again.

<table>
<thead>
  <tr>
    <th>
      Use
    </th>
    
    <th>
      Block
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Count from a start to an end
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/for">
        For
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Repeat while a condition matches
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/while">
        While
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Run once, then while a condition matches
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/do-while">
        Do While
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Walk keys and values of an object
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/for-in">
        For In
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Walk items in a list
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/for-of">
        For Of
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Stop the loop from inside the body
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/break">
        Break
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Skip this iteration and start the next
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/loops/continue">
        Continue
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Start the nested body (callback scope)
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/module/lambda">
        Lambda
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Finish the body and collect a value
    </td>
    
    <td>
      <a href="https://docs.vettero.com/build/workflows/blocks/module/return">
        Return
      </a>
    </td>
  </tr>
</tbody>
</table>

<searchable-card-grid :items="[{"title":"For","description":"Count from start to end and run the body each time.","icon":"i-lucide-repeat","to":"/build/workflows/blocks/loops/for","keywords":"for loop start end step counter iterate"},{"title":"While","description":"Run the body while a condition matches, up to a max count.","icon":"i-lucide-refresh-cw","to":"/build/workflows/blocks/loops/while","keywords":"while loop condition max iterations"},{"title":"Do While","description":"Run the body at least once, then continue while a condition matches.","icon":"i-lucide-rotate-cw","to":"/build/workflows/blocks/loops/do-while","keywords":"do while loop at least once"},{"title":"For In","description":"Run the body for each key and value in an object.","icon":"i-lucide-braces","to":"/build/workflows/blocks/loops/for-in","keywords":"for in object keys values"},{"title":"For Of","description":"Run the body for each item in a list.","icon":"i-lucide-list-ordered","to":"/build/workflows/blocks/loops/for-of","keywords":"for of array list items iterate"},{"title":"Break","description":"Stop the nearest loop from inside its body.","icon":"i-lucide-circle-stop","to":"/build/workflows/blocks/loops/break","keywords":"break stop exit loop"},{"title":"Continue","description":"Skip the rest of this iteration and start the next.","icon":"i-lucide-skip-forward","to":"/build/workflows/blocks/loops/continue","keywords":"continue skip skip iteration next loop"}]" empty="No loop blocks match that search." placeholder="Search loop blocks…">



</searchable-card-grid>

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
