Issue with Pagination – “No Path Back to Node” for endCursor

Title:

Issue with Pagination – “No Path Back to Node” for endCursor

Problem

I’m looping through paginated API responses in n8n and setting endCursor for the next request. However, when I reference it in the next iteration, I get:

"variables": { "after": "[No path back to node]" }

How can I correctly pass endCursor between iterations?

What I’ve Tried

• Referencing {{$json[“endCursor”]}} and {{$node[“Set End Cursor”].json[“endCursor”]}}

• Ensuring Set End Cursor runs before the next API call

• Using an IF node to check hasNextPage before looping

Setup

n8n version:

Database: SQLite (default)

Execution mode: (own/main)

Running via: (Docker, npm, cloud, etc.)

OS:

Question

How do I ensure endCursor is correctly passed to the next request in a loop?

1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

It’s not exactly the same, but I recently posted an example of how to handle loop iteration variables, which might help you figure out how to do what you want here. It should at least give you some ideas about how to reference things with expressions depending on whether they are inside or outside of your loop.

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