workflow: retry a step at the time it asks for - #302
Open
fantix wants to merge 1 commit into
Open
Conversation
fantix
added a commit
that referenced
this pull request
Aug 15, 2026
Integration-branch only. #300 gave `World.events_create` its `resume` parameter and updated every test double in the tree; #302's double was written against `main`, where neither the parameter nor `HookResume` exists yet. Stacking the two is what makes them disagree, so the fix belongs here rather than in either PR, and it disappears once both land.
fantix
marked this pull request as draft
August 15, 2026 17:47
fantix
force-pushed
the
fantix/retryable-error
branch
from
August 20, 2026 03:17
c109a24 to
a1e6d9a
Compare
fantix
marked this pull request as ready for review
August 20, 2026 03:34
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 new public API - a new error type
vercel.workflow.RetryableError.RetryableError("rate limited", retry_after="10s")sets how long to wait before a step's next attempt, mirroringRetryableErrorin TS@workflow/errors.retry_afteraccepts whatsleep()accepts and defaults to one second. It changes when the next attempt runs, not how many attempts there are.The deadline is recorded twice in
_execute_step()inruntime.py. TheQueueContinuation.delay_secondsdelays this delivery; theStepRetryingEventData.retryAfterpersisted on the step is used by the world (like workflow server) to prevent staring the step too early (returningTooEarlyErrorif so).