8
n8n 中文网amn8n.com

学习数据同步:仓库库存审计教程

高级

这是一个Engineering领域的自动化工作流,包含 17 个节点。主要使用 Set, SplitOut, ManualTrigger, CompareDatasets 等节点。 学习数据同步:仓库库存审计教程

前置要求
  • 无特殊前置要求,导入即可使用

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "e409ea34548a2afe2dffba31130cd1cf2e98ebe2afaeed2a63caf2a0582d1da0"
  },
  "nodes": [
    {
      "id": "6164f1ea-1e44-4f94-8c69-c064b477c53d",
      "name": "开始审计",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -544,
        2768
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d6038f48-07a8-40b2-b4c5-00985932ec81",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        2336
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 680,
        "content": "### 审计报告"
      },
      "typeVersion": 1
    },
    {
      "id": "d191a3b6-13e5-460e-a5a8-87d0c50fe31b",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2368
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### ✅ 一切正常(无需操作)"
      },
      "typeVersion": 1
    },
    {
      "id": "b03f0d8c-7177-4069-8869-347e079c42bf",
      "name": "➕ 添加到仓库 B",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        2192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dbfb3df3-e494-411c-975c-14edccaa7a8e",
      "name": "仓库 A(真相源)",
      "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": "✅ 一切正常(无需操作)",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        2592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8f1f09a5-cf83-4ec4-90f5-85fd30bff3d6",
      "name": "🔄 在仓库 B 中更新",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        3024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1572db04-7da7-4d64-835b-a98aca3ef4bc",
      "name": "❌ 从仓库 B 中移除",
      "type": "n8n-nodes-base.noOp",
      "position": [
        640,
        3424
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a8f72c77-c484-46bf-a08d-05973c99b93d",
      "name": "审计员",
      "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": "仓库 B(待同步)",
      "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": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        2336
      ],
      "parameters": {
        "width": 688,
        "height": 612,
        "content": "### 教程:数据审计员(Compare Datasets)"
      },
      "typeVersion": 1
    },
    {
      "id": "9b721fda-52d3-4de5-bdde-a58919456135",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        1952
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### ➕ 添加到仓库 B"
      },
      "typeVersion": 1
    },
    {
      "id": "b1dadc19-0dc4-4709-9bc6-9b5a7431db2a",
      "name": "便签 12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2784
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### 🔄 在仓库 B 中更新"
      },
      "typeVersion": 1
    },
    {
      "id": "87ad324e-c596-4968-b484-8d778dacba0b",
      "name": "便签 13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        3200
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 400,
        "content": "### ❌ 从仓库 B 中移除"
      },
      "typeVersion": 1
    },
    {
      "id": "19538cc0-b536-49c1-9874-af8d237ca71c",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        2384
      ],
      "parameters": {
        "color": 3,
        "width": 540,
        "height": 784,
        "content": "## 这对您有帮助吗?请告诉我!"
      },
      "typeVersion": 1
    },
    {
      "id": "a6fca263-dd05-408f-9556-498985daca96",
      "name": "分离产品 (B)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -64,
        2928
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "products"
      },
      "typeVersion": 1
    },
    {
      "id": "9114df4e-e8d6-47d3-811d-dcd416ff667a",
      "name": "分离产品 (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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 工程

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量17
分类1
节点类型6
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
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.

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34