Describe the problem/error/question
I’m retrieving from an API a list of conversations. There’s a page parameter, and for every request I get 25 items.
I added pagination options and, using pageCount+1, I’m able to retrieve several pages.
The problem comes with the condition I have to set so that the module stops executing when there’s no more content.
If i call this API and set the page to 200, I get the following (simplified) response:
[
{
"data": {
"meta": {
"mine_count": 64,
"assigned_count": 64,
"unassigned_count": 358,
"all_count": 422
},
"payload": []
}
}
]
The key here is that the array payload is empty. I should be able to set the condition so that, if the current response’s payload is empty, then stop making HTTP requests.
I also tried with other options, like creating a set field, and update it after an if condition… It didn’t work neither. Plus, it seems like a more complex solution, and i believe that i’m near to getting this fixed. The only thing i need is the proper condition to stop :S
Can anyone help me solve this? Thanks in advance!
What is the error message (if any)?
Please share your workflow
Information on your n8n setup
- **n8n version: 1.60.1
- **Database (default: SQLite): Postgress
- **n8n EXECUTIONS_PROCESS setting (default: own, main): Default
- **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- **Operating system: ubuntu server 22.04