Key Takeaways

  • Clay runs agentic workflows across tables of up to 50,000 companies, creating massive, spiky inference workloads that crush standard provider limits.
  • Rather than relying on heavyweight orchestration platforms like Temporal or LangGraph, Clay built its infrastructure on top of BullMQ.
  • Reliability depends on custom throttling mechanisms that detect provider outages, pause tasks during rate limits, and resume work cleanly.
  • Frontier models fail at self-reflection, repeatedly executing identical broken CLI commands instead of diagnosing errors from their own execution traces.

Skip Heavy Orchestrators When a Queue Handles the Spike

Engineering teams building agent systems often reach for complex orchestration frameworks right away. They install Temporal or LangGraph to build multi-step execution graphs. Clay took a simpler route.

Jeff Barg, Head of AI at Clay, explains that the company handled its production workload without those tools. “We have still gotten away to the large for the most part building on top of Bull MQ,” (play from 42:51) Barg says.

The core challenge at Clay comes from batch execution over large spreadsheets. “I think also at our scale because people are running stuff in in a table like our inference workloads tend to be quite spiky, right?” (play from 46:18) Barg notes. “So it's like you could imagine someone has a table of 50,000 companies that they're trying to research over and you run an agent for each of those companies.” (play from 46:23)

When an account triggers an agent across 50,000 rows simultaneously, tens of thousands of LLM requests hit provider endpoints at the same second. Off-the-shelf orchestrators can add unnecessary state-management weight without solving the primary problem: downstream rate limits. BullMQ, a Redis-based queue, gives Clay the ability to schedule, batch, and throttle requests directly.

The critical engineering work was not building complex DAGs. It was building resilience against provider failures. Barg explains: “a lot of the work was around throttling making sure that we were actually could fall over to like if you know if an inference provider went down or it was rate limiting us we could kind of pause execution and resume all of that work” (play from 46:41)

When an inference API throttles requests or experiences an outage, Clay's backend pauses the queue, shifts traffic to backup providers if available, and resumes the batch without dropping data or failing user tables.

Trace Debugging Breaks Model Self-Reflection

While message queues solve the throughput bottleneck, model behavior introduces an unsolved failure mode. Founders frequently assume that passing execution history back to an agent allows it to correct its own mistakes.

In practice, agents fail repeatedly at self-diagnosis. Barg points out that frontier models lack basic troubleshooting awareness: “one like the models are still kind of dumb. Like there... just like, you know, like trying CLI commands with the same inputs over and over again and just not correcting them” (play from 0:34)

When an agent tool call fails, returning the raw trace rarely fixes the problem. The model does not step back, examine the error code, and change its approach. Instead, it enters an infinite loop, attempting the same broken command with identical arguments.

Barg emphasizes that this capability remains out of reach for current systems. “model capability is being able to look at an agent trace and figure out what's wrong with it. I mean, maybe it's just like too self-reflective, but it still really doesn't work.” (play from 1:10:11)

If an agent architecture relies on the model to catch its own logic bugs or syntax errors, it will fail in production. Reliability requires deterministic application code: step counters, loop breakers, and explicit timeout rules.

What to Do With This

Review your agent pipeline tomorrow. If your team is struggling with rate limits during batch jobs, strip out unnecessary orchestration layers and implement a straightforward queue using BullMQ with custom pause-and-resume throttling. Add deterministic loop detection to kill tasks whenever an agent runs identical tool inputs consecutively, instead of waiting for the model to debug its own trace.