Skip to main content

Retry & Error Handling

Retry handles transient errors (rate limits, network issues, server errors) automatically with exponential backoff.

Configuration

defaults:
retry:
enabled: true
max_attempts: 3
on_exhausted: return_last

actions:
- name: extract_metadata
retry:
max_attempts: 5
on_exhausted: raise

Options

OptionTypeDefaultDescription
enabledbooltrueEnable/disable retry
max_attemptsint3Maximum attempts (1-10)
on_exhaustedstringreturn_lastBehavior when retries exhausted

Exhaustion Behavior

ValueBehavior
return_lastReturn last response, workflow continues
raiseRaise exception, workflow fails

Retryable Errors

Error TypeExamplesRetryable
Rate LimitsHTTP 429, quota exceededYes
Network IssuesConnection timeout, DNS failureYes
Server ErrorsHTTP 502, 503, 504Yes
Invalid RequestBad API key, malformed inputNo
Schema ViolationInvalid JSON outputNo (uses reprompt)
info

For invalid LLM outputs, Agent Actions uses reprompting instead of retry.

Provider Support

All provider-specific errors are normalized into unified RateLimitError and NetworkError types, ensuring consistent retry behavior across OpenAI, Anthropic, Gemini, Cohere, Mistral, Groq, and Ollama.

Best Practices

Use raise for CI/CD:

retry:
max_attempts: 3
on_exhausted: raise

Use return_last for partial results:

retry:
max_attempts: 3
on_exhausted: return_last

See Also