AI Agent runs fine from "Execute Step" but enters a infinity Loop when running the Workflow itself

Hello everybody,
i am currently getting started with n8n and face one issue i cannot pin down the root cause.
It is about the AI Agent Node gooing into an infinity loop. Maybe somebody came across this?

Describe the problem/error/question

If i run the AI Agent Node from “Execute step” to test it works perfectly fine and i see the expected output reliably. The options to run only once and always output data are set, so i would expect it to proceed with some empty data if the LLM call fails.
But when i execute the full workflow the AI Agent Node goes into a never ending loop.

View after the workflow got executed (until i stop it)
Interestingly when running from the workflow i see output from the model provider that the text based model cannot inspect images, but it works from execute step and gemini-2.5-flash should be multi modal.

View from Execute Step:

Please share your workflow

Information on your n8n setup

  • n8n version: “1.111.0”
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Debian GNU/Linux 12 (bookworm)

If anyone has an idea that would be greatly appreciated.
Thanks.

What I would try is:

  • Try a different Gemini version
  • Try increasing the max tokens
  • Try using gemini through OpenRouter
  • Try another model to check if it’s Gemini-related

Hope this helps!

1 Like

Thanks for the ideas.
It does make me wonder why this should have different effect if the node is running from manual execution or from within workflow.
But anyhows your comment to test it differently lead me to just try the “Analyze Image” Node from Gemini and this works fine for now.

Thanks a lot.