Infinite Loop error message

(Can’t attach evidence here; it contains a proprietary API key. Please contact me via email.)

I seem to have surfaced a significant bug in the underlying MindStudio platform. I’m building an agent for a client, and the following error occurs randomly on nearly every run, but in different places:

**"Infinite loop prevention: The same run workflow block can not be invoked more than once in a single run"

**
The agent has multiple sub-workflows, going three levels deep below the main workflow. But there are no logic loops nor recursion loops anywhere. All Run Workflow blocks have retry attempts set to zero. The error occurs in different sub-workflows at different times. “Insights” with chat has suggested I set all my sub-workflows to sequential mode, but that doesn’t help. Even in sequential mode, I can trace the steps through the JSON array, and find that partway through it jumps back to the beginning of the array and starts over. Shortly after that the “infinite loop” error is issued.

Any guidance you can offer, would be gratefully appreciated!

Update:

An earlier version of this agent was working fine a week ago. This agent does deep research on a list of businesses. My development list is seven businesses, but in production the list could be several hundred per run.

I spent the entire weekend trying to isolate the issue, and I believe I found it: It seems the issue is related to the “Search Google” block. Using mock data to avoid the block, I got no error message. I even bumped up the test from seven businesses to 100 – no “infinite loop” error. So then I used a Generate Text block with a Perplexity model that mimicked a Google search, and it ran all the way through without error. Slower and lower quality than “Search Google”, but it worked.

Details have been sent via email to support.

This is a critical issue for a client. I hope you can find a fix, quickly.

Thanks!

Hi Ken - can you try increasing this setting and letting me know if it solves your issue?

Hi Jerry,
The original agent was already set at 1000. I bumped it up to the max of 2000, but still got an “infinite loop” warning. After that, flows started either terminating early or recycling through the same input JSON array (I still had every sub-workflow set to “sequential” mode), then it stopped nine minutes later, and when I checked back after a couple hours, it terminated with a “Timeout exceeded” message.

Hi @Ken,

Can you please share the Agent ID so we can take a closer look? You can find it at the bottom of the Metadata settings in your Agent:

Already did that, plus a lot more in-depth detail including all the debugger logs, in my previous emails to “support”. Is there a different email address I should send this to?

Below times are Pacific (PDT):

From: Ken Garnett
Sent: Friday, September 12, 2025 2:09 PM
To: Alex from MindStudio support@mindstudio.ai
Subject: Internal bugs in MindStudio platform
Importance: High

From: Ken Garnett
Sent: Sunday, September 14, 2025 9:58 PM
To: ‘Alex from MindStudio’ support@mindstudio.ai
Subject: RE: Internal bugs in MindStudio platform
Importance: High

Here’s the Agent ID: b509954c-93e0-4c7c-bf95-bd88024aec6a

Hi @jerry-mindstudio and @Alex_MindStudio ,

FYI: My original speculation that the use of a Search Google block was a factor in this Infinite Loop error turns out to be a Red Herring. I had substituted that block with Generate Text block using a Perplexity model that was prompted to mimic a Google search, and the error no longer occurred. Or so I thought, over multiple occasions. But this afternoon I had a test run where the error reoccurred - without the Search Google block being used. So the error has some other cause.

Hi @jerry-mindstudio an @Alex_MindStudio ,
Do you have any updates on this issue that you can share? This is becoming rather urgent for my client.
Is there anything I can do to help?
Thanks!

Same is happening with me. I have a system with 7 workflows and dozens of blocks. I ran last night, and this morning I received the message Timeout.

Hi @ken,

How often are you running into the error? I’ve been trying to replicate it on my end without success.

Hi @fernando.damasio,

That looks like a different issue where one of the tasks in your Agent is taking too long to run. Could you create a separate post under the Support category and include the debugger log link where the error appeared, along with a description of your Agent’s structure?

Hi @Ken,

Here’s what likely caused the issue in the run you shared:
One of your Run Workflow blocks is triggering a Workflow that contains another Run Workflow block, and the first one was set to retry if the run failed. If you later set the retry attempts to 0, the change will not apply until the Agent is published.

To clarify, when a Run Workflow block triggers another Workflow that contains a Run Workflow block, the initial block should always have retry attempts set to 0. Make sure to publish the Agent after making the change so it takes effect.

Let me know how it goes.

Alright, will do. Thanks, Alex! Stand by…

Missed some of your earlier questions, @Alex_MindStudio .

This happens on every run, with one exception: if I short-circuit all the workflows and use mock data, it’ll run through to completion with a tiny test sample (7 elements). I will get a timeout error with larger samples (like 34 elements, or 207 elements (again, short-circuited workflows).

So, @fernando.damasio , I am seeing lots of timeouts. Another team member working on a separate project is also hitting that issue.

@Alex_MindStudio - I have republished the agent ensuring that all workflow settings are proper before doing so. The error still occurs. I’ll be posting the details to the Support category in a moment.

Thanks!

@Alex_MindStudio , @jerry-mindstudio : I’ve posted new details in the Support channel.

I was once a professional software developer for high-tech products, though I haven’t done that in many years. But I can recognize the evidence of a memory corruption error when I see it. And this is definitely what is happening here. Something in your platform has a memory leak which is affecting your flow control mechanism.

This explains why errors are persistent but non-repeatable. I can run the exact same agent multiple times and have it fail in different ways at different places each time.

I would be happy to get on a call with someone (including Sean), to discuss this.