Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent in the Loop max iterations with tool use #14032

Open
anflsc2024 opened this issue Mar 18, 2025 · 6 comments
Open

Agent in the Loop max iterations with tool use #14032

anflsc2024 opened this issue Mar 18, 2025 · 6 comments
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@anflsc2024
Copy link

Describe the problem/error/question

The agent retains or uses only the first index at the loop's prompt. The results the agent returns are always the same.

What is the error message (if any)?

There is no error message.

Please share your workflow/screenshots/recording

Image

(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.)
⚠️ WARNING ⚠️ If you have sensitive data in your workflow (like API keys), please remove it before sharing.

Share the output returned by the last node

Debug info

core

  • n8nVersion: 1.82.3
  • platform: npm
  • nodeJsVersion: 20.18.3
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: community

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: memory

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/134.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2025-03-18T05:42:48.845Z}

@Joffcom
Copy link
Member

Joffcom commented Mar 18, 2025

Hey @anflsc2024,

We have created an internal ticket to look into this which we will be tracking as "GHC-1267"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Mar 18, 2025
@anflsc2024
Copy link
Author

"output":
"Agent stopped due to max iterations."

I found the reason. I think the max iterations of 6 exactly of one act I loop through

@anflsc2024 anflsc2024 changed the title Agent in the Loop Agent in the Loop max iterations with tool use Mar 18, 2025
@Joffcom
Copy link
Member

Joffcom commented Mar 19, 2025

Hey @anflsc2024

That would do it, so as you are hitting the max iterations I don't think there is a bug here. Let me know if you believe this to be a bug still and we can work out what to do next.

@Joffcom Joffcom added the Needs Feedback Waiting for further input or clarification. label Mar 19, 2025
@anflsc2024
Copy link
Author

I still think there is a bug. Only the first item from the loop is processed in a continuous loop. I only got it working now by placing the agent in a sub-workflow. This indicates to me that there's something wrong with the main implementation.

@Joffcom Joffcom removed the Needs Feedback Waiting for further input or clarification. label Mar 20, 2025
@Joffcom
Copy link
Member

Joffcom commented Mar 21, 2025

Hey @anflsc2024,

Can you clarify what the bug is and provide a minimal workflow that reproduces it? to me it looks like it is working as expected if the Agent node is hitting a limit and not outputting an item the loop will finish this also happens with normal nodes so we have the option to continue on error and always output data so the output can be checked and passed back to the loop for the next run.

@Joffcom Joffcom added the Needs Feedback Waiting for further input or clarification. label Mar 21, 2025
@anflsc2024
Copy link
Author

Bug.json

Here you can import the workflow

@Joffcom Joffcom removed the Needs Feedback Waiting for further input or clarification. label Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants