PADError Handlingretryresilienceerror-handling
Retry with Exponential Backoff
A production-tested retry wrapper for unreliable operations — API calls, file reads, web interactions. Uses exponential backoff with configurable base delay and maximum attempts. Optionally adds jitter to prevent thundering-herd problems in multi-bot deployments.
Members OnlySign in or create a free account to view and copy this pattern.
Usage Notes
- Set MaxRetries to the number of attempts (recommended: 3–5 for APIs, 2–3 for UI interactions).
- BaseDelaySeconds controls the initial wait. Delay doubles each attempt: 1s → 2s → 4s → 8s.
- Replace the CALL SomeOperation() block with your actual action.
- The THROW at the end re-raises the exception after all retries are exhausted so your caller handles it properly.
- For PAD Desktop, wire this into your global ON BLOCK EXIT handler for full error coverage.
Requirements
- Power Automate Desktop 2.30+
- Variables: RetryCount (Integer), MaxRetries (Integer), BaseDelaySeconds (Number)