Salesforce Sales Cloud - Pagination

Salesforce allows paging only up to 2000 records. If you need to go above 2000 records, you should use the orderBy function and select a unique parameter such as “Id ascending”. However, the recommended approach is to use the bulk APIs