docs(workflows): document step.sleep numeric duration as milliseconds - #32624
Open
HaoChiBao wants to merge 2 commits into
Open
docs(workflows): document step.sleep numeric duration as milliseconds#32624HaoChiBao wants to merge 2 commits into
HaoChiBao wants to merge 2 commits into
Conversation
Fixes cloudflare#32100. Align Workers API and Python API reference with sleeping-and-retrying: a bare number is milliseconds, not seconds.
HaoChiBao
requested review from
a team,
celso,
deloreyj,
elithrar,
irvinebroque,
jonesphillip,
mia303,
rita3ko and
vy-ton
as code owners
August 8, 2026 09:40
Contributor
Review✅ No issues found in commit Code ReviewThis code review is in beta and may not always be helpful — use your judgment. No code review issues found. ConventionsNo convention issues found. Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
Use "sleep for" (relative) and match the sleeping-and-retrying phrasing: number in milliseconds vs WorkflowDuration string.
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
step.sleepnumericdurationunits from "seconds" to "milliseconds" in the Workers API and Python API references.Fixes #32100.
Why
/workflows/build/sleeping-and-retrying/already documents a barenumberas milliseconds. The API reference pages said seconds. Callers who pass30expecting a 30s pause get a 30ms sleep and hot-loop. Duration strings ("30 seconds") are unchanged.Verification
sleeping-and-retrying.mdx("number(milliseconds)").cloudflare/workers-sdkpackages/workflows-shared/tests/binding.test.tsusesawait step.sleep("sleep", 250)inside a flow that completes well under a multi-second test timeout — that cannot be 250 seconds.step.sleep("checkpoint", 1)as a near-instant checkpoint inengine.test.ts.Test plan
step.sleepduration on these pages