Skip to content

docs(workflows): document step.sleep numeric duration as milliseconds - #32624

Open
HaoChiBao wants to merge 2 commits into
cloudflare:productionfrom
HaoChiBao:docs/workflows-sleep-duration-ms
Open

docs(workflows): document step.sleep numeric duration as milliseconds#32624
HaoChiBao wants to merge 2 commits into
cloudflare:productionfrom
HaoChiBao:docs/workflows-sleep-duration-ms

Conversation

@HaoChiBao

@HaoChiBao HaoChiBao commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • Correct step.sleep numeric duration units from "seconds" to "milliseconds" in the Workers API and Python API references.

Fixes #32100.

Why

/workflows/build/sleeping-and-retrying/ already documents a bare number as milliseconds. The API reference pages said seconds. Callers who pass 30 expecting a 30s pause get a 30ms sleep and hot-loop. Duration strings ("30 seconds") are unchanged.

Verification

  • Canonical docs already state ms: sleeping-and-retrying.mdx ("number (milliseconds)").
  • Upstream tests treat bare numbers as ms: cloudflare/workers-sdk packages/workflows-shared/tests/binding.test.ts uses await step.sleep("sleep", 250) inside a flow that completes well under a multi-second test timeout — that cannot be 250 seconds.
  • Same suite uses step.sleep("checkpoint", 1) as a near-instant checkpoint in engine.test.ts.

Test plan

  • Workers API + Python API bullets agree with sleeping-and-retrying
  • No remaining "in either seconds" wording for step.sleep duration on these pages
  • Preview pages render the updated bullets

Fixes cloudflare#32100. Align Workers API and Python API reference with
sleeping-and-retrying: a bare number is milliseconds, not seconds.
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review

✅ No issues found in commit 0c93575.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

Use "sleep for" (relative) and match the sleeping-and-retrying
phrasing: number in milliseconds vs WorkflowDuration string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workflows Workflows: https://developers.cloudflare.com/workflows/ size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

step.sleep: docs contradict each other on whether duration means seconds or milliseconds

9 participants