An AI agent run by a person stops when that person stops. An agent run by a scheduler does not: it starts on its own every morning, decides for itself how many times to call the model and tools, and stops only when something stops it. Without deliberately designed limits, it is an economic actor with no ceiling. This article covers which limits to set, how to prevent unnecessary work, and why saving checkpoints is not the same as oversight.
Scheduled Work by the Numbers
96.7%
of performance retained by the lean configuration in the Efficient Agents paper, at about 57% of the cost of its comparison (US$0.228 versus US$0.398 per task)
18.9-29.7%
runtime token reduction reported by the SupervisorAgent paper on the tasks it tested
7 types
of separate limits in the table below, from call counts to no-progress detection
Good caching doesn't make work cheap
Prompt caching lowers the price of repeated input, but it doesn't make reasoning, output, tool calls, or runtime free. An agent stuck in a loop can have a very high cache hit rate and still be a control failure, because the problem isn't the price per token but the number of iterations. The caching mechanics are explained in the cross-provider prompt caching guide; here the focus is stopping unnecessary work from the start.
Set independent limits
A single limit, such as a recursion limit, is only a backup safeguard. A recursion limit is not a cost budget, and a wall-clock limit can trigger while the provider stream is idle without capping token spend. The research report behind this article recommends limits that are independent of one another:
| Limit | What it prevents |
|---|---|
| Number of model calls | Endless loops |
| Calls per tool | One tool called repeatedly, such as web search |
| Total input, cache and output tokens | Bloated context |
| Estimated cost in dollars | Billing surprises |
| Total time and idle time | Stuck jobs |
| Number of sub-agents and recursion depth | Uncontrolled branching |
| Detection of duplicate or no-progress calls | Loops with the same arguments |
Equally important is what happens when a limit is reached. Sensible options: return the partial results that have already been verified, request human review, or fail safe. Quietly starting a new round defeats the whole control.
Here is an example of what a configuration can look like. The numbers are invented for illustration, not recommendations; real values must come from measuring your own work.
run:
occurrence_id: "ringkasan-harian:2026-11-06T07:00Z"
precheck: "ada_input_baru_sejak_sukses_terakhir"
limits:
model_calls: 30
tool_calls_per_name: {web_search: 15, document_write: 2}
output_tokens: 30000
estimated_cost_usd: 5.00
wall_time_seconds: 1800
inactivity_seconds: 180
on_budget_exhausted: "simpan_hasil_sebagian_dan_minta_tinjauan"Don't call the model if nothing has changed
A schedule that calls the model every time, even though the input is the same as yesterday's, wastes money and produces output that doesn't need review. The recommended pattern is a model-free pre-check: compare the source cursor, content hash, data freshness, and the last successful artifact. If nothing has changed, the job finishes before the model is called. This kind of check is deterministic and nearly free, which makes it the cheapest saving available.
The same principle appears in efficiency research. The Efficient Agents paper introduces a cost-of-pass way of thinking: quality must be measured together with the cost of getting a passing result. The lean configuration they report retains 96.7% of the performance of its comparison (OWL) at US$0.228 versus US$0.398 per task. SupervisorAgent reports a runtime token reduction of 18.9% to 29.7% with no drop in success rate under the reported settings. These figures come from each paper's own test setup, so treat them as a direction, not a guarantee. The message: match effort to task complexity, and don't run the deepest research flow on every schedule.
Checkpoints are not oversight
LangGraph provides checkpoints, snapshots of graph state that are useful for resuming work. But a checkpoint is state storage. According to the research report behind this article, distributed scheduling, locks between workers, retries, and budget enforcement require a control layer outside the checkpoint, and a checkpoint does not guarantee that external side effects happen exactly once. LangChain 1.x middleware does provide model and tool call limits, summarization, context editing, retries, and human approval, but its defaults and versions change, so it is best wrapped in a job envelope of your own.
For jobs that run for hours to days, durable execution engines such as Temporal store workflow history and retry activities according to policy. A case study published by the vendor Temporal about a customer service agent at Gorgias, reported to have reached production in about a month, serves as an existence proof that this approach is feasible, not as an independent evaluation. Even with such an engine, effects on the outside world still need idempotency keys: an email send or database write repeated because a worker died must not happen twice.
Recommended practices:
- Split the job into stages that each produce an artifact, then save a checkpoint between them. - Derive the execution ID from the job name and scheduled time, so a duplicate schedule doesn't run twice. - Cache results only for pure, deterministic work, such as fetching and extraction keyed by content hash, never for tools with side effects. - Store artifacts and changes between runs; don't replay an ever-longer transcript and rely on the cache. The ACON and Complexity Trap findings on tool output dominating context support this; see also the ladder for compressing context and tool output.
Test that the limits actually trigger
A limit that has never been tested is a guess. Useful test scenarios: unchanged input, one source changed, a stalled provider, the same tool result repeating, a deliberately created endless loop, the budget exhausted on each dimension, a worker killed midway, and a schedule that fires twice. Measure the number of calls, tokens, and cost per successful artifact, the duplicate call rate, and how much work is repeated after resuming. Make sure the limits you wrote, not the framework's defaults, are what actually stop execution.
Finally, every scheduled job needs an owner and a review schedule. A recurring agent without an owner is an unbounded liability. A similar principle, that a model should not be trusted with what only code and permissions can guarantee, is discussed in architecture principles for spatial agents.
Frequently Asked Questions
A recursion limit only caps graph depth. It doesn't cap dollar cost, tokens, or time, and it doesn't detect duplicate calls. Use it as a backup safeguard, not a budget.
Turn climate goals into a verified portfolio
TREEO connects the full carbon cycle — eligibility, simulation, real-time monitoring and registry-ready reporting — combining expert consulting with dMRV technology so the evidence exists before anyone asks for it.



