N8n nested loops not working ideally

Describe the problem/error/question

In my nested loops , only the first iterations of the inner loop are running and rest of the iterations which are to be run by inner loop are completely ignored by the inner loop and processed in done branch.

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
{
  "nodes": [
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "10fOzXb23_7RsCw1MPIuCe5qfUZMdwj8fddQZITk_9pU",
          "mode": "list",
          "cachedResultName": "Email sign - department wise",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10fOzXb23_7RsCw1MPIuCe5qfUZMdwj8fddQZITk_9pU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10fOzXb23_7RsCw1MPIuCe5qfUZMdwj8fddQZITk_9pU/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "email banner": "={{ $('Code in JavaScript1').item.json.banner }}",
            "mail": "={{ $json.mail }}"
          },
          "matchingColumns": [
            "mail"
          ],
          "schema": [
            {
              "id": "mail",
              "displayName": "mail",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "position",
              "displayName": "position",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "department",
              "displayName": "department",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email banner",
              "displayName": "email banner",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1776,
        864
      ],
      "id": "6af49640-9e4f-4631-9e2e-d5047cd14a5a",
      "name": "Update row in sheet1",
      "alwaysOutputData": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "jvlYu31raMqBseCz",
          "name": "sheets-aarush"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "10fOzXb23_7RsCw1MPIuCe5qfUZMdwj8fddQZITk_9pU",
          "mode": "list",
          "cachedResultName": "Email sign - department wise",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10fOzXb23_7RsCw1MPIuCe5qfUZMdwj8fddQZITk_9pU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10fOzXb23_7RsCw1MPIuCe5qfUZMdwj8fddQZITk_9pU/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "division",
              "lookupValue": "={{ $json.division }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1136,
        800
      ],
      "id": "6b3c4ddb-1ede-42f9-84fa-9afca7f6f9c5",
      "name": "Get row(s) in sheet1",
      "alwaysOutputData": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "jvlYu31raMqBseCz",
          "name": "sheets-aarush"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "reset": "={{ $prevNode.name ==='Clean Up Results'}}"
        }
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        1408,
        800
      ],
      "id": "60b2714a-485f-45a1-addd-2ac0b575afa2",
      "name": "Loop Over Items2"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        912,
        784
      ],
      "id": "d3d5a93d-2514-4106-bd39-1fbda00f1a87",
      "name": "Loop Over Items3"
    },
    {
      "parameters": {
        "fieldToSplitOut": "division",
        "include": "allOtherFields",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        720,
        768
      ],
      "id": "7b5e899b-eedb-4762-9178-2eef79bb2f56",
      "name": "Split Out"
    }
  ],
  "connections": {
    "Update row in sheet1": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet1": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items3": {
      "main": [
        [],
        [
          {
            "node": "Get row(s) in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "0f39d8fdd402ddce20d0eb724526828e8c2d8679170e3a08fe6cd471c799fab6"
  }
}

Share the output returned by the last node

output is nothing , just wanted to update sheet in inner loop, but for some reason , all the branches or loop iterations after the first one just went to β€˜done’ directly.

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

yeah thanks. it was reset option not configured correctly.