Fix to prevent workflows retrying indefinitely on default policies#305
Merged
jamescmartinez merged 1 commit intomainfrom Feb 14, 2026
Merged
Fix to prevent workflows retrying indefinitely on default policies#305jamescmartinez merged 1 commit intomainfrom
jamescmartinez merged 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR changes OpenWorkflow’s default retry behavior to avoid unbounded retries on workflow-level failures, while preserving infinite rescheduling (with backoff) for runs whose workflow definitions aren’t registered on the claiming worker (to survive rolling deploys).
Changes:
- Make workflow-level failures terminal by default by setting
DEFAULT_WORKFLOW_RETRY_POLICY.maximumAttemptsto1, with explicit support for unlimited retries viamaximumAttempts: 0(orInfinity). - Introduce a dedicated retry policy for “missing workflow definition” errors that reschedules indefinitely with a generous backoff.
- Update tests, docs, and architecture notes to reflect the new default behaviors (including step retry defaults).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/openworkflow/workflow.ts | Adjusts default workflow retry policy and updates terminal/retry decision logic to treat maximumAttempts: 0 as unlimited. |
| packages/openworkflow/workflow.test.ts | Adds coverage for “unlimited retries when maximumAttempts is 0”. |
| packages/openworkflow/worker.ts | Adds a dedicated retry policy for missing workflow definitions and uses it when a claimed run can’t be matched to a registered workflow. |
| packages/openworkflow/worker.test.ts | Updates/extends worker tests to assert new default terminal behavior and missing-definition rescheduling behavior. |
| packages/openworkflow/execution.ts | Changes default step retry policy to maximumAttempts: 10 and ensures step-exhaustion leads to terminal workflow failure by default. |
| packages/openworkflow/client.test.ts | Updates expectations for default terminal failure behavior when failing a workflow run. |
| packages/openworkflow/backend.testsuite.ts | Adjusts backend retry-policy usage in tests to explicitly allow rescheduling where needed. |
| packages/openworkflow/CHANGELOG.md | Documents the change in default retry behavior and notes unlimited retry configuration. |
| packages/docs/docs/retries.mdx | Updates retry documentation to describe step defaults, workflow-level retry opt-in, and missing-definition rescheduling. |
| ARCHITECTURE.md | Updates system behavior description for workflow-level retries and missing-definition handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR adds a fix to prevent workflows retrying indefinitely on default policies
unbounded retries are still supported by setting
retryPolicy.maximumAttemptsto
Infinityor 0unregistered workflows are still rescheduled infinitely with backoff instead
of failing terminally so runs survive long rolling deploys