Describe the problem/error/question
My purpose is generation gemini image generation. I have an input image and 6 input prompt and getting an image. I would like to generate 6 variation image with the my prompts. For the first input image is OK but for the second input image the automation does not work.
Process;
- Create a folder
- Getting the 1st input image and first prompt
- Generation AI image and save it to the created folder.
- Loop over for 6 different prompt for the first input image.
- Loop over all the sceneraio for the 2nd input image.
Problem: Automation is creating only the folder for the second image and are not generation a AI image.
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node

Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
Your symptom (works for image 1, image 2 only gets a folder and no generation) is the classic nested Loop Over Items problem. It is almost never the Gemini node.
Why it happens
n8n's Loop Over Items (SplitInBatches) keeps its batch counter inside the node. Your inner loop over the 6 prompts finishes all 6 for image 1 and stays in the "done" state. On the second outer iteration your image loop hands it image 2, but the inner loop still believes it already finished, so it fires its done output immediately and skips the Gemini and upload nodes. Everything upstream of the inner loop still runs, which is exactly why image 2 gets its Create Concept Folder step and nothing else.
The one-node fix
Open your inner Loop Over Prompts node, go to Options, and turn on Reset. That forces the inner loop to re-initialize every time a fresh image arrives from the outer loop instead of staying "done." This is the fix for the large majority of "nested loop runs once" reports.
Two things worth a quick check while you are in there:
- Confirm Build Prompts actually emits 6 items per image. If a run shows a lower "items total" than you expect, the loop has fewer things to iterate than you think.
- Your inner loop's done branch should return to the outer image loop, which in your screenshot it does, so the wiring itself is fine. Reset is the missing piece.
Worth considering: drop the inner loop entirely
Nested SplitInBatches loops are the single most fragile pattern in n8n, and your Gemini calls run strictly one at a time, so 2 images at 6 prompts each is 12 sequential generations. Since you are on nano-banana (Gemini 3.1 Flash Image), you can fan the 6 prompts out as 6 items and run them in parallel with an async image API. I use KIE.AI, which exposes nano-banana as a submit-then-poll job:
- Build 6 Prompts (a Code node) emits 6 items.
- Submit Task is a single HTTP node with no loop around it. Because an HTTP node runs once per input item, all 6 jobs fire near-simultaneously and each returns a
taskId.
- A short Wait then Poll step collects each result. Items route on their own: a finished one downloads and saves immediately, a pending one waits and re-polls, so fast jobs do not wait on slow ones.
There is no inner Loop Over Items anywhere, so there is no reset state to get wrong, and all 6 render at once instead of one at a time.
I put a sanitized reference workflow below (click the </> in the composer and it imports directly). The outer image loop stays; the inner prompt loop is gone. Swap the Google Drive nodes for wherever your images live, drop your KIE.AI bearer credential on the two HTTP nodes, and edit the six scenario strings in Build 6 Prompts. There is also a sticky note showing the one-line change to run image-to-image (variations of the source image) instead of text-to-image.
Either path fixes you: Reset if you want to keep your current design, or the async fan-out if you want it faster and harder to break as you add more input images.
Hope that helps,
Michael
Hi @Trilogy_Elektronik
Put the prompt side of this in a sub-workflow: the image loop stays in the main workflow, and the 6 prompts, the Gemini node and the Drive upload move behind an Execute Sub-workflow node that runs once per image. Each call is its own execution, so the prompt loop starts clean for image 2 and every image after it, and the per-image data is released after each call instead of piling up in one long run.
Select those nodes on the canvas, right click the background and pick “Convert to sub-workflow” (n8n 1.97.0+), the expressions get rewired for you.
See this: