构建工作流

Merge data

Merging brings multiple data streams together. You can achieve this using different nodes depending on your workflow requirements.

  • Merge data from different data streams or nodes: Use the Merge node to combine data from various sources into one.
  • Merge data from multiple node executions: Use the Code node for complex scenarios where you need to merge data from multiple executions of a node or multiple nodes.
  • Compare and merge data: Use the Compare Datasets node to compare, merge, and output data streams based on the comparison.

Explore each method in more detail in the sections below.

Merge data from different data streams

If your workflow splits, you combine the separate streams back into one stream.

Here's an example workflow showing different types of merging: appending data sets, keeping only new items, and keeping only existing items. The Merge node documentation contains details on each of the merge operations.

N8N 官方工作流示例:打开或下载工作流

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 separate data streams. This can be useful if you want to generate a single dataset from the data generated by multiple nodes.

Merging data from two previous nodes

Merge data from multiple node executions

Use the Code node to merge data from multiple node executions. This is useful in some Looping scenarios.

Refer to this example workflow using Loop Over Items and Wait to artificially create multiple executions.

N8N 官方工作流示例:打开或下载工作流

Compare, merge, and split again

The Compare Datasets node compares data streams before merging them. It outputs up to four different data streams.

Refer to this example workflow for an example.

N8N 官方工作流示例:打开或下载工作流

官方原文和授权

本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。

来源、授权与修改

本站保留许可证、固定提交号、社区作者和修改说明,不代表 n8n 对本站背书。

查看许可证查看来源和修改说明