{
  "name": "\u6279\u91cf\u6570\u636e\u5904\u7406\u5faa\u73af",
  "nodes": [
    {
      "parameters": {},
      "id": "trigger-node-id",
      "name": "\u5f00\u59cb\u89e6\u53d1",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "\u7528\u6237\u5217\u8868",
              "value": "[\n  {\"id\": 1, \"name\": \"\u5f20\u4e09\", \"email\": \"zhang@example.com\"},\n  {\"id\": 2, \"name\": \"\u674e\u56db\", \"email\": \"li@example.com\"},\n  {\"id\": 3, \"name\": \"\u738b\u4e94\", \"email\": \"wang@example.com\"},\n  {\"id\": 4, \"name\": \"\u8d75\u516d\", \"email\": \"zhao@example.com\"}\n]"
            }
          ]
        },
        "options": {}
      },
      "id": "data-source-id",
      "name": "\u51c6\u5907\u6570\u636e",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// \u5c06JSON\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u7ec4\nconst userListStr = $input.first().json.\u7528\u6237\u5217\u8868;\nconst userList = JSON.parse(userListStr);\n\n// \u4e3a\u6bcf\u4e2a\u7528\u6237\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u9879\nreturn userList.map(user => ({\n  json: {\n    id: user.id,\n    name: user.name,\n    email: user.email,\n    status: '\u5f85\u5904\u7406'\n  }\n}));"
      },
      "id": "convert-data-id",
      "name": "\u8f6c\u6362\u6570\u636e\u683c\u5f0f",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "batchSize": 2,
        "options": {}
      },
      "id": "split-batch-id",
      "name": "\u5206\u6279\u5904\u7406",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// \u6a21\u62df\u5904\u7406\u6bcf\u4e2a\u7528\u6237\u7684\u903b\u8f91\nconst items = $input.all();\n\nreturn items.map(item => {\n  const user = item.json;\n  \n  // \u6a21\u62df\u4e00\u4e9b\u5904\u7406\u903b\u8f91\n  const processedData = {\n    ...user,\n    status: '\u5df2\u5904\u7406',\n    processedAt: new Date().toISOString(),\n    // \u6a21\u62df\u6839\u636e\u7528\u6237ID\u8ba1\u7b97\u4e00\u4e9b\u503c\n    score: user.id * 10 + Math.floor(Math.random() * 100)\n  };\n  \n  return {\n    json: processedData\n  };\n});"
      },
      "id": "process-batch-id",
      "name": "\u5904\u7406\u5355\u6279\u6570\u636e",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1120,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "\u6279\u6b21\u4fe1\u606f",
              "value": "=\u6279\u6b21 {{ $json.batch }} \u5904\u7406\u5b8c\u6210\uff0c\u7528\u6237\uff1a{{ $json.name }}"
            }
          ]
        },
        "options": {}
      },
      "id": "log-batch-id",
      "name": "\u8bb0\u5f55\u5904\u7406\u65e5\u5fd7",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        1340,
        300
      ]
    }
  ],
  "connections": {
    "\u5f00\u59cb\u89e6\u53d1": {
      "main": [
        [
          {
            "node": "\u51c6\u5907\u6570\u636e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u51c6\u5907\u6570\u636e": {
      "main": [
        [
          {
            "node": "\u8f6c\u6362\u6570\u636e\u683c\u5f0f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u8f6c\u6362\u6570\u636e\u683c\u5f0f": {
      "main": [
        [
          {
            "node": "\u5206\u6279\u5904\u7406",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u5206\u6279\u5904\u7406": {
      "main": [
        [
          {
            "node": "\u5904\u7406\u5355\u6279\u6570\u636e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u5904\u7406\u5355\u6279\u6570\u636e": {
      "main": [
        [
          {
            "node": "\u8bb0\u5f55\u5904\u7406\u65e5\u5fd7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u8bb0\u5f55\u5904\u7406\u65e5\u5fd7": {
      "main": [
        [
          {
            "node": "\u5206\u6279\u5904\u7406",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2024-12-17T10:15:00.000Z",
  "updatedAt": "2024-12-17T10:15:00.000Z",
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "description": "\u6f14\u793a\u5982\u4f55\u4f7f\u7528Split in Batches\u8282\u70b9\u8fdb\u884c\u6279\u91cf\u6570\u636e\u5904\u7406\u7684\u5faa\u73af\u64cd\u4f5c"
  },
  "versionId": "loop-example-version-1"
}