[Yandex Cloud documentation](../../../../index.md) > [Yandex Serverless Integrations](../../../index.md) > [Step-by-step guides](../../index.md) > Workflows > [Workflow step constructor](index.md) > Control steps > Foreach

# Adding the Foreach loop

You can use the Foreach control step to set a sequence of steps to apply to each input data item. The output is an array of execution results for all steps in the sequence. Read more about the [workflow state during the Foreach step](../../../concepts/workflows/workflow.md#state-for-Foreach).

{% list tabs %}

- Management console {#console}

  1. When [creating](../workflow/create-constructor.md) a new workflow or [editing](../workflow/update.md) an existing one, in the management console, under **Create workflow** / **Edit workflow**, select `Constructor`. 
  1. From the **Control steps** section on the left side of the screen, drag the ![code-fork](../../../../_assets/console-icons/code-fork.svg) **Foreach** element to the relevant workflow location in the constructor window.

      You can drag and drop steps into areas marked by the dotted line in the workflow schema, such as **Add a step**, etc.
  1. In the workflow schema window, click the new **Foreach** section to select it.
  1. At the right of the window, on the **Settings** tab.

      1. In the **Step name** field, enter a name for the workflow step.
      1. In the **Number of input data elements processed concurrently** field, set the number of input data items the specified sequence of steps will be performed on simultaneously.
  1. Optionally, navigate to the **Input** tab and set a [jq template](../../../concepts/workflows/templating.md) to filter the [workflow state](../../../concepts/workflows/workflow.md#state) fed into the step.
  1. Optionally, navigate to the **Output** tab and set a [jq template](../../../concepts/workflows/templating.md) to filter the step outputs added into the [workflow state](../../../concepts/workflows/workflow.md#state).
  1. To add a new step to a sequence, drag the step to the area marked by the dotted line from **Integration steps** or **Control steps**.

{% endlist %}

## Useful links {#see-also}

* [YaWL specification](../../../concepts/workflows/yawl/management/foreach.md)
* [Creating a workflow using the constructor](../workflow/create-constructor.md)
* [Updating a workflow](../workflow/update.md)