# Pagination Error for tasks

**URL:** <https://forum.asana.com/t/pagination-error-for-tasks/95883>\
**Category:** API & Developers\
**Tags:** tasks\
**Created:** [30 September 2020 13:02 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883 "2020-09-30T13:02:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nabeelah](https://luna1.co/8d76cd.png) [@Nabeelah](https://forum.asana.com/u/Nabeelah)\
**Post date:** [30 September 2020 13:02 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/1 "2020-09-30T13:02:51Z")

</div>

Hi,  
This code was previously working fine but is throwing the error -  
InvalidRequestError: Invalid Request: The result is too large. You should use pagination (may require specifying a workspace)!

I get this error when i run the below code

tasks = client.tasks.find\_by\_project(xxxxxxx, {“opt\_expand”:“name,   
approval\_status,completed, completed\_at,completed\_by,  
created\_at,dependencies,dependents,due\_at,due\_on,memberships,  
modified\_at,notes, num\_subtasks,resource\_subtype,start\_on,assignee,  
followers,parent,permalink\_url,projects,tags,custom\_fields”}, iterator\_type=None)

Surprisingly i dont get this error when i run get\_tasks but i want to know how i can expand all the fields in the result, any help is appreciated.

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [1 October 2020 18:16 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/2 "2020-10-01T18:16:41Z")

</div>

I might be captain obvious here, but you should paginate. Did you look at the doc regarding pagination?

Which language is that? Are you using their client library?

---

<div class="post-metadata">

**Author:** ![Nabeelah](https://luna1.co/8d76cd.png) [@Nabeelah](https://forum.asana.com/u/Nabeelah)\
**Post date:** [1 October 2020 18:35 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/3 "2020-10-01T18:35:51Z")

</div>

Hi,  
I am using the python client library, and in one of the topics it’s mentioned that I wouldn’t have to paginate and this would be handled inherently, I am confused especially as I’m unsure on how to paginate and what values to sort the data by

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [1 October 2020 18:53 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/4 "2020-10-01T18:53:17Z")

</div>

I am using the nodeJS library and indeed pagination is available within the client. I don’t know python enough, I would just be quoting the docs and the Collections section of the python lib [GitHub - Asana/python-asana: Official Python client library for the Asana API v1](https://github.com/asana/python-asana) sorry

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [1 October 2020 19:24 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/5 "2020-10-01T19:24:55Z")

</div>

@Nabeelah,

Pagination is built into the client libraries; you shouldn’t have to do anything about it yourself.

---

<div class="post-metadata">

**Author:** ![Nabeelah](https://luna1.co/8d76cd.png) [@Nabeelah](https://forum.asana.com/u/Nabeelah)\
**Post date:** [1 October 2020 20:08 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/6 "2020-10-01T20:08:44Z")

</div>

@phil_seeman

That’s what I assumed and was very surprised to get this error, any idea why I’m encountering this?

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [1 October 2020 22:13 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/7 "2020-10-01T22:13:31Z")

</div>

Oh sorry, I missed the initial error you mentioned. I have no idea, I’m afraid, I’m totally unfamiliar with the Python library.

@Ross_Grambo?

---

<div class="post-metadata">

**Author:** ![Ross\_Grambo](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ross_grambo/32/68568_2.png) [@Ross\_Grambo](https://forum.asana.com/u/Ross_Grambo)\
**Post date:** [1 October 2020 23:58 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/8 "2020-10-01T23:58:46Z")

</div>

Hello @Nabeelah,

You’re likely getting this error now because you’re not using pagination and your data is getting too big. The client library does pagination for you automatically via the iterator. In your request, you’ve included `iterator_type=None`. This is explicitly saying don’t use pagination and give me all the results as one big list.

To fix this, you should either take out `iterator_type=None` or explicitly set it to `iterator_type="items"`. This means you’ll now get an iterator, and you’ll need to loop through all the objects instead of treating them like a list.

Let me know if this doesn’t help or you have any questions!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:05 UTC](https://forum.asana.com/t/pagination-error-for-tasks/95883/9 "2025-05-30T19:05:52Z")

</div>


