How to Fetch All Asana Projects in n8n Beyond the 100-Item Limit

Hello everyone,

I’m a beginner with n8n and I’m facing a problem I hope you can help me with.

I’m using the Asana node in n8n to fetch all projects from Asana. However, I’ve noticed that Asana only allows fetching 100 projects at a time due to pagination limits. I have more than 100 projects and need to retrieve all of them in my workflow.

Could someone please guide me on how to approach this problem in n8n? Any advice or examples on handling pagination to fetch all projects would be greatly appreciated.

Thank you in advance!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Welcome to the community @Francesco_Canovi !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


Have you tried enabling “Return All” option (push the toggle to the right)?

image

Hello. It’s running on a Synology NAS via Docker and this is the latest version (updated 2 days ago). I think that n8n version is irrelevant here since I need to overcome an Asana API limitation with some sort of pagination. It’s not a n8n issue…

Sure, but it returns an error. The issue is not in the n8n app, which works fine, but in the Asana APIs which appears to be limited to list only 100 project per request. So I think I should use some cycle or node to retrieve the complete list with multiple iteration. Not sure how if it’s possible…

Hey @Francesco_Canovi , what kind of error do you get? n8n leverages Asana API. Unless the API itself has changed of there is an issue with that API at the moment you ran the workflow, it should work even if API itself limits to only 100 projects returned.

You can try to replicate the work of Asana node by utilizing Asana API with HTTP Request node. The API itself is documented in Get multiple projects.

The error is

workspace: Not a Long: 1595752876780,1595752876780

and it happens only if I select “return All” or more that 100 projects. Otherwise it works successfully.
Even in the API documentation you linked there is clearly stated that it is limited to 100 projects. Since I need to look for the existence of a project with a name coming from another field, I must fetch all project prior to filter. Looking for a way to do so…
Thanks!

Francesco-

Yes, but it allows to address all the pages one by one in a single node. HTTP Request node has a built-in pagination functionality which will allow to collect all the data (by iterating over all the pages). It’s just a matter of configuring it right. In particular, the API example shows that the returned data has next_page property which you could use with pagination mode “Response Contains Next URL”.

Ok. I hoped there was a built in feature in the native fetch project node.
Thanks.

Hey @Francesco_Canovi , I would expect that so. Could you share screenshots demostrating that even when “Return All” is selected you still get no more than 100 projects returned (assuming there is more).

Hope it helps:

Thanks @Francesco_Canovi for sharing the screenshots. They, however, do not indicate that the issue is due to the max 100 projects per page. The error rather suggests that the request is malformed. We would need to investigate it further to find out the real reason.

Hey @Francesco_Canovi , the error seems to suggest that the ID of your workspace is no valid, spacifically, not a long number. And indeed, it looks shorter that that of my workspace.

Here’s to compare the two IDs

1208594969957586  // OK
1595752876780     // Not a long number

Could you verify that 1595752876780 is your correct workspace ID? You could use the URL https://app.asana.com/api/1.0/workspaces to do that.

Also, what happens when you access https://app.asana.com/api/1.0/workspaces/1595752876780. Do you get the same error?

This is valid. In fact if I select not the “return all” options and a number lesser that 100, it works perfectly. I don’t get any error accessing the API directly. The error seems related to the 100 projects limit.

Hey @Francesco_Canovi , thanks for the help with investigation. Looks like during pagination the workspace ID gets concatinated to itself somehow. That is, with the 2nd page the reference to the workspace becomes “1595752876780,1595752876780” and does not remain just “1595752876780”. I will raise an internal bug issue to investigate it further.

Could you let me know the version of n8n you are using?

Version is 1.62.5 on docker.

New version [email protected] got released which includes the GitHub PR 11415.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.