Pagination Offset vs Cursor

So i have a URL, lets call it /linky. This only allows me to pull 100 results at a time. The URL allows both/either

Cursor-based Pagination

/linky?event-num-after=199

Offset-based Pagination

Example of retrieving item records 90 to 100
/linky?offset=90&limit=10

What’s the best way to get this to run in a loop, when the initial URL gives no idea, how many results there will be, and dump into one long list?

I think offset might be best for me, but need to make some form of counter for the loop and the first URL need to be plain, without any pagination etc it doesn’t work otherwise

I would do the offset based. I did an example in the post below. You have to loop and, when done, merge all executions.

will have a look, might have some follow up questions like if your initial page results doesn’t have anything to say there are more results, you just know that there are.

well i did it a hacky way using cursor but got what I needed , lol

but obviously there is a better way, don’t copy me people, :wink:

2 Likes

That might be one of the craziest things I have seen :joy: Nice work.

my brain was hurting so just hacked it for now.

2 Likes

functionality first, elegance later :grinning_face_with_smiling_eyes:

2 Likes

Part of the joy of using n8n is the ability to quickly iterate over different worklfow design ideas :slightly_smiling_face:

Get it working then make a second worklfow to play with improving it when you get time.

3 Likes