# Batch Concatenation

This function block merges multiple batch/list inputs into a single combined batch. Use it when you want to join several lists of items (for example images, detections, or generic data lists) into one list for downstream processing.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

* `Batch`\
  One or more batch/list inputs. Each input can contain a list of items (images, detections, generic values). Inputs are accepted as batch sockets.
* `Batch`\
  A second batch/list input (the block accepts multiple batch inputs when added).

## 📤 Outputs <a href="#outputs" id="outputs"></a>

* `Batch`\
  A single batch/list output that contains the concatenation of all provided input lists, preserving item order.

## 🕹️ Controls <a href="#controls" id="controls"></a>

This function block has no user-facing controls. It operates automatically using the provided inputs.

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

When the scenario runs, the block collects the lists provided on its batch inputs, merges them by appending items from each input in order, and outputs one combined batch. Empty inputs result in an unchanged merged list (items from other inputs are preserved).

## 🎯 Features <a href="#features" id="features"></a>

* Simple list merging: concatenates multiple lists into a single list.
* Preserves original order of items from each input.
* Accepts generic batch/list items (images, numbers, dictionaries, etc.).

## 📝 How to use <a href="#usage" id="usage"></a>

1. Feed one or more batch/list outputs into the block's batch inputs.
2. Connect the block's single batch output to downstream blocks that expect a list or batch.
3. Use this when you need to combine parallel branches (for example, outputs from separate cameras or parallel detectors) back into a single processing stream.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Combine with `Debatch` when you need to split a merged batch back into individual elements for per-item processing.
* Use `Get Batch Size` to inspect how many items are in the merged batch.
* Use `Get Element` to extract specific items from the merged batch by index.
* If you need to process large lists memory-efficiently, pair with `Batch Processing` to handle items in smaller chunks.
* To filter out missing or invalid entries before merging, use `Exclude Nones` or `Replace None` on incoming lists.
* Common downstream consumers of merged image batches include `Collage Images`, `Image Concatenate`, `Image Logger`, or any detector/analysis block that accepts image lists.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If the merged batch appears empty: verify each input batch contains items and that inputs are actually connected.
* If order matters, ensure inputs are provided in the desired sequence since the block preserves input order when concatenating.
* If some items are unexpected (e.g., None), use filtering blocks like `Exclude Nones` before merging.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/data-logic/flow-control/batch-concatenation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
