Describe the problem/error/question
My workflow is generating AI Slop images using a local installation of ComfyUI. It runs just fine once, but I would like it to run 10 times before stopping.
What is the error message (if any)?
I cannot figure out how to set up a simple FOR loop, and then specify that I want to run it 10 times. I tried adding an IF node to the end of the workflow and then checking “{{ runIndex }} < 10”, but this leads to just skipping a bunch of nodes. The other thing I tried (which is included in the workflow below) is to pre-generate an array of my input data, and have it loop over that. But, it leads to an error down the time.
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
- n8n version: 1.94.1
- Database: postgress from docker-compose
- n8n EXECUTIONS_PROCESS setting <don’t know, I didn’t modify this>
- Running n8n via Docker
I create a workflow to control the loop max execute 5 times.
Maybe you can find the concept and applyt to your workflow
I appreciate your reply, but this is similar to what I have already tried. The reason I posted my entire workflow is because I can’t seem figure out a way to simplify the error. All the pieces seem to work individually, but then when I combine it, or try to loop it breaks. I have spent days trying to get ChatGPT to help me debug, and it keeps coming back to things like lazy evaluation, but none of that is helping.
or maybe you can tell more about how you currently try to set up the loop.
How it breaks?
Breaks at where?
What’s the expected result?
From your entire workflow. It’s hard to find where you put the loop already.
Despite is quite a long one. Seems one direction only.
Another solution is put them as sub-workflows to modulize. Then it will be more easy to debug or make change if those sub-workflows are already finish building.