🔄 ForLoop Guide

What in the H-E-Double-Hockey-Sticks is a ForLoop?

A ForLoop iterates over a list, or an array, of items. If you have to say “for each item, do xyz” you probably need a ForLoop!

We’ve designed ForLoops in Skyvern so that they contain blocks inside the Loop Block, which are run for each item in the list.Each item in the list is handled separately and passed one-by-one through the blocks within the loop.

At a High Level

Required ForLoop values

  1. Loop Value, or the list that you are iterating over
    1. The structure for a properly formatted loop value is an array (not wrapped in a JSON object)
  2. The Current Value, or a parameter placed into the block(s) within a ForLoop that allows that block to reference the current loop value
    1. The structure for adding the current value parameter is always {{blockname.current_value}}

How the ForLoop runs

Examples

1. Iterating over a provided list

Let’s say I have a list of legal cases that I want to search and extract. Here’s the ForLoop I have built:

Screenshot 2025-07-03 at 3.27.01 PM.png

Let’s talk about the Loop Value we’re passing into the Loop Block: