Having an issue with looping (multiple loops in one workflow)

I am having an issue with looping, and I am pretty sure it is me just not grasping things properly

the ideal way I need this to go is this:
I have a list of counties at the start in a json, that list is then split out into individual county names, 17 in total
that county is then sent to my property api and it spits back to me all the properties in that county for sale, usually between 50-500 properties
the workflow then goes into a loop requesting details for each property, which I then take the data it sends back and post it to my crm.

so, i need two loops, one to cycle through each county and get the properties
and a second to cycle through each property to get the details

here is the workflow I am using, but for some reason when it gets done with the first batch of details (the second loop), it goes back up to the first loop (the list of counties) and just cycles through all the counties and never goes back to the second loop to get the details

can you all recommend a better way of doing this? or is my looping misconfigured?

Information on your n8n setup

  • 1.41.1
  • Self Hosted
  • Docker, DigitalOcean
  • Ubuntu

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:

Try this

nope, did the same thing it has been doing

it handles the first county in my list, then goes back to the first loop and just gathers the other counties lists and then ends, it never cycles through any other counties, just the first one in the list

you can kind of see the outcome by the numbers in the nodes here:

It seems the nodes are not completeting the loops

Use this as the loop node

Try it with something like this

still doing the same thing, it runs through the first loop one time, then sends the data down to the second, it runs all the properties for that county, then comes back to the first loop and runs that loop until it is out of couties and ends. it never sends all the other counties to the second loop, but it collects the first set of data for the counties, just doewn’t get the details

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