Skip to content

Comments

Fix to prevent workflows retrying indefinitely on default policies#305

Merged
jamescmartinez merged 1 commit intomainfrom
fix-infinite-retry
Feb 14, 2026
Merged

Fix to prevent workflows retrying indefinitely on default policies#305
jamescmartinez merged 1 commit intomainfrom
fix-infinite-retry

Conversation

@jamescmartinez
Copy link
Contributor

this PR adds a fix to prevent workflows retrying indefinitely on default policies

unbounded retries are still supported by setting retryPolicy.maximumAttempts
to Infinity or 0

unregistered workflows are still rescheduled infinitely with backoff instead
of failing terminally so runs survive long rolling deploys

Copilot AI review requested due to automatic review settings February 14, 2026 20:15
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.maximumAttempts to 1, with explicit support for unlimited retries via maximumAttempts: 0 (or Infinity).
  • 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.

@jamescmartinez jamescmartinez merged commit 0e40a51 into main Feb 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant