Iterate through data with the Loop block
Learn how to run queries for each item in a data set during a workflow.
A new version of the Loop block is currently in beta.
A Loop block contains an embedded block which runs for each evaluated item in an array. You use value
and index
to reference evaluated items and their indexes.
For example, you can automate a welcome email to new customers and customize the message for each recipient, using values like {{ value.email }}
and {{ value.name }}
.
Loop models
The default mode for Loop blocks is GUI. This mode automatically configures the loop to iterate through the query data you select from the Loop input dropdown. If you require more complex loop logic, use Code. This allows you to configure the JavaScript code used by the Loop block. You must specify the query data through which to loop using value
or index
.
The lambda operation is run on each item in the loop input. Operations are generally resource queries but you can also write custom JavaScript.
Configure block settings
Toggle Retry per iteration or Retry entire loop to configure retry settings for the query that runs for each item or the loop itself.
You can configure the following settings for Response blocks.