# Merging data streams

Merging allows you to bring multiple data streams together.

To merge data from different branches or nodes, use the [Merge](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.merge) node.

To compare data, merge it, and output data streams based on the comparison, use the [Compare Datasets](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.comparedatasets) node.

## Merge data from different branches

If your workflow [splits](/guides/automated-workflows/flow-logic/splitting), use the [Merge node](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.merge) to combine the separate branches back into one branch.

Here's an [example workflow](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.merge) showing different types of merging: appending data sets, keeping only new items, and keeping only existing items. See the [Merge node](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.merge) documentation to know more about the merge operations.

## Merge data from different nodes

You can use the [Merge node](#) to combine data from two previous nodes, even if the workflow hasn't split into branches. This can be useful if you want to generate a single dataset from the data generated by multiple nodes.

## Compare, merge, and split again

The [Compare Datasets](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.comparedatasets) node compares data streams before merging them. It outputs up to four different branches.