Soften the hardcoded workflow timeout or make it configurable

AI-generated summary

In this Feature discussion tagged workflows, user mcwumbly addresses a limitation when migrating logic from agent nodes to code-based workflows. While this transition offers significant benefits—such as reduced token usage, faster execution, and more predictable behavior—it introduced a new obstacle: a hardcoded sandbox execution timeout of 1000ms. mcwumbly notes that previous workflows relying on agent nodes exceeded this duration without issue, suggesting agent node execution times are calculated differently.

The issue arises specifically when using loops to process large datasets in batches from an external source. Although the loop structure allows for smooth batch processing, applying a global timeout to the entire workflow becomes problematic for these extended operations. mcwumbly points to the source code where this constraint is likely defined: sandbox_budget.rb.

The core request is to provide a “way out” for these efficient, code-based workflows. The user suggests either softening the hardcoded timeout or making it configurable to accommodate workflows that, despite being faster than their agent-based predecessors, still require more than one second of total execution time due to loop iterations.

I have some workflows where I’ve been relying on agents to do a lot of heavy lifting. Recently, I’ve been porting the logic over from agent nodes that load large prompts into code.

The rationale for doing so is:

  • save a ton of tokens
  • workflow runs are much faster
  • behavior is more predictable

The agents were a great way to get things going quickly, but now I want speed and reliability.

After getting a couple of these moved over, during one test run, I hit this error for the first time:

Sandbox execution time exceeded 1000ms for this workflow

I found it surprising, because my previous workflows that relied on agent nodes took much longer.

But apparently, agent node execution time is counted differently or something. I think this is where this is being set and evaluated:

One thing worth noting is that I’m using a loop in this workflow.

It processes things in batches from an external data source with a data set that may be quite large. The loop handles this quite well, allowing for me to configure the per-loop batch size to keep things running smoothly.

But, that does mean a timeout that applies to the workflow as a whole is a bit troublesome in this case.

I am not sure what the right solution is here, but I’d like to have some “way out” here and let these workflows that feel much more efficient to me run without hitting this timeout.