> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create batches by combining items

> Combines multiple input items into a single output item.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Combines multiple input items into a single output item. Use this step when the items flowing through your route need to be grouped together before the next step handles them, for example to send products to an external system in batches of 100 instead of one at a time, or to bundle a day's orders into a single file. It collects the items as they arrive and emits them together as one item, with the collected items stored under a path you choose.

This documentation describes: [Schema](/schemas/transformer-step/batch-creator)

## Fields

<FormField property="batchSize" label="Batch size">
  The largest number of items to put in one batch. Once a batch reaches this size it is emitted and a fresh batch starts collecting. Leave it empty to combine every item into a single batch (the field reads "Unlimited" when empty). Must be at least 1. When the items run out before a batch is full, the leftover items are still emitted as a final, smaller batch.
</FormField>

<FormField property="destination" label="Destination path" uiPatterns="path">
  Where the collected items are stored inside each result item. Supports dot notation, so `order.lines` nests the items under an `order` key. Leave it empty to use the default path `items`.
</FormField>

<FormField property="itemType" label="Entity schema" diType="entity">
  The entity schema describing the shape of the result items that hold the batches. Leave it empty to use the default entity. You only need to set this when a later step expects a specific schema for the combined items.
</FormField>

## Sample data

This step combines the items passing through a route, so it runs as part of a route rather than on its own. A typical configuration that bundles incoming items into batches of 100, stored under an `items` path, looks like this:

| Field            | Value   |
| ---------------- | ------- |
| Batch size       | `100`   |
| Destination path | `items` |

With this configuration, every 100 incoming items are combined into one output item whose `items` path holds those 100 items. If fewer than 100 items remain at the end, they are combined into a final, smaller batch.

```json Configuration theme={null}
{
  "prototype": "batch-creator",
  "parameters": {
    "batchSize": 100,
    "destination": "items"
  }
}
```
