Prompt
retry failed workflow steps automation
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
To retry failed workflow steps automatically, you generally need to do three things:
-
Detect failure
- Mark a step as failed when it returns an error, times out, or throws an exception.
-
Decide retry policy
- Set rules like:
- max retries:
3 - delay between retries:
5s,30s, etc. - retry only for transient errors (network, rate limit, timeout)
- stop retrying for permanent errors (validation, auth failure)
- max retries:
- Set rules like:
-
Implement the retry loop
- Re-run only the failed step, not the whole workflow, unless the step depends on prior state.
Generic example
for attempt in range(max_retries):
try:
run_step()
break
except TransientError as e:
if attempt == max_retries - 1:
raise
sleep(backoff(attempt))
Best practices
- Use exponential backoff with jitter
- Keep retries idempotent to avoid duplicate side effects
- Log each retry attempt
- Track retry counts in workflow state
- Add a dead-letter / manual review path after repeated failures
If you’re using a workflow tool
Many platforms support this natively:
- Airflow:
retries,retry_delay - Temporal: activity retry policies
- AWS Step Functions:
Retryfield - GitHub Actions: limited step/job retry via custom logic or marketplace actions
If you want, I can give you:
- a specific implementation for your platform,
- a no-code automation setup, or
- sample code in Python / JavaScript / Power Automate / Zapier / n8n.