Retry Policy
RetryPolicy configures how Waymark responds when an action raises an
exception. It's passed to Workflow.run_action(...) per call. See the
Retries & Timeouts guide for the conceptual
walk-through; this page is the precise API surface.
Semantics to know:
attemptscounts total executions:attempts=5is one initial try plus up to four retries, andattempts=1means fail immediately.- Omitting
attemptscompiles to a budget of 100 retries. Set it explicitly unless you want that. backoff_secondsis parsed and persisted, but the runtime currently dispatches retries immediately. Don't rely on it for pacing yet; put anawait asyncio.sleep(...)inside the action instead.- Field values must be literal constants in the workflow body. The
compiler reads them from the AST at registration, so a policy built
from a runtime variable won't be picked up. The exception:
self.retry_policyinstance attributes resolve fine.
CLASSwaymark.workflow.RetryPolicy
Retry policy for action execution.
Maps to IR RetryPolicy: [ExceptionType -> retry: N, backoff: Xs]
Args: attempts: Maximum number of retry attempts. exception_types: List of exception type names to retry on. Empty = catch all. backoff_seconds: Constant backoff duration between retries in seconds.
Class Constructor
- Name
attempts- Type
- Optional[int]
- Description
Default: None
- Name
exception_types- Type
- Optional[list[str]]
- Description
Default: None
- Name
backoff_seconds- Type
- Optional[float]
- Description
Default: None