> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/flow-logic/merging.md).

# Merge branches in Duaer

In Duaer, Merge waits until each input has data, then appends, combines by field, runs SQL, or keeps one branch.
## Pick a mode

- Append: stack items from every input into one list, in order. Any number of inputs.
- Combine: two inputs only. Matching fields lines rows up by a shared field name, and leaves a blank where one input has no match. Position lines rows up by order.
- SQL Query: use this when more than two inputs need a filter or a total. The inputs are tables in the query.
- Choose Branch: after a split, keep one input and drop the rest.

## Example: line up by a field

Both inputs have id. Set Mode to Combine, Combine By to matching fields, and the field to id.

- One input has name for id 1 and the other has city for id 1: one output item has both fields.
- Only one input has id 2: that item is still kept, and the missing field is empty.

Merge waits until every connected input has data. If one branch never runs, later nodes do not start.
## Questions

### Does Merge in Duaer rewrite the original files?

No. It only builds the items later nodes use in this execution.

