Skip to content

移除重复节点#

¥Remove Duplicates node

使用 Remove Duplicates 节点识别并删除以下项目:

¥Use the Remove Duplicates node to identify and delete items that are:

  • 在单次执行中,所有字段或部分字段完全相同。

¥identical across all fields or a subset of fields in a single execution

  • 与先前执行中出现的项相同或更差。

¥identical to or surpassed by items seen in previous executions

在可能出现重复数据的情况下,例如用户创建多个账户或客户多次提交同一订单,此功能会很有帮助。处理大型数据集时,查找和删除这些项会变得更加困难。

¥This is helpful in situations where you can end up with duplicate data, such as a user creating multiple accounts, or a customer submitting the same order multiple times. When working with large datasets it becomes more difficult to spot and remove these items.

通过与先前执行的数据进行比较,“删除重复项”节点可以删除先前执行中出现的项。还可以确保新条目的日期晚于或值高于先前的值。

¥By comparing against data from previous executions, the Remove Duplicates node can delete items seen in earlier executions. It can also ensure that new items have a later date or a higher value than previous values.

Major changes in 1.64.0

n8n 团队在 n8n 1.64.0 版本中对该节点进行了全面改进。本文档反映了节点的最新版本。如果你使用的是旧版本的 n8n,可以在 此处 中找到此文档的先前版本。

¥The n8n team overhauled this node in n8n 1.64.0. This document reflects the latest version of the node. If you're using an older version of n8n, you can find the previous version of this document here.

操作模式#

¥Operation modes

删除重复项节点的工作方式取决于操作参数的值:

¥The remove duplication node works differently depending on the value of the operation parameter:

¥Remove Items Repeated Within Current Input: Identify and remove duplicate items in the current input across all fields or a subset of fields.

¥Remove Items Processed in Previous Executions: Compare items in the current input to items from previous executions and remove duplicates.

¥Clear Deduplication History: Wipe the memory of items from previous executions.

移除当前输入中的重复项#

¥Remove Items Repeated Within Current Input

当你将 "操作" 字段设置为“移除当前输入中重复的项目”时,“移除重复项”节点会识别并移除当前输入中的重复项目。它可以处理所有字段,也可以处理部分字段。

¥When you set the "Operations" field to Remove Items Repeated Within Current Input, the Remove Duplicate node identifies and removes duplicate items in the current input. It can do this across all fields, or within a subset of fields.

移除当前输入中的重复项参数#

¥Remove Items Repeated Within Current Input parameters

使用“移除当前输入中重复的项目”操作时,可以使用以下参数:

¥When using the Remove Items Repeated Within Current Input operation, the following parameter is available:

  • 比较:选择输入数据 n8n 需要比较的字段,以检查它们是否相同。可以使用以下选项:

¥Compare: Select which fields of the input data n8n should compare to check if they're the same. The following options are available:

  • 所有字段:比较输入数据的所有字段。

    ¥All Fields: Compares all fields of the input data.

  • 除以下情况外的所有字段:请输入 n8n 应从比较中排除的输入数据字段。你可以提供多个值,以逗号分隔。

    ¥All Fields Except: Enter which input data fields n8n should exclude from the comparison. You can provide multiple values separated by commas.

  • 已选字段:请输入 n8n 应包含在比较中的输入数据字段。你可以提供多个值,以逗号分隔。

    ¥Selected Fields: Enter which input data fields n8n should include in the comparison. You can provide multiple values separated by commas.

移除当前输入中的重复项选项#

¥Remove Items Repeated Within Current Input options

如果选择“除指定字段外的所有字段”或“选定字段”作为比较类型,则可以添加以下选项:

¥If you choose All Fields Except or Selected Fields as your compare type, you can add these options:

  • 禁用点号表示法:设置是否使用点号表示法引用格式为 parent.child 的子字段(关闭)或不使用(开启)。

¥Disable Dot Notation: Set whether to use dot notation to reference child fields in the format parent.child (turned off) or not (turn on).

  • 从群组中移除用户设置是否移除比较中未使用的字段(启用)或不移除(禁用)。

¥Remove Other Fields: Set whether to remove any fields that aren't used in the comparison (turned on) or not (turned off).

移除先前执行中已处理的项目#

¥Remove Items Processed in Previous Executions

当你将 "操作" 字段设置为“移除先前执行中已处理的项目”时,“移除重复项”节点会将当前输入中的项目与先前执行中的项目进行比较。

¥When you set the "Operation" field to Remove Items Processed in Previous Executions, the Remove Duplicate node compares items in the current input to items from previous executions.

移除先前执行中已处理的项目选项参数#

¥Remove Items Processed in Previous Executions parameters

使用“移除先前执行中已处理的项目”操作时,可以使用以下参数:

¥When using the Remove Items Processed in Previous Executions operation, the following parameters are available:

  • 保留项目位置:选择 n8n 如何决定保留哪些项目。可以使用以下选项:

¥Keep Items Where: Select how n8n decides which items to keep. The following options are available:

  • 值是否为新值:如果项的值与之前执行的项的值相同,n8n 会移除项。

    ¥Value Is New: n8n removes items if their value matches items from earlier executions.

  • 值高于任何先前的值:如果当前值不高于之前的值,n8n 会移除项。

    ¥Value Is Higher than Any Previous Value: n8n removes items if the current value isn't higher than previous values.

  • 日期晚于任何先前的日期:如果当前日期不晚于之前的日期,n8n 会移除日期项。

    ¥Value Is a Date Later than Any Previous Date: n8n removes date items if the current date isn't later than previous dates.

  • 去重条件:要比较的输入字段。你为“保留项位置”参数选择的选项决定了你需要的确切格式:

¥Value to Dedupe On: The input field or fields to compare. The option you select for the Keep Items Where parameter determines the exact format you need:

  • 使用“值是新的”时,此字段必须是一个具有唯一 ID 的输入字段或字段组合。

    ¥When using Value Is New, this must be an input field or combination of fields with a unique ID.

  • 使用“值高于任何先前值”时,此字段必须是一个具有递增值的输入字段或字段组合。

    ¥When using Value Is Higher than Any Previous Value, this must be an input field or combination of fields that has an incremental value.

  • 使用“值是晚于任何先前日期的日期”时,此字段必须是一个具有 ISO 格式日期值的输入字段。

    ¥When using Value Is a Date Later than Any Previous Date, this must be an input field that has a date value in ISO format.

移除先前执行中已处理的项目选项#

¥Remove Items Processed in Previous Executions options

使用“移除先前执行中已处理的项目”操作时,可以使用以下选项:

¥When using the Remove Items Processed in Previous Executions operation, the following option is available:

  • 范围:设置 n8n 如何存储和使用去重数据进行比较。可以使用以下选项:

¥Scope: Sets how n8n stores and uses the deduplication data for comparisons. The following options are available:

  • 节点:(默认)独立于工作流中其他“删除重复项”实例,存储此节点的数据。使用此作用域时,你可以针对当前节点实例使用 清除重复历史记录,而不会影响其他节点。

    ¥Node: (default) Stores the data for this node independently from other Remove Duplicates instances in the workflow. When you use this scope, you can clear the duplication history for this node instance without affecting other nodes.

  • 工作流:在工作流级别存储重复数据。此设置会将重复数据与任何其他设置为使用 "workflow" 范围的“删除重复项”节点共享。n8n 仍会独立管理其他设置为 "node" 范围的“删除重复项”节点的重复数据。

    ¥Workflow: Stores the duplication data at the workflow level. This shares duplication data with any other Remove Duplicate nodes set to use "workflow" scope. n8n will still manage the duplication data for other Remove Duplicate nodes set to "node" scope independently.

选择“值是新的”作为“保留项位置”时,也可以选择此选项:

¥When you select Value Is New as your Keep Items Where choice, this option is also available:

  • 历史记录大小:n8n 用于跟踪跨执行重复项的存储项数。“范围”选项的值决定此历史记录大小是特定于此“删除重复节点”实例,还是与工作流中的其他实例共享。默认情况下,n8n 存储 10,000 个项。

¥History Size: The number of items for n8n to store to track duplicates across executions. The value of the Scope option determines whether this history size is specific to this individual Remove Duplicate node instance or shared with other instances in the workflow. By default, n8n stores 10,000 items.

清除数据去重历史记录#

¥Clear Deduplication History

当你将 "操作" 字段设置为“清除数据去重历史记录”时,“删除重复项”节点会管理并清除先前执行过程中存储的重复项。此操作不会影响当前输入中的任何项目。与其管理 "移除先前执行中已处理的项目" 操作使用的项目数据库,不如管理它。

¥When you set the "Operation" field to Clear Deduplication History, the Remove Duplicates node manages and clears the stored items from previous executions. This operation doesn't affect any items in the current input. Instead, it manages the database of items that the "Remove Items Processed in Previous Executions" operation uses.

清除数据去重历史记录参数#

¥Clear Deduplication History parameters

使用“清除数据去重历史记录”操作时,可以使用以下参数:

¥When using the Clear Deduplication History operation, the following parameter is available:

  • 模式:你希望如何管理数据库中存储的键/值对项。以下选项可用:

¥Mode: How you want to manage the key / value items stored in the database. The following option is available:

  • 清理数据库:删除数据库中存储的所有重复数据。此操作会将重复数据数据库重置为初始状态。

    ¥Clean Database: Deletes all duplication data stored in the database. This resets the duplication database to its original state.

清除数据去重历史记录选项#

¥Clear Deduplication History options

使用“清除数据去重历史记录”操作时,可以使用以下选项:

¥When using the Clear Deduplication History operation, the following option is available:

  • 范围:设置 n8n 在管理重复数据库时使用的范围。

¥Scope: Sets the scope n8n uses when managing the duplication database.

  • 节点:(默认)管理此“删除重复项”节点实例特有的重复项数据库。

    ¥Node: (default) Manages the duplication database specific to this Remove Duplicates node instance.

  • 工作流:管理所有使用工作流范围的“删除重复项”节点实例共享的重复项数据库。

    ¥Workflow: Manages the duplication database shared by all Remove Duplicate node instances that use workflow scope.

模板和示例#

¥Templates and examples

有关使用“删除重复项”节点的模板及其使用示例,请参阅 模板和示例

¥For templates using the Remove Duplicates node and examples of how to use it, refer to Templates and examples.

相关资源#

¥Related resources

Learn more about data structure and data flow in n8n workflows.