Itential has reverted the deprecation of the forEach task, allowing it to remain in the platform. As a best practice, Itential recommends using a child job loop.
In workflow design, there are scenarios where a childJobLoop is preferable to a forEach task. Using childJobLoop improves workflow readability and promotes modularity by centralizing looping logic rather than duplicating it across multiple workflows. It also provides a cleaner way to run sequential and parallel loops through a child job task.
The main components of the conversion are:
Create a new workflow containing only the tasks that were being looped in the forEach task. Cloning the original workflow and removing non-looping tasks is often the easiest approach.
In the starting workflow, the forEach task iterates over an array [1,2,3]. For each iteration, the task makes a REST call to an API endpoint.

Create a child workflow for the task being looped. Clone the original workflow and leave only the looping tasks.

In the parent workflow, remove the forEach task and replace it with childJob.

Open the task details for the child job task. Update the Workflow, Loop Type, and Loop Array fields. Use Sequential for Loop Type. Click Save.

The values passed to the child job task must be objects. Open the New Job Variable in the parent workflow and change the data_array input to [{},{},{}]. Click Save.

Click Run to execute the workflow and confirm the conversion is complete.
This example builds on the basic example above and demonstrates using a JST to map loop array values to child job inputs.
Open the New Job Variable and change data_array back to "[1,2,3]". Click Save to restore the original state.
Open the task details for the child job task. Click the + icon next to the Transformation field to create a JST that maps the Loop Array to input values for the child workflow.

On the JST page, set the outgoing schema with an id of num and a type of integer. This allows the data_array variable to be passed to the outgoing schema using the original [1,2,3] input array. Save and close the JST.

Open the task details for the viewData task. For the message variable, change Reference task to job and Reference variable to message. Click Save.

Use the JST to pass $id of message instead of num. This creates the object array [{"message":1},{"message":2},{"message":3}] that is passed to the child job task.

Save the transformation, return to the parent workflow, and click Run. After completing each child job, the Rest Call Output is visible.

If the parent workflow requires the output of the child job task, use the output data from job_details. Add a viewData task and configure it to receive job_details as input.

Pass the job_details output to the body variable.

Run the parent workflow and work through each child job’s viewData task. The job_details of the child job task appear as output per iteration.

Note that no job variables may be visible initially. To get the REST API call output, open the child job in designer mode, select the RestCall task, and check the Job Variables box under Outgoing.

After running the parent workflow again, the job_details output for each child job iteration includes the REST call results.
