Search API pagination can skip items when modified_at ordering is not strict

Hello Asana Support Team,

We are facing an issue with the Search API where results are not always strictly ordered by modified_at, which breaks pagination logic and can cause items to be skipped.

We are using the following endpoint:

GET /workspaces/{workspace_gid}/tasks/search

with parameters like:

  • portfolios.any

  • modified_at.after

  • sort_by=modified_at

  • limit

  • opt_fields

  • is_subtask=false

This returns paginated results sorted by modified_at, and we use the modified_at.before value from the last item of each page to fetch the next page.

However, in some responses, items near the page boundary are not strictly sorted by modified_at. For example, two items that should be ordered by modified_at appear out of order, where the item with the later modified_at appears after the one with the earlier modified_at.

With pagination enabled, this causes a scenario where using modified_at.before for the next page can exclude items that should have appeared, resulting in missing items.

We understand that Asana recommends using created_at for stable pagination, but our use case requires sorting by modified_at for performance.

Could you please confirm:

  1. Is the Search API guaranteed to return results strictly ordered by modified_at when using sort_by=modified_at?

  2. If not, what is the recommended safe way to paginate when using modified_at?

  3. Is this a known issue or something that can be addressed at the API level?

Similar ticket in the past for the same issue: Question about search api + paging

Thanks!

I brought the attention of the engineering team to this thread, hopefully they can help!

1 Like

Hi @TCK_User1 , thanks for flagging and welcome to the forum! We’ve been quite busy with case work recently, but I’ve noted your report and will review it shortly. Thanks for your patience!