AutomationFlowsGeneral › Learn Data Synchronization: Warehouse Inventory Audit Tutorial

Learn Data Synchronization: Warehouse Inventory Audit Tutorial

Original n8n title: 🎓 Learn Data Synchronization: Warehouse Inventory Audit Tutorial

ByLucas Peyrin @lucaspeyrin on n8n.io

This template is a hands-on tutorial for one of n8n's most powerful data tools: the Compare Datasets node. It's the perfect next step after learning basic logic, showing you how to build robust data synchronization workflows.

Event trigger★★★★☆ complexity17 nodes
General Trigger: Event Nodes: 17 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #5999 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "6164f1ea-1e44-4f94-8c69-c064b477c53d",
      "name": "Start Audit",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -544,
        2768
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d6038f48-07a8-40b2-b4c5-00985932ec81",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        2336
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 680,
        "content": "### The Auditor's Report\n\nThis is the **Compare Datasets** node, our Auditor.\n\n**How it works:**\n1.  **Fields to Match:** It uses the `product_id` as a unique \"barcode\" to identify the same item in both warehouses.\n2.  **Source of Truth:** We've told it that if an item is **different**, it should **Use Input A Version**. This means Warehouse A's data is always correct.\n\n\n**The Four Outputs:**\nThe Auditor produces a report with four categories, which correspond to the four outputs of this node."
      },
      "typeVersion": 1
    },
    {
      "id": "d191a3b6-13e5-460e-a5a8-87d0c50fe31b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2368
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### \u2705 All Good (Do Nothing)\n\n**What this means:** The Auditor found that this item (the 'Keyboard') is exactly the same in both Warehouse A and Warehouse B.\n\n**Action:** No action is needed! The data is already in sync."
      },
      "typeVersion": 1
    },
    {
      "id": "b03f0d8c-7177-4069-8869-347e079c42bf",
      "name": "\u2795 Add to Warehouse B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        2192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dbfb3df3-e494-411c-975c-14edccaa7a8e",
      "name": "Warehouse A (Source of Truth)",
      "type": "n8n-nodes-base.set",
      "position": [
        -288,
        2608
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "12345",
              "name": "products",
              "type": "array",
              "value": "=[\n   {\n      \"product_id\":\"P-001\",\n      \"name\":\"Keyboard\",\n      \"stock\":200\n   },\n   {\n      \"product_id\":\"P-002\",\n      \"name\":\"Mouse\",\n      \"stock\":150\n   },\n   {\n      \"product_id\":\"P-003\",\n      \"name\":\"Webcam\",\n      \"stock\":75\n   }\n]"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "70322c6f-5892-4259-b4ff-97449bd94c39",
      "name": "\u2705 All Good (Do Nothing)",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        2592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8f1f09a5-cf83-4ec4-90f5-85fd30bff3d6",
      "name": "\ud83d\udd04 Update in Warehouse B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        3024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1572db04-7da7-4d64-835b-a98aca3ef4bc",
      "name": "\u274c Remove from Warehouse B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        3424
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a8f72c77-c484-46bf-a08d-05973c99b93d",
      "name": "The Auditor",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        224,
        2768
      ],
      "parameters": {
        "options": {},
        "mergeByFields": {
          "values": [
            {
              "field1": "product_id",
              "field2": "product_id"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "83decaff-9f4a-4729-ac52-6ce9b4e31be9",
      "name": "Warehouse B (To be Synced)",
      "type": "n8n-nodes-base.set",
      "position": [
        -288,
        2928
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "27aceae0-8a0b-4fcf-b8a6-fc1f16cc4863",
              "name": "products",
              "type": "array",
              "value": "=[\n   {\n      \"product_id\":\"P-001\",\n      \"name\":\"Keyboard\",\n      \"stock\":200\n   },\n   {\n      \"product_id\":\"P-002\",\n      \"name\":\"Mouse\",\n      \"stock\":100\n   },\n   {\n      \"product_id\":\"P-004\",\n      \"name\":\"Monitor\",\n      \"stock\":50\n   }\n]"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "eb5dbdfb-6780-44ad-b019-a2c0d2b53430",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        2336
      ],
      "parameters": {
        "width": 688,
        "height": 644,
        "content": "### Tutorial: The Data Auditor (Compare Datasets)\n\nWelcome! This workflow will teach you how to use one of the most powerful nodes for data synchronization: **Compare Datasets**.\n\n**The Analogy: Auditing Two Warehouses**\n- **Warehouse A:** Our main, \"source of truth\" warehouse. This is the master list of what we *should* have.\n- **Warehouse B:** A second, remote warehouse. We need to make sure its inventory matches Warehouse A.\n- **The Compare Datasets Node:** This is the **Auditor** with a clipboard, checking both lists to find differences.\n\n\n**How to use this tutorial:**\n1.  Click **\"Execute Workflow\"**.\n2.  Click on each of the four output nodes (`NoOp` nodes) to see which items ended up where.\n3.  Read the sticky notes to understand why each item was sorted into its specific branch.\n\n\n---\n\n### Automate your operations today\nYour time is valuable. Let us automate the boring stuff for you.\n\n**\ud83d\udc47 CHOOSE YOUR PATH:**\n\n[ **\u26a1\ufe0f I WANT A FREE AUDIT (2 min)** ](https://workflows.ac/audit?utm_source=n8n_template&utm_medium=workflow_note&utm_campaign=learn_data_synchronization_warehouse_inventory_audit_tutorial&utm_content=5999)\n> *We've put our heart into this business evaluation machine.*\n\n[ **\ud83d\udca1 I HAVE A SPECIFIC REQUEST** ](https://workflows.ac/form?utm_source=n8n_template&utm_medium=workflow_note&utm_campaign=learn_data_synchronization_warehouse_inventory_audit_tutorial&utm_content=5999)\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9b721fda-52d3-4de5-bdde-a58919456135",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        1952
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### \u2795 Add to Warehouse B\n\n**What this means:** The Auditor found this item (the 'Webcam') in our main Warehouse A, but it's **missing** from Warehouse B.\n\n**Action:** The next step in a real workflow would be to take this item and **create** it in Warehouse B (e.g., add a new row to a Google Sheet or a new item in Notion)."
      },
      "typeVersion": 1
    },
    {
      "id": "b1dadc19-0dc4-4709-9bc6-9b5a7431db2a",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2784
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### \ud83d\udd04 Update in Warehouse B\n\n**What this means:** The Auditor found this item (the 'Mouse') in both warehouses, but its details are **different**. (Warehouse A has 150 in stock, but B only has 100).\n\n**Action:** The next step would be to **update** the existing item in Warehouse B with the correct data from Warehouse A."
      },
      "typeVersion": 1
    },
    {
      "id": "87ad324e-c596-4968-b484-8d778dacba0b",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        3200
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### \u274c Remove from Warehouse B\n\n**What this means:** The Auditor found this item (the 'Monitor') in Warehouse B, but it **does not exist** in our main Warehouse A.\n\n**Action:** The next step would be to **delete** this item from Warehouse B, as it's an extra item that shouldn't be there."
      },
      "typeVersion": 1
    },
    {
      "id": "a6fca263-dd05-408f-9556-498985daca96",
      "name": "Split Out Prducts (B)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -64,
        2928
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "products"
      },
      "typeVersion": 1
    },
    {
      "id": "9114df4e-e8d6-47d3-811d-dcd416ff667a",
      "name": "Split Out Prducts (A)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -64,
        2608
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "products"
      },
      "typeVersion": 1
    },
    {
      "id": "0e192455-f7c4-4b11-a696-15fa3fd2304f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        2256
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 1040,
        "content": "## Was this helpful? Let me know!\n[![clic](https://supastudio.ia2s.app/storage/v1/object/public/assets/n8n/clic_down_lucas.gif)](https://workflows.ac/form)\n\nI really hope this template helped you. Your feedback is what helps me create better resources for the n8n community.\n\n### **Have Feedback, a Question, or a Project Idea?**\n\n\n#### \u27a1\ufe0f **[Click here to go to the Contact Form](https://workflows.ac/form?utm_source=n8n_template&utm_medium=workflow_note&utm_campaign=learn_data_synchronization_warehouse_inventory_audit_tutorial&utm_content=5999)**\n\nUse this single link for anything you need:\n\n*   **Give Feedback:** Share your thoughts on this template, whether you found a typo, encountered an unexpected error, have a suggestion, or just want to say thanks!\n\n*   **Automation Coaching:** Get personalized, one-on-one guidance to master n8n. We can work together to help you reach an expert level.\n\n*   **Automation Consulting:** Have a complex business challenge or need custom workflows built from scratch? We offer a plug and play automation department for 8 to 88 people teams with unlimited automation requests.\n\n---\n\nHappy Automating!\nLucas Peyrin | [Workflows Accelerator](https://workflows.ac?utm_source=n8n_template&utm_medium=workflow_note&utm_campaign=learn_data_synchronization_warehouse_inventory_audit_tutorial&utm_content=5999)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Start Audit": {
      "main": [
        [
          {
            "node": "Warehouse A (Source of Truth)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Warehouse B (To be Synced)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "The Auditor": {
      "main": [
        [
          {
            "node": "\u2795 Add to Warehouse B",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u2705 All Good (Do Nothing)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83d\udd04 Update in Warehouse B",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u274c Remove from Warehouse B",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Prducts (A)": {
      "main": [
        [
          {
            "node": "The Auditor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Prducts (B)": {
      "main": [
        [
          {
            "node": "The Auditor",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Warehouse B (To be Synced)": {
      "main": [
        [
          {
            "node": "Split Out Prducts (B)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Warehouse A (Source of Truth)": {
      "main": [
        [
          {
            "node": "Split Out Prducts (A)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This template is a hands-on tutorial for one of n8n's most powerful data tools: the Compare Datasets node. It's the perfect next step after learning basic logic, showing you how to build robust data synchronization workflows.

Source: https://n8n.io/workflows/5999/ — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

Blotato. Uses googleSheets, @blotato/n8n-nodes-blotato. Event-driven trigger; 65 nodes.

Google Sheets, @Blotato/N8N Nodes Blotato
General

This template is a hands-on, practical exam designed to help you master n8n Expressions—the key to accessing and manipulating data in your workflows.

Stop And Error
General

This template is a hands-on, practical exam designed to test your understanding of the fundamental JSON data types. It's the perfect way to solidify your knowledge after learning the basics.

Stop And Error
General

Agendamiento. Uses n8n-nodes-evolution-api, redis, dataTable, executeWorkflowTrigger. Event-driven trigger; 60 nodes.

N8N Nodes Evolution Api, Redis, Data Table +2
General

Kv Cloudflare Key Value Database Full Api Integration Workflow. Uses stickyNote, httpRequest, manualTrigger. Event-driven trigger; 47 nodes.

HTTP Request