
n8n pagination with Exact Online OData API — $response.body.__next keeps returning undefined**
I'm building a workflow in n8n that pulls all debtors from Exact Online via their OData API, using the built-in pagination in the HTTP Request node. The problem is that I can't get it to correctly read the `__next` field for the next page URL.
The Exact Online API returns a nested structure where `__next` lives inside `d`, not at the top level of the results array. So to reference it, I'm using `$response.body.d.__next` as the Next URL expression — but it keeps coming back as `undefined`. I've also tried the bracket notation (`$response.body["d"]["__next"]`), same result.
For the Pagination Complete When setting, I've set it to **Other** with the expression `$response.body.d.__next == null`, which should stop pagination when there's no next page — but since the expression already returns undefined, that logic never works properly either.
I've seen mentions of `$response.body` having issues with nested objects in certain API responses in n8n, which makes me think this might be a known bug rather than something wrong with my expressions. (I'll add a screenshot of my node config so you can see exactly how it's set up.)
At this point I'm considering scrapping the built-in pagination entirely and building a manual loop instead — an IF node that checks whether a `__next` URL is present, and keeps looping until it's gone. Has anyone gone that route, and does it hold up well for larger datasets?
Or is there a cleaner fix I'm missing? Any help appreciated.