# Stuck in iteration

**URL:** <https://community.n8n.io/t/stuck-in-iteration/19321>\
**Category:** Questions\
**Tags:** http-request, apitemplate, rest-api, custom-node\
**Created:** [November 2, 2022, 1:38pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321 "2022-11-02T13:38:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kool\_Baudrillard](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kool_baudrillard/32/14282_2.png) [@Kool\_Baudrillard](https://community.n8n.io/u/Kool_Baudrillard)\
**Post date:** [November 2, 2022, 1:38pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/1 "2022-11-02T13:38:58Z")

</div>

## Describe the issue/error/question

I would like to iterate through pages of this api.

## What is the error message (if any)?

I´m stuck at page 1 with the iterator node, even though manually I´m able to call page 2 etc

## Please share the workflow

## Share the output returned by the last node

## Information on your n8n setup

- \*\*n8n version:_latest Desktop 199_
- \*\*Database you’re using (default: SQLite):_Sqlite_
- **Running n8n with the execution process [own(default), main]:**
- **Running n8n via [npm, desktop app]:**

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [November 3, 2022, 2:04pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/2 "2022-11-03T14:04:24Z")

</div>

Hi @Kool_Baudrillard, the Iterator node isn’t a default n8n node but a community node built by @BramKn. Perhaps he can help with this?

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [November 3, 2022, 2:21pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/3 "2022-11-03T14:21:54Z")

</div>

Hi @Kool_Baudrillard

It can be a bit annoying to set the node correctly, sorry for that.  
Can you please post the config of your iterator node? I cannot see it here and when I copy the node it doesn’t seem right vs what you say you are trying to do.

@MutedJam thanks for the headsup

---

<div class="post-metadata">

**Author:** ![Kool\_Baudrillard](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kool_baudrillard/32/14282_2.png) [@Kool\_Baudrillard](https://community.n8n.io/u/Kool_Baudrillard)\
**Post date:** [November 3, 2022, 2:53pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/4 "2022-11-03T14:53:03Z")

</div>

Hi,

this is the setup of the node:

{  
“meta”: {  
“instanceId”: “64dda5562bd7e58f894c2bb89ee15d008ed95b9ec3f22bf3c5f3c7983878f35d”  
},  
“nodes”: [  
{  
“parameters”: {  
“incrementStart”: 1,  
“options”: {  
“expectedItemCount”: 1000  
}  
},  
“id”: “e24eb19c-73fc-4566-bbbe-5be7b58a7850”,  
“name”: “Iterator”,  
“type”: “n8n-nodes-iterator.iterator”,  
“typeVersion”: 1,  
“position”: [  
220,  
180  
]  
}  
],  
“connections”: {}  
}

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [November 3, 2022, 2:55pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/5 "2022-11-03T14:55:42Z")

</div>

yeah thats what I saw. Can you give a screenshot?

---

<div class="post-metadata">

**Author:** ![Kool\_Baudrillard](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kool_baudrillard/32/14282_2.png) [@Kool\_Baudrillard](https://community.n8n.io/u/Kool_Baudrillard)\
**Post date:** [November 3, 2022, 3:25pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/6 "2022-11-03T15:25:11Z")

</div>

Hi this is how it basically looks

 ![Bildschirmfoto 2022-11-03 um 16.24.13](https://europe1.discourse-cdn.com/n8n/original/3X/4/9/495a50e97aab899f423c345ccdf879b097be8848.png)  
 ![Bildschirmfoto 2022-11-03 um 16.24.25](https://europe1.discourse-cdn.com/n8n/original/3X/f/d/fd06ef2a9552084eb660d46a6afed660ae594a49.jpeg)  
 ![Bildschirmfoto 2022-11-03 um 16.24.32](https://europe1.discourse-cdn.com/n8n/original/3X/b/6/b64537790a6b9c9cc3e22265426ecf4ecbc3d6c0.jpeg)

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [November 3, 2022, 3:26pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/7 "2022-11-03T15:26:27Z")

</div>

Hi @Kool_Baudrillard

Ok so this is an easy one.  
Your pages are set to a size 10.  
And you set the incrementor to expect 10k records.  
So it thinks the looping is done because 10 \< 10k 😉

---

<div class="post-metadata">

**Author:** ![Kool\_Baudrillard](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kool_baudrillard/32/14282_2.png) [@Kool\_Baudrillard](https://community.n8n.io/u/Kool_Baudrillard)\
**Post date:** [November 3, 2022, 3:30pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/8 "2022-11-03T15:30:31Z")

</div>

yes, but after the second iteration it stops, even if I set it too 100 = 100.

 ![Bildschirmfoto 2022-11-03 um 16.29.53](https://europe1.discourse-cdn.com/n8n/original/3X/f/3/f383baf1c32173f060dd6fba0d027ede3b77ab29.png)  
 ![Bildschirmfoto 2022-11-03 um 16.30.01](https://europe1.discourse-cdn.com/n8n/original/3X/8/e/8eb8ec733cbf3fb87b77eb7e2fb879ec6046220a.jpeg)  
 ![Bildschirmfoto 2022-11-03 um 16.30.12](https://europe1.discourse-cdn.com/n8n/original/3X/f/b/fb2d02224ff68f6fadf020c6949d76a33ee22f3a.jpeg)

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [November 3, 2022, 3:31pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/9 "2022-11-03T15:31:51Z")

</div>

Thats because the iterator only receives 1 item. You need to split the items to show the iterator how many you received.  
Or simply place the MYSQL after the iterator. As I see you are doing a HTTP and insert. This is causing the issue with the items.

can also set it to expect 1 item, but that would give ya an infinite loop.

If the API in that HTTP can return some kind of flag that shows you if there is items left you can use that as well. but you’ll need to check if that is an option.

---

<div class="post-metadata">

**Author:** ![Kool\_Baudrillard](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kool_baudrillard/32/14282_2.png) [@Kool\_Baudrillard](https://community.n8n.io/u/Kool_Baudrillard)\
**Post date:** [November 3, 2022, 3:48pm UTC](https://community.n8n.io/t/stuck-in-iteration/19321/10 "2022-11-03T15:48:53Z")

</div>

😃 it works! Thx, more a brain bug than a software bug 😃
