# Lists and batching

> Process many prompts, images or rows in one workflow. A node runs once per list item, and Collect, Selector and Choose Best turn many results back into one.

Source: https://nodaro.ai/docs/concepts/lists-and-batching

A **list** is a set of items that a workflow processes together: prompts, images, videos, audio files or the rows of a table. **Fan-out** runs a node once for every item, so ten prompts become ten images. **Fan-in** turns many results back into one, for example by stitching clips into one video or by letting an AI judge choose the best image.

## How it works

Workflow: Five prompts fan out into five images. Choose Best judges the five images and passes only the winner on, so the video runs once.

- List → Generate Image (prompt)
- Generate Image → Choose Best (candidates)
- Choose Best → Generate Video (start frame)

The **connection mode** decides whether a list is processed item by item or all at once. A connection in **Each** mode runs the next node once per item. A connection in **Bundle** mode hands the whole list over in one run. [Nodes and connections](https://nodaro.ai/docs/concepts/nodes-and-connections#connection-modes) explains every mode.

## Where lists come from

| Source | What it gives you |
| --- | --- |
| [List](https://nodaro.ai/docs/nodes/automate/list) | Items that you type, paste or upload, one per row. The List can grow into a table with several typed columns. Free. |
| [Split Text](https://nodaro.ai/docs/nodes/automate/split-text) | One text cut into items at every new line, at every comma, or at a separator you choose. Free. |
| [Prompt](https://nodaro.ai/docs/nodes/automate/prompt) | The **items** output splits the model's answer wherever it contains `===NEXT===`, so one answer can become many prompts. |
| A node with several results | A node you ran several times, for example with **Repeat**, holds several versions that a connection can pass as a list. |
| [Collect](https://nodaro.ai/docs/nodes/automate/collect) | The results of several separate nodes, gathered into one list for each kind of media. Free. |

## Fan-out: one run per item

When a connection in **Each** mode carries a list into a node, the node runs once for every item and keeps every result. Connections from a List and from Split Text use **Each** by default.

- **Items replace the typed prompt.** Each item becomes the prompt of its run. It replaces the prompt typed on the node instead of being added to it. For a row whose prompt is empty, the typed prompt is used.
- **Items run one after another.** A node processes its items in order, from the first row to the last. More items mean a longer run.
- **Chains stay paired.** When the next node also receives the results through an **Each** connection, it runs once per result, in the same order. Five prompts give five images and then five videos, not twenty-five.
- **Repeat multiplies.** With **Repeat** set to 2 on a node, every item runs twice.
- **Credits multiply.** The node costs its price times the number of items, times the **Repeat** count. When five items reach a node that costs 4 credits, the node costs 20 credits. The **Run** button shows the total before you run.

**Badges show the batch.** Before a run, the header of a node that will fan out shows the number of runs, such as `x5`. During the run it shows the progress, such as `3/5`, and a **Processing list...** bar that reads **Complete** at the end.

**Failures stay local.** When one item fails, the items that succeeded keep their results, and the failed item's credits are refunded.

## Tables: several values per run

A [List](https://nodaro.ai/docs/nodes/automate/list) starts as one column of text. When one run needs more than one value, for example a prompt and a reference image, the List becomes a table.

1. Connect a node to the **+** input at the bottom left of the List. A new column appears.
2. Set the type of each column: text, image, video, audio or JSON. Each column has its own input and its own output.
3. Connect each column's output to the input of the node that needs it, for example the prompt column to **Prompt** and the image column to **References**.

The rows pair up as follows:

- **Row 3 stays row 3.** Every input of a run gets its value from the same row. An empty cell gives nothing to that input for that run, and the rows below do not move up.
- **A row runs when any of its cells has a value.** A row that is empty in every column is ignored, so the blank row at the bottom never adds a run.
- **The order of the connections does not matter.** The column connected to the prompt input supplies the prompt, whichever connection you drew first. A column connected to **Negative** is never used as the prompt.
- **Lists of different lengths repeat.** When two lists with a different number of rows feed one node, the longer list sets the number of runs. The shorter list starts again from its first row when it runs out.
- **Only Each fans out.** A column connected in **Bundle** mode hands its whole list over in a single run.

On the canvas, a List shows either a compact summary, such as "4 rows × 2 cols", or the full table or gallery. A small button under the node switches between the two views. A table with images, videos or audio opens in the gallery view by default.

## Fan-in: from many results to one

| What you want | Use |
| --- | --- |
| Combine every item in one run, such as clips into one video | A **Bundle** connection into a node that combines, such as [Combine Videos](https://nodaro.ai/docs/nodes/video/combine-videos), [Mix Audio](https://nodaro.ai/docs/nodes/audio/mix-audio) or [Combine Audio](https://nodaro.ai/docs/nodes/audio/combine-audio) |
| Keep one item, such as the first or the last | An **Item** connection, or a [Selector](https://nodaro.ai/docs/nodes/automate/selector) node |
| Let an AI judge choose the best result | [Choose Best](https://nodaro.ai/docs/nodes/automate/choose-best) with **AI picks the best** |
| Join texts, count results, or keep the most common answer | [Choose Best](https://nodaro.ai/docs/nodes/automate/choose-best) with a free option |
| Gather the results of several different nodes | [Collect](https://nodaro.ai/docs/nodes/automate/collect) |

### Choose Best

The [Choose Best](https://nodaro.ai/docs/nodes/automate/choose-best) node turns a list of candidates into one result. Choose what it does under **What to do with the candidates**:

| Option | What it returns | Credits |
| --- | --- | --- |
| **AI picks the best** | The candidate that an AI judge finds best against your criteria, with a one-sentence reason | 3, 10 or 25, by the judge's tier |
| **Join into one text** | Every candidate in one text, with a separator you choose | Free |
| **First that has content** | The first candidate that is not empty | Free |
| **Count them** | How many candidates arrived | Free |
| **Most common answer** | The candidate that appears most often. A tie goes to the first. | Free |
| **Merge JSON objects** | One JSON object, merged **Deep** or **Shallow** | Free |

For **AI picks the best**, set three things:

- **AI Model**: the judge. An **Economy** model costs 3 credits, a **Standard** model 10 credits and a **Premium** model 25 credits. Standard is the default.
- **Judge by**: what a winner looks like, for example "the most eye-catching cover for a dark editorial feed, readable as a thumbnail".
- **The candidates are**: **Texts** or **Images**. Choose **Images** when the candidates are pictures, because on **Texts** the judge compares only the links of the pictures.

The node shows the chosen result, its position among the candidates and the judge's reason. The **Candidates** tab of the settings panel lists every candidate and marks the chosen one. Five images judged by a Standard model cost the five images plus 10 credits.

**Empty candidates are ignored.** A failed item leaves an empty candidate, and Choose Best removes empty candidates first. **Count them** therefore counts only the items that succeeded. When every candidate is empty, **Join into one text** returns an empty text and **Count them** returns `0`. The other options fail, and the nodes after Choose Best do not run.

### Collect

The [Collect](https://nodaro.ai/docs/nodes/automate/collect) node gathers the results of any number of nodes into four lists, one for each kind: text, image, video and audio. Its four outputs are always there, so you can connect the next nodes before anything has run. Drag the rows in its settings panel to change the order of the items. Collect is free.

Connect Collect to a [Choose Best](https://nodaro.ai/docs/nodes/automate/choose-best) node to compare results that came from different nodes, for example three covers made by three different models.

### Selector

The [Selector](https://nodaro.ai/docs/nodes/automate/selector) node picks items from a list and has two outputs: **picked**, the items it chose, and **rest**, every other item. Use it instead of an **Item** or range connection when several nodes need the same selection, or when you need a mode that connections do not have.

| Mode | What it picks |
| --- | --- |
| **Item (single index)** | One item, such as `3`, `last` or `last-1` |
| **Range (from/to/step)** | A range of items, such as items 2 to 4 |
| **List (comma expression)** | The items of an expression, such as `1, 3, 5..last` |
| **Random (seeded)** | A random sample. The same seed always gives the same pick. |
| **Modulo (cycle by index)** | The item at a position that cycles through the list |
| **Predicate (filter)** | The items whose field matches a condition, such as a score above 15 |
| **Named key (look up)** | The item whose field has a given value, such as the item named "hero" |

A Selector never stops the workflow because of a setting: an index that is out of range, or an expression it cannot read, falls back to a sensible pick. Selector is free.

## Other list tools

The **Lists & Batching** family of the node picker also has [Filter List](https://nodaro.ai/docs/nodes/automate/filter-list), to keep the items that match conditions, [Sort List](https://nodaro.ai/docs/nodes/automate/sort-list), [Remove Duplicates](https://nodaro.ai/docs/nodes/automate/remove-duplicates) and [Merge Lists](https://nodaro.ai/docs/nodes/automate/merge-lists), to join two lists end to end or item by item. All four are free.

## Tips

- **One idea per item.** Each item should be a complete prompt or value on its own.
- **Test with a short list.** Run a list of two or three items first, check the results, then add the rest.
- **Split large batches.** A very large list makes one long run. Several smaller lists are easier to check.
- **Close every fan-out.** When a batch should end in one result, finish it with Choose Best, a **Bundle** connection or an **Item** connection.
- **Use variables in items.** Items can contain [prompt variables](https://nodaro.ai/docs/concepts/prompt-variables), such as `{Style}`, so that every run shares the same wording.

## Frequently asked questions

### How do I make ten images from ten prompts?

Put the ten prompts in a List node, one per row, and connect the List to the Prompt input of Generate Image. The connection uses Each mode, so Generate Image runs ten times and keeps ten results.

### How many credits does a batch cost?

The price of the node multiplied by the number of items, and by the Repeat count when you set one. Five items into a node that costs 4 credits cost 20 credits. The Run button shows the total before you run.

### What happens when one item of a batch fails?

The other items keep their results, and the credits of the failed item are refunded. Choose Best ignores the empty result of a failed item, so Count them counts only the items that succeeded.

### How do I keep only the best result of a batch?

Connect the batch to a Choose Best node and choose AI picks the best. Describe what a winner looks like in Judge by, and choose Images when the candidates are pictures.

### What is the difference between Collect and Choose Best?

Collect gathers the results of several nodes into one list for each kind of media. Choose Best turns a list of candidates into one result, by an AI judgement, a count, a join or a vote.
