While loop is iterating endlessly and incurring costs with no way to end it

I started testing the while loop node within the agent builder, but ran into an infinite loop, and there is no way to end or cancel the job. Jobs that I kicked off 30+ minutes ago are still running.

image

I’d suggest reaching out to support: https://help.openai.com/en

see if you can get a reimbursement, if its their fault they usually give the money back

1 Like

Thank you! This workflow was kicked off using their preview UI, but I think an error happened during execution

could either be an error on their end or someone trying to bug hunt and poking around vulnerabilities to report for money, hence why I’d suggest reporting to oai just to make sure you get heard (they also sometimes take a week to reply)

oh, and good luck!

Hi Anthony,

There’s currently a known bug where while loops that include user approval or state checks can get stuck running indefinitely, and the preview UI doesn’t yet expose a way to cancel them mid-run. The team’s working on a backend fix to properly suspend and stop workflows in these cases.

For now, the best workaround is to avoid while loops for testing and instead use a conditional branch that checks a state variable. Confirming that support@openai.com will help you with a refund for the credits lost due to this bug!

2 Likes

How do you use a conditional branch to simulate a while loop. Agent build pops an error message that says workflow contains cycles