How it works
Provide anExecutionConfig 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.
SDK defaults
| Operation | Option | Default Timeout | Default MaxAttempts |
|---|---|---|---|
| LLM generate / stream | WithLLMExecutionConfig | 30 min | 3 |
| Tool authorization | WithToolAuthExecutionConfig | 30 min | 1 |
| Tool execution | WithToolExecutionConfig | 30 min | 3 |
| MCP | WithMCPExecutionConfig | 30 min | 3 |
| A2A | WithA2AExecutionConfig | 30 min | 3 |
| Retriever prefetch | WithRetrieverExecutionConfig | 5 min | 3 |
| Memory recall / store | WithMemoryExecutionConfig | 5 min | 3 |
| Conversation persist | WithConversationExecutionConfig | 30 s | 1 |
| Sub-agent delegation | WithSubAgentExecutionConfig | (agent run timeout) | 1 |
WithTimeout) is used as the ceiling.
Retry backoff
WhenMaxAttempts is greater than 1, failed attempts use exponential backoff with SDK defaults:
| Parameter | Value |
|---|---|
| Initial interval | 1 s |
| Backoff coefficient | 2× |
| Maximum interval | 10 min |
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.
| Timeout type | Scope | Set via |
|---|---|---|
| Agent run timeout | Entire Run / Stream / RunAsync call | WithTimeout or context deadline |
| Per-operation timeout | Single attempt of one operation | With*ExecutionConfig |
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 both the in-process and Temporal runtimes with the same semantics.Example
Execution Config
LLM, tool, and sub-agent overrides with calculator and time tools
Related
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