I have a rest API with pagination, I would like to get all data with automatically passing the page number into the URL
n = the number we do not know before.
You can add a parameter to your job with the value 1, and use that to call the first page of the API. When you know whether you have further pages to get, pass the next page number (2 in this case) to a another job that calls your original job with the new parameter. Add a test for an 'end of call ' value in the job (like -1) so that it stops. You might also try a delay. to make sure everything doesn't try and happen at once.
Retrieving data ...