{
  "name": "【検証】1回の実行で何件処理しても1実行になるか",
  "nodes": [
    {
      "parameters": {},
      "name": "手動で開始",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "a1"
    },
    {
      "parameters": {
        "jsCode": "// 請求データ10件を作る（検証用のダミー）\nreturn Array.from({length: 10}, (_, i) => ({ json: { 請求番号: `INV-${String(i+1).padStart(3,'0')}`, 金額: (i+1) * 11000 } }));"
      },
      "name": "請求データ10件を作成",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ],
      "id": "a2"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json['金額'] }}",
              "rightValue": 50000,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "name": "5万円以上だけ残す",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2,
      "position": [
        440,
        0
      ],
      "id": "a3"
    },
    {
      "parameters": {
        "jsCode": "const total = $input.all().reduce((s, i) => s + i.json['金額'], 0);\nreturn [{ json: { 件数: $input.all().length, 合計金額: total } }];"
      },
      "name": "件数と合計を集計",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        0
      ],
      "id": "a4"
    }
  ],
  "connections": {
    "手動で開始": {
      "main": [
        [
          {
            "node": "請求データ10件を作成",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "請求データ10件を作成": {
      "main": [
        [
          {
            "node": "5万円以上だけ残す",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5万円以上だけ残す": {
      "main": [
        [
          {
            "node": "件数と合計を集計",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}