[Miniflare][Workflows] Persisted sleepUntil does not complete after setOptions() reload
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start with the linked reproduction script and the referenced timePriorityQueue.ts, then trace how persisted Workflow sleeps are restored and how handleNextAlarm() schedules their wake after setOptions(). Check existing Workflow reload and alarm tests to establish whether this scenario is supported. Done means confirming the expected behavior and reproducing a passing test for completion after reload, or documenting the supported restart API if this path is unsupported.
Written by the indexing model from the issue text.
Description
What versions & operating system are you using?
Miniflare 5.20261019.2-beta, workerd 1.20261019.1, Node 24.21.0, Ubuntu 24.04 on WSL2. Worker compatibility date 2026-10-24.
Please provide a link to a minimal reproduction
https://gist.github.com/elijahnsangu/65d857383eff13126ba5cf6205a057d8
Describe the bug
Place miniflare-workflow-reload-repro.mjs in an empty directory and run:
npm install --no-save [email protected]
node miniflare-workflow-reload-repro.mjs
The script starts a Workflow with an absolute deadline of Date.now() + 3000, waits for its checkpoints, pauses and resumes it, then calls setOptions() with the same configuration and persistence directory. It reacquires the binding and looks up the same instance ID.
Expected
If cold reload of active Workflows is supported, the original instance should complete at or after its saved deadline, with its checkpoints intact, within the probe’s five-second boundary.
Observed
The reload completed at 273 ms and fresh bindings were available at 279 ms. The Worker generation changed, and the original instance, deadline, and checkpoints were restored. Its status was running after reload, but the probe never observed completion and exited 1 at Unchanged5000ms probe boundary.
The linked script is a syntax-checked, path-independent adaptation of the probe that produced these observations.
Is this reload scenario supported? If so, could the missing wake be related to handleNextAlarm()? If there is a supported way to exercise a real persisted sleep across a local runtime restart, which API should the test use? Upstream timer source
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 1.7k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 282
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/workers-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudflare/workers-sdk#17215 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
cloudflare/workers-sdk#17189 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/workers-sdk#17187 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
cloudflare/workers-sdk#17175 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/workers-sdk#17174 ·
Maintainers usually reply within 1 day
All issues in cloudflare/workers-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
earendil-works/pi#12615 ·
Maintainers usually reply within 1 day
-
My Caps shows "Shared" on private Caps that were never sharedPossibly taken @AksharP5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CapSoftware/Cap#4569 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith-nodejs-client#332 ·
Maintainers usually reply within 2 days