Pagination loop

My pagination loop starts repeating pages, why and what can i do to stop it

Describe the problem/error/question

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

Share the output returned by the last node

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:

This usually happens when pagination loses state during execution.
Common reasons are either the
Cursor gets reset or API returns an old next-page token or Rate limiting causes duplicate responses
So instead of moving forward normally:
Page 1 β†’ 2 β†’ 3 β†’ 4
You end up with:
Page 1 β†’ 2 β†’ 3 β†’ 2 β†’ 3 β†’ 2…

That creates duplicate records and can trap the workflow in a loop.
To fix this, Track Used Cursors and store every cursor you’ve already used. If the same one appears again, stop the loop.

@Abrayomo paste your workflow so we can see the exact setup, but meanwhile here’s a generic pagination loop that tracks seen pages and breaks when it detects a repeat β€” drop it in and swap the HTTP node URL to your API:

swap the URL and query param name to match your API, the Code node uses $getWorkflowStaticData('global') to remember every response it already saw so the moment a page repeats it stops cold instead of looping forever.