fix: prevent jobId collisions on workflow step retries#13786
Merged
kodiakhq[bot] merged 9 commits intodevelopfrom Oct 21, 2025
Merged
fix: prevent jobId collisions on workflow step retries#13786kodiakhq[bot] merged 9 commits intodevelopfrom
kodiakhq[bot] merged 9 commits intodevelopfrom
Conversation
🦋 Changeset detectedLatest commit: f8ce557 The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 7 Skipped Deployments
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
Collaborator
Author
|
/snapshot-this |
Collaborator
Author
|
/snapshot-this |
Contributor
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/admin-bundler@2.11.1-snapshot-20251021090705yarn add @medusajs/admin-sdk@2.11.1-snapshot-20251021090705yarn add @medusajs/admin-shared@2.11.1-snapshot-20251021090705yarn add @medusajs/admin-vite-plugin@2.11.1-snapshot-20251021090705yarn add @medusajs/dashboard@2.11.1-snapshot-20251021090705yarn add create-medusa-app@2.11.1-snapshot-20251021090705yarn add @medusajs/cli@2.11.1-snapshot-20251021090705yarn add medusa-dev-cli@2.11.1-snapshot-20251021090705yarn add @medusajs/medusa-oas-cli@2.11.1-snapshot-20251021090705yarn add @medusajs/core-flows@2.11.1-snapshot-20251021090705yarn add @medusajs/framework@2.11.1-snapshot-20251021090705yarn add @medusajs/js-sdk@2.11.1-snapshot-20251021090705yarn add @medusajs/modules-sdk@2.11.1-snapshot-20251021090705yarn add @medusajs/orchestration@2.11.1-snapshot-20251021090705yarn add @medusajs/types@2.11.1-snapshot-20251021090705yarn add @medusajs/utils@2.11.1-snapshot-20251021090705yarn add @medusajs/workflows-sdk@2.11.1-snapshot-20251021090705yarn add @medusajs/deps@2.11.1-snapshot-20251021090705yarn add @medusajs/icons@2.11.1-snapshot-20251021090705yarn add @medusajs/ui@4.0.25-snapshot-20251021090705yarn add @medusajs/ui-preset@2.11.1-snapshot-20251021090705yarn add @medusajs/medusa@2.11.1-snapshot-20251021090705yarn add @medusajs/telemetry@2.11.1-snapshot-20251021090705yarn add @medusajs/test-utils@2.11.1-snapshot-20251021090705yarn add @medusajs/analytics@2.11.1-snapshot-20251021090705yarn add @medusajs/api-key@2.11.1-snapshot-20251021090705yarn add @medusajs/auth@2.11.1-snapshot-20251021090705yarn add @medusajs/cache-inmemory@2.11.1-snapshot-20251021090705yarn add @medusajs/cache-redis@2.11.1-snapshot-20251021090705yarn add @medusajs/caching@2.11.1-snapshot-20251021090705yarn add @medusajs/cart@2.11.1-snapshot-20251021090705yarn add @medusajs/currency@2.11.1-snapshot-20251021090705yarn add @medusajs/customer@2.11.1-snapshot-20251021090705yarn add @medusajs/event-bus-local@2.11.1-snapshot-20251021090705yarn add @medusajs/event-bus-redis@2.11.1-snapshot-20251021090705yarn add @medusajs/file@2.11.1-snapshot-20251021090705yarn add @medusajs/fulfillment@2.11.1-snapshot-20251021090705yarn add @medusajs/index@2.11.1-snapshot-20251021090705yarn add @medusajs/inventory@2.11.1-snapshot-20251021090705yarn add @medusajs/link-modules@2.11.1-snapshot-20251021090705yarn add @medusajs/locking@2.11.1-snapshot-20251021090705yarn add @medusajs/notification@2.11.1-snapshot-20251021090705yarn add @medusajs/order@2.11.1-snapshot-20251021090705yarn add @medusajs/payment@2.11.1-snapshot-20251021090705yarn add @medusajs/pricing@2.11.1-snapshot-20251021090705yarn add @medusajs/product@2.11.1-snapshot-20251021090705yarn add @medusajs/promotion@2.11.1-snapshot-20251021090705yarn add @medusajs/analytics-local@2.11.1-snapshot-20251021090705yarn add @medusajs/analytics-posthog@2.11.1-snapshot-20251021090705yarn add @medusajs/auth-emailpass@2.11.1-snapshot-20251021090705yarn add @medusajs/auth-github@2.11.1-snapshot-20251021090705yarn add @medusajs/auth-google@2.11.1-snapshot-20251021090705yarn add @medusajs/caching-redis@2.11.1-snapshot-20251021090705yarn add @medusajs/file-local@2.11.1-snapshot-20251021090705yarn add @medusajs/file-s3@2.11.1-snapshot-20251021090705yarn add @medusajs/fulfillment-manual@2.11.1-snapshot-20251021090705yarn add @medusajs/locking-postgres@2.11.1-snapshot-20251021090705yarn add @medusajs/locking-redis@2.11.1-snapshot-20251021090705yarn add @medusajs/notification-local@2.11.1-snapshot-20251021090705yarn add @medusajs/notification-sendgrid@2.11.1-snapshot-20251021090705yarn add @medusajs/payment-stripe@2.11.1-snapshot-20251021090705yarn add @medusajs/region@2.11.1-snapshot-20251021090705yarn add @medusajs/sales-channel@2.11.1-snapshot-20251021090705yarn add @medusajs/settings@2.11.1-snapshot-20251021090705yarn add @medusajs/stock-location@2.11.1-snapshot-20251021090705yarn add @medusajs/store@2.11.1-snapshot-20251021090705yarn add @medusajs/tax@2.11.1-snapshot-20251021090705yarn add @medusajs/user@2.11.1-snapshot-20251021090705yarn add @medusajs/workflow-engine-inmemory@2.11.1-snapshot-20251021090705yarn add @medusajs/workflow-engine-redis@2.11.1-snapshot-20251021090705yarn add @medusajs/draft-order@2.11.1-snapshot-20251021090705
|
carlos-r-l-rodrigues
approved these changes
Oct 21, 2025
adrien2p
approved these changes
Oct 21, 2025
This was referenced Oct 21, 2025
Merged
This was referenced Oct 23, 2025
Merged
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.
Summary
What — What changes are introduced in this PR?
This PR fixes a bug where async workflow steps with retry intervals would get stuck after the first retry attempt due to Bull queue jobId collisions preventing retry jobs from executing.
Why — Why are these changes relevant or necessary?
Workflows using async steps with retry configurations (e.g.,
retryInterval: 1,maxRetries: 5) would fail once, schedule a retry, but the retry job would never execute, causing workflows to hang indefinitely.How — How have these changes been implemented?
Root Cause: Bull queue was rejecting retry jobs because they had identical jobIds to the async execution jobs that already completed. Both used the format:
retry:workflow:transaction:step_id:attempts.Solution: Modified
getJobId()inworkflow-orchestrator-storage.tsto append a:retrysuffix wheninterval > 0, creating unique jobIds:retry:...:step_id:1retry:...:step_id:1:retryUpdated methods:
getJobId(),scheduleRetry(),removeJob(), andclearRetry()to pass and handle the interval parameter.Testing — How have these changes been tested, or how can the reviewer test the feature?
Added integration test
retry-interval.spec.tsthat verifies:retryInterval: 1andmaxRetries: 3executes 3 timessubscribe()andonFinisheventExamples
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the promptsAdditional Context