Apprendre la synchronisation des données : Tutoriel d'audit de l'inventaire du dépôt

Avancé

Ceci est unEngineeringworkflow d'automatisation du domainecontenant 17 nœuds.Utilise principalement des nœuds comme Set, SplitOut, ManualTrigger, CompareDatasets. Apprendre la synchronisation de données : tutoriel d'audit des stocks d'entrepôt

Prérequis
  • Aucun prérequis spécial, prêt à l'emploi après importation

Catégorie

Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "meta": {
    "instanceId": "e409ea34548a2afe2dffba31130cd1cf2e98ebe2afaeed2a63caf2a0582d1da0"
  },
  "nodes": [
    {
      "id": "6164f1ea-1e44-4f94-8c69-c064b477c53d",
      "name": "Démarrer l'audit",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -544,
        2768
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d6038f48-07a8-40b2-b4c5-00985932ec81",
      "name": "Note adhésive1",
      "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": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2368
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### ✅ 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": "➕ Ajouter à l'entrepôt B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        2192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dbfb3df3-e494-411c-975c-14edccaa7a8e",
      "name": "Entrepôt A (Source de vérité)",
      "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": "✅ Tout est bon (Ne rien faire)",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        2592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8f1f09a5-cf83-4ec4-90f5-85fd30bff3d6",
      "name": "🔄 Mettre à jour dans l'entrepôt B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        3024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1572db04-7da7-4d64-835b-a98aca3ef4bc",
      "name": "❌ Supprimer de l'entrepôt B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        3424
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a8f72c77-c484-46bf-a08d-05973c99b93d",
      "name": "L'auditeur",
      "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": "Entrepôt B (À synchroniser)",
      "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": "Note adhésive9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        2336
      ],
      "parameters": {
        "width": 688,
        "height": 612,
        "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."
      },
      "typeVersion": 1
    },
    {
      "id": "9b721fda-52d3-4de5-bdde-a58919456135",
      "name": "Note adhésive11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        1952
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### ➕ 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": "Note adhésive12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2784
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### 🔄 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": "Note adhésive13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        3200
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### ❌ 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": "19538cc0-b536-49c1-9874-af8d237ca71c",
      "name": "Note adhésive14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        2384
      ],
      "parameters": {
        "color": 3,
        "width": 540,
        "height": 784,
        "content": "## Was this helpful? Let me know!\n\nI really hope this template helped you understand how the Compare Datasets node works. Your feedback is incredibly valuable and helps me create better resources for the n8n community.\n\n### **Share Your Thoughts & Ideas**\n\nWhether you have a suggestion, found a typo, or just want to say thanks, I'd love to hear from you!\nHere's a simple n8n form built for this purpose:\n\n#### ➡️ **[Click here to give feedback](https://api.ia2s.app/form/templates/feedback?template=Compare%20Datasets)**\n\n### **Ready to Build Something Great?**\n\nIf you're looking to take your n8n skills or business automation to the next level, I can help.\n\n**🎓 n8n Coaching:** Want to become an n8n pro? I offer one-on-one coaching sessions to help you master workflows, tackle specific problems, and build with confidence.\n#### ➡️ **[Book a Coaching Session](https://api.ia2s.app/form/templates/coaching?template=Compare%20Datasets)**\n\n**💼 n8n Consulting:** Have a complex project, an integration challenge, or need a custom workflow built for your business? Let's work together to create a powerful automation solution.\n#### ➡️ **[Inquire About Consulting Services](https://api.ia2s.app/form/templates/consulting?template=Compare%20Datasets)**\n\n---\n\nHappy Automating!\nLucas Peyrin"
      },
      "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
    }
  ],
  "pinData": {},
  "connections": {
    "6164f1ea-1e44-4f94-8c69-c064b477c53d": {
      "main": [
        [
          {
            "node": "dbfb3df3-e494-411c-975c-14edccaa7a8e",
            "type": "main",
            "index": 0
          },
          {
            "node": "83decaff-9f4a-4729-ac52-6ce9b4e31be9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a8f72c77-c484-46bf-a08d-05973c99b93d": {
      "main": [
        [
          {
            "node": "b03f0d8c-7177-4069-8869-347e079c42bf",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "70322c6f-5892-4259-b4ff-97449bd94c39",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "8f1f09a5-cf83-4ec4-90f5-85fd30bff3d6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "1572db04-7da7-4d64-835b-a98aca3ef4bc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9114df4e-e8d6-47d3-811d-dcd416ff667a": {
      "main": [
        [
          {
            "node": "a8f72c77-c484-46bf-a08d-05973c99b93d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a6fca263-dd05-408f-9556-498985daca96": {
      "main": [
        [
          {
            "node": "a8f72c77-c484-46bf-a08d-05973c99b93d",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "83decaff-9f4a-4729-ac52-6ce9b4e31be9": {
      "main": [
        [
          {
            "node": "a6fca263-dd05-408f-9556-498985daca96",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dbfb3df3-e494-411c-975c-14edccaa7a8e": {
      "main": [
        [
          {
            "node": "9114df4e-e8d6-47d3-811d-dcd416ff667a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Ingénierie

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds17
Catégorie1
Types de nœuds6
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Lucas Peyrin

Lucas Peyrin

@lucaspeyrin

Innovative builder with a passion for crafting automation solutions that solve real-world challenges. From streamlining workflows to driving efficiency, my work empowers teams and individuals to achieve more with less effort. Experienced in developing scalable tools and strategies that deliver results with n8n, supabase and cline.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34