Help with looping through node and changing the index reference

Describe the problem/error/question

We have a node that returns an array of objects and another node that acts on an object from that array. Our node is currently referencing index 0.

How can we make it loop through and reference the other objects (indexes) in that array without having to create multiple nodes?

What is the error message (if any)?

N/A

Please share your workflow

Trigger (polls messages every 60 seconds) → Poll Messages (IF statement to see if any messages were populated in last 60 seconds) → Publish data from object[0] in the array

**GOAL is to have this iterate through object 1,2,3… but our publishing node doesn’t have this functionality built into it’s API.

Information on your n8n setup

  • n8n version:
    1.34.2 - community (self hosted)

  • Database (default: SQLite):
    Postgresql

  • n8n EXECUTIONS_PROCESS setting (default: own, main):

  • Running n8n via (Docker, npm, n8n cloud, desktop app):
    Docker

  • Operating system:
    Linux/Ubuntu

Instead of pushing object[0] use the Split Out node to split objects