{
  "id": "bdgsSheetBatch01",
  "name": "One batch notice before processing each Sheets row",
  "nodes": [
    {
      "id": "bc8576ca-da97-5d17-bb61-702e0f20a99d",
      "name": "Start rehearsal",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        100
      ],
      "parameters": {}
    },
    {
      "id": "c475f10a-258a-5883-8dbd-6f8a7b4e5fdb",
      "name": "Practice data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        100
      ],
      "parameters": {
        "mode": "raw",
        "jsonOutput": "{\n  \"rows\": [\n    {\n      \"recordId\": \"R-031\",\n      \"work\": \"Count labels\",\n      \"units\": 12\n    },\n    {\n      \"recordId\": \"R-045\",\n      \"work\": \"Check cartons\",\n      \"units\": 3\n    },\n    {\n      \"recordId\": \"R-052\",\n      \"work\": \"Print pick lists\",\n      \"units\": 8\n    }\n  ]\n}",
        "options": {}
      }
    },
    {
      "id": "837f23ae-1b86-5bde-99f2-e7fb28a41911",
      "name": "Simulate sheet rows",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        480,
        100
      ],
      "parameters": {
        "fieldToSplitOut": "rows",
        "options": {}
      }
    },
    {
      "id": "d0e58dc8-5015-5e05-8934-6d49a675190c",
      "name": "Collect rows",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        720,
        100
      ],
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "rows",
        "options": {}
      }
    },
    {
      "id": "ce3aebf6-f2d8-5f0c-97e4-744db826a9cd",
      "name": "Preview one notice",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        960,
        100
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e140988a-ffa2-5593-be74-a1882fc889bb",
              "name": "tab",
              "value": "Intake",
              "type": "string"
            },
            {
              "id": "69c1081f-17b0-5ab2-9d22-87e324ad1faf",
              "name": "rowCount",
              "value": "={{ $json.rows.length }}",
              "type": "number"
            },
            {
              "id": "ac00d98d-2921-5fd4-97a3-db27f4319f5f",
              "name": "subject",
              "value": "={{ \"Intake · \" + $json.rows.length + ($json.rows.length === 1 ? \" row\" : \" rows\") + \" ready\" }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "5257d338-1203-5fa6-93a6-7ca087768367",
      "name": "Recover original rows",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1200,
        100
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "084626ee-49cb-5c89-9a87-c50b673aa8ea",
              "name": "rows",
              "value": "={{ $('Collect rows').first().json.rows }}",
              "type": "array"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "203a4ed1-1377-5056-9e11-e05e947a19e2",
      "name": "Continue per row",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1440,
        100
      ],
      "parameters": {
        "fieldToSplitOut": "rows",
        "options": {}
      }
    }
  ],
  "active": false,
  "connections": {
    "Start rehearsal": {
      "main": [
        [
          {
            "node": "Practice data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Practice data": {
      "main": [
        [
          {
            "node": "Simulate sheet rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simulate sheet rows": {
      "main": [
        [
          {
            "node": "Collect rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect rows": {
      "main": [
        [
          {
            "node": "Preview one notice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preview one notice": {
      "main": [
        [
          {
            "node": "Recover original rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recover original rows": {
      "main": [
        [
          {
            "node": "Continue per row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
