Can’t Access Array Element in GetMessages Using Dynamic Index from Loop Over Items

Describe the problem/error/question

I’m using the Loop Over Items node to iterate through a list of inputs with batchSize = 1.
In each iteration, I want to access a specific item inside an array returned by GetMessages1, using the current loop index — and send that item’s content via Telegram3.

However, I can’t access the correct indexed value dynamically using the current loop index.
Each Telegram message ends up undefined, empty, or incorrectly repeats values from previous iterations.

What is the error message (if any)?

No error in the workflow execution itself, but Telegram3 fails to send expected content because it receives undefined or the wrong item from GetMessages1.

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.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.82.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux (Pop!_OS)

Hi @Zafer_KAHRAMAN,

If you could share the code of your workflow it would help us to debug it.
In the meantime please find bellow an example with a Loop Over Items.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.