Skip to main content

Compare lists and identify common items & differences using custom keys

Workflow preview

Workflow preview
100%
Compare lists and identify common items & differences using custom keys preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow compares two lists of objects (List A and List B) using a user specified key (e.g. , , ) and returns: Items common to both lists (based on the key) Items only in List A Items only in ...

Best for

  • Engineering automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.switch, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Tenkay.

Original n8n.io source

1.1 Workflow description

Title
Compare lists and identify common items & differences using custom keys
Workflow name
Compare lists and identify common items & differences using custom keys

This workflow compares two lists of objects (List A and List B) using a user-specified key (e.g. email, id, domain) and returns:

  • Items common to both lists (based on the key)
  • Items only in List A
  • Items only in List B

How it works:

  1. Accepts a JSON input containing:
    • listA: the first list of items
    • listB: the second list of items
    • key: the field name to use for comparison
  2. Performs a field-based comparison using the specified key
  3. Returns a structured output:
    • common: items with matching keys (only one version retained)
    • onlyInA: items found only in List A
    • onlyInB: items found only in List B

Example Input:

{
  "key": "email",
  "listA": [
    { "email": "[email protected]", "name": "Alice" },
    { "email": "[email protected]", "name": "Bob" }
  ],
  "listB": [
    { "email": "[email protected]", "name": "Bobby" },
    { "email": "[email protected]", "name": "Carol" }
  ]
}

Output:

Use Cases:

  • Deduplicate data between two sources
  • Find overlapping records
  • Identify new or missing entries across systems

This workflow is useful for internal data auditing, list reconciliation, transaction reconciliation, or pre-processing sync jobs.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 2 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 5 - validation_message 1

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - validation_message 2

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - validation_message 3

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

3. Summary Table

Workflow Compare lists and identify common items & differences using custom keys
Complexity intermediate
Nodes 7
Categories Engineering
Author Tenkay
Published 18 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5033/5033.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Compare lists and identify common items & differences using custom keys do?

This workflow compares two lists of objects (List A and List B) using a user specified key (e.g. , , ) and returns: Items common to both lists (based on the key) Items only in List A Items only in ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.