Adding the Foreach loop
Note
Currently, there are two UIs that support Workflows: Yandex Cloud
- Workflows created in the Yandex Cloud UI are automatically available in the AI Studio UI.
- Workflows created in the AI Studio UI are not available in the Yandex Cloud UI.
Starting September 3, 2026, Workflows will no longer be supported in the Yandex Cloud UI. To create and manage workflows, use the AI Studio UI.
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.
Tip
There is an {{ in the field.
-
When creating a new workflow or editing an existing one, in the management console, under Create workflow / Edit workflow, select
Constructor. -
From the Control steps section on the left side of the screen, drag the
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.
-
In the workflow schema window, click the new Foreach section to select it.
-
At the right of the window, on the Settings tab.
-
In the Step name field, enter a name for the workflow step.
- 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.
-
-
Optionally, navigate to the Input tab and set a jq template to filter the workflow state fed into the step.
-
Optionally, navigate to the Output tab and set a jq template to filter the step outputs added into the workflow state.
-
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.