It’s relatively common that, for one reason or another, you need to iterate over a resource’s items and process them one by one. For example, a request might include an array with orders that should be passed on to a different system or be saved as units on your Bosbec account.
The easiest way to do this is by using the For Each Resource Start and Stop jobs.

In the Start job, configure the following:
- Resource to iterate
Specify the resource that contains all the items you want to iterate over. - Current item name
Enter the name of a resource that will contain each individual item during its loop. - Nested for each name
This field is used if you need multiple “for each” loops within the same workflow. If the Start and Stop jobs share the same name in this field, that name is used to locate the start point of the loop once it completes.

In the Stop job, there’s only one setting:
- Nested for each name
As described in the previous image, this is used to locate a Start job with the same name in order to fetch the next item in the list and continue the loop.

From the Start job, drag an arrow to the jobs that should run for each resource. Make sure it is set to “For each.”
Then, drag another arrow to indicate the path to take once all items have been iterated over. Make sure it is set to “When completed.”

To reference and get data from the current item during the loop, use the resource name you specified in the Start job. For example:
{{one_unit.metadata.firstname}}
to get the name from a contact, or{{log_item.value}}
to get the value from a data log.
More on how to use the syntax can be found here: Working With Variables – Bosbec Help.