---
category: [Administration & Integrations, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions, Platform and Product Extensions/Integration]
keyword: [Integrate, Workday Integration, Orchestrate for Integrations, Orchestration, Orchestration Builder]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: Batch Loop
layout: subsection
---

## Purpose

Use this component to split a dataset into batches according to size or to a custom criterion of your choosing. You can iterate through each individual batch downstream or, using a nested loop, within the batch loop.

You can aggregate data outputs from the loop. For more information, see [Add Aggregations](/wcp_docs/GUID-499f45c0-34ac-4d4e-8d46-f9719549acfe-enHYPHENus.html).

## <a id="d531e104"></a>Template Availability

This component is available in these orchestration templates:

-   Synchronous
-   Asynchronous
-   Business Process
-   Home Card
-   Integration System
-   Custom Agent Action


## <a id="d531e132"></a>Properties

Provide a meaningful <b>Reference Name</b> for the step as it will appear in your orchestration.

Select the <b>Data Type</b> of the iterator you want to use to loop through the specified batch. When you select the <i>AutoType</i> iterator, Orchestrate determines the iterator type for you and adjusts automatically if that type changes.

Use Expression Builder to specify the relevant <b>Data Set</b> and to <b>Filter</b> its contents.

Select a batching <b>Strategy</b>, either <i>Size</i>, <i>Custom</i>, or <i>Group</i>.

<b>Size Strategy</b>

Use Expression Builder to define the <b>Data Breakpoint Number</b>, that is, the number of items in each batch.

<b>Custom Strategy</b>

For a custom strategy, use the <b>Form Batch</b> drop-down list to select either <i>At</i> or <i>After</i> and use Expression Builder to define the item that begins a batch.

If you select <i>At</i>, Orchestration Builder creates a batch that includes the specified item. If you select <i>After</i>, it creates a batch that begins immediately after the specified item.

Select an<b>Iterator Data Type</b>.

Select the <b>Keep Leading Items</b> check box to create a batch of the items that came before the specified item.

Example:

Input dataset is a `NumberList` type containing the items `[1,2,3,4,5,6,7]`.

A strategy of <b>Form Batch</b> <i>At</i> with a specified item of `5` gives this output when <b>Keep Leading Items</b> is clear: `[5,6,7]`.

With <b>Keep Leading Items</b> selected, it gives this output: `[1,2,3,4], [5,6,7]`.

A strategy of <b>Form Batch</b> <i>After</i> with a specified item of `5` gives this output when <b>Keep Leading Items</b> is clear: `[6,7]`.

With <b>Keep Leading Items</b> selected, it gives this output: `[1,2,3,4,5], [6,7]`.

<b>Group Strategy</b>

In the <b>Group By</b> expression field, specify an expression by whose value the items will be grouped before they enter the loop for processing. The expression must yield a Number or a String. Example: grouping a list of customers by location.

In the <b>Group Name</b> field, provide a name for the group so you can reference it in downstream steps, if required.

Click <b>Add Group By</b> to create another grouping rule. When multiple grouping rules exist, Orchestrate processes them in order, creating groups based on the first rule, then applying the second rule individually to each group, and so on.

You can drag and drop grouping rule configurations to reorder them. Click the arrow beside the <b>Group By</b> field to toggle between ascending and descending order.

Use the <b>Sort By</b> expression field to specify a data element by which items will be sorted before they enter the loop for processing. Example: sorting a list of inventory items by part number.

<b>Note:</b> Orchestrate sorts items in each batch individually, rather than sorting the entire dataset.

Click <b>Add Sort By</b> to create another sorting rule. When multiple sorting rules exist, Orchestrate processes them in order, sorting the list based on the first rule, then applying the second rule to the sorted list, and so on.

You can drag and drop sorting rule configurations to reorder them. Click the arrow beside the <b>Sort By</b> field to toggle between ascending and descending order.

<b>Note:</b> Orchestrate sorts text types lexicographically and numeric types numerically.

Sorting and grouping by string can produce different results in different languages. To specify a language for the purposes of the batch loop, use the <b>Locale</b> expression field. Doing so temporarily overrides the <b>Default Locale</b> specified in your app's <b>Settings</b>.

