Skip to main content
The agent loop runs several operations in sequence: an LLM call, optional tool executions, memory reads/writes, conversation persistence, and sub-agent delegation. By default, each operation uses a conservative SDK-wide timeout and attempt limit. Execution config lets you tune these per operation without changing the global agent timeout.

How it works

Provide an ExecutionConfig for one or more operations via With*ExecutionConfig options when creating the agent. Zero fields keep the SDK default — only set what you want to change.
At runtime the SDK merges your overrides onto the defaults and produces a fully resolved policy — including exponential backoff — that the runtime enforces on each attempt.

SDK defaults

Sub-agent timeout has no fixed SDK default — when no override is set and the resolved timeout is still zero, the agent run timeout (WithTimeout) is used as the ceiling.

Retry backoff

When MaxAttempts is greater than 1, failed attempts use exponential backoff with SDK defaults: MaxAttempts: 1 runs the operation once with no retry. Backoff is not user-configurable today.

Usage

Override only the operations you want to tune:

Override a single field

Zero fields fall through to the SDK default:

Relationship to agent run timeout

ExecutionConfig controls individual operation attempts. The agent run timeout (WithTimeout or context deadline) is a ceiling on the entire run — if it fires, the run ends regardless of where the current operation is. A single LLM call timing out after Timeout does not end the run — it counts as a failed attempt and may be retried until MaxAttempts is exhausted. The run ends only if the agent run timeout fires or all attempts are exhausted.

Works with both runtimes

Execution config applies to the in-process, Temporal, and Restate runtimes with the same semantics.

Example

Execution Config

LLM, tool, and sub-agent overrides with calculator and time tools

Timeouts & Modes

Agent run timeout, approval timeout, and agent modes

Approvals

Per-tool approval timeout and approval handler

Sub-agents

Sub-agent delegation and depth limits

MCP

MCP integration