I lose the variables after executing a loop times

Hello, good afternoon. After the 18th execution, the variable is lost. I want to perform a database insertion based on two nested loops to save field by field.

What is the error message (if any)?

‘data’ expects a object but we got ‘row_number’ [item 0]

To fix the error try to change the type for the field “data” or activate the option “Ignore Type Conversion Errors” to apply a less strict type validation

Please share your workflow

Of the 65 items I’m trying to import, only 22 are being imported

65 rows where I must save each column as an independent insert in the database with an identifier.

Information on your n8n setup

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

hello @gsn_devops_yemm

The workflow is too complex to make any suggestions. Don’t loop like this. Use sub-workflows.

When you are back-chaining the nodes, their $runIndex is also changes, which makes the item-linking too complex (e.g. you should be very careful with the $(nodename).item.json reference as it starts to work only within the current $runIndex, i.e. only within the current loop)