Use this robust n8n workflow to compare two arrays of JSON objects based on a custom key, efficiently identifying common items and unique differences for data reconciliation tasks. Find more useful n8n templates.
Download this n8n workflow template and start using it instantly.
Data Engineers and Analysts: Who need quick, programmatic ways to reconcile data sets coming from different sources.
Automation Specialists: Seeking modular n8n templates for common utility tasks within larger data pipelines.
Developers: Requiring precise object comparisons based on unique identifiers (like IDs or transaction keys) inside their n8n data flows.
Users of n8n: Looking for examples of powerful custom logic implemented within a Code n8n node.
Data auditing and synchronization frequently require determining which records two separate lists share and which records are unique to each source. Writing this logic repeatedly can be time-consuming. This reusable n8n workflow solves this problem by providing a highly efficient, customizable utility to perform a set comparison on two input arrays (inputa and inputb), using a dynamic key field for identification. The result is three distinct arrays that streamline reconciliation tasks. Integrating this specialized comparison logic via a callable n8n workflow ensures consistency and reusability across all your n8n deployments. This n8n template is designed for maximum efficiency, utilizing Map objects within the custom Code n8n node.
This powerful data reconciliation tool starts with the When Executed by Another Workflow n8n trigger node, expecting three inputs: inputa (the first list), inputb (the second list), and the unique comparison key.
key, inputa, or inputb are empty. If any of these mandatory fields are missing, the workflow branches to one of the respective Set n8n nodes (e.g., validation_message 1) to provide a clear error message in the output.common (items found in both lists), onlyInA (items unique to the first list), and onlyInB (items unique to the second list).This structured approach ensures the n8n workflow processes data correctly and provides immediate feedback if mandatory inputs are missing.
To deploy this useful n8n workflow template, follow these steps:
When Executed by Another Workflow n8n trigger, it is meant to be called from a parent n8n workflow using the 'Execute Workflow' n8n node.inputa, inputb as arrays of objects, and key as the string name of the common identifier field) into the inputs defined by the n8n trigger node.This n8n workflow utilizes core nodes for robust data processing and flow control:
When Executed by Another Workflow (n8n trigger): The starting point, defined to receive three inputs (inputa, inputb, key). This allows the n8n workflow to be modularly called by other processes.
Switch (n8n node): Acts as a primary validation gate. It checks for null or empty values in the three required input variables (key, inputa, inputb). If validation fails, execution is diverted to an error message setting node.
Set (n8n node - e.g., validation_message 1): Used on validation failure branches to set a descriptive error message in the output data.
Code (n8n node): Contains the core JavaScript logic. This custom n8n node uses Map operations to provide O(N) efficiency for comparing the lists based on the dynamic key. It generates three categorized lists (common, onlyInA, onlyInB) for the final n8n workflow output.
Automate candidate evaluation using this n8n workflow. Scrape LinkedIn profiles and JDs using GhostGenius, compare them with Groq AI, and generate ATS-style optimization tips. Integrate this powerful n8n template for recruitment.

Use this powerful n8n workflow to compare real-time hotel prices across Booking.com, Agoda, and Expedia, generating a detailed price report emailed directly to the user. Leverage this n8n template for web scraping and data aggregation.

Compare OpenAI GPT, Claude, and Gemini responses using Contextual AI’s LMUnit evaluation framework within an n8n workflow. This n8n templates solution automates LLM quality testing.

Use this powerful n8n workflow to compare multiple local Ollama Vision Models (VLM) by analyzing an image and saving the detailed, structured results directly to Google Docs.

Use this advanced n8n workflow to automate multi-period financial analysis. An n8n AI agent extracts data from Google Sheets, compares current, monthly, and yearly performance, and summarizes it instantly. Explore these powerful n8n templates.


I'm a software developer with over 11 years of experience building systems across various stacks. I'm now applying that expertise to create practical and scalable workflow automations with n8n — focusing on clean logic, real-world use cases, and reusability. Always open to learning, sharing, and collaborating.







































