[Workflows] Implement Workflows instance methods#12814
Conversation
🦋 Changeset detectedLatest commit: ec31b51 The changes in this PR will be included in the next version bump. 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 |
9b5485f to
97ec0f8
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
a959c17 to
32ee755
Compare
|
✅ All changesets look good |
32ee755 to
c16a59a
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers |
c16a59a to
fff99db
Compare
fff99db to
56e0928
Compare
emily-shen
left a comment
There was a problem hiding this comment.
lgtm from the wrangler/miniflare side, can't say much about the actual workflows stuff 😅
while reviewing I noticed the readme for workflows-shared says this code is actually used by workflows infrastructure in prod, i assume that isn't actually true?
packages/miniflare/src/workers/workflows/wrapped-binding.worker.ts
Outdated
Show resolved
Hide resolved
b04fb74 to
01ff3de
Compare
01ff3de to
12f3560
Compare
Yes that readme was wrong. Thanks for warning - I updated it |
b680714 to
a2b9408
Compare
a2b9408 to
23165c3
Compare
74a6fec to
a8b5244
Compare
a8b5244 to
ec31b51
Compare
This reverts commit 8d4ef78.
Fixes WOR-1182.
This PR implements the 4 missing Workflow instance lifecycle methods for local dev:
pause(),resume(),restart(), andterminate().pause()setsWaitingForPausestatus, then it checks between steps, stores the pause timestamp, transitions toPaused, and aborts the DO. If there are any pending step.do's these will finish before going toPaused.init().INSTANCE_METADATA, cleans up SQL/KV (preserving modifier keys and mocked event data), writes fresh logs, and firesinit().Terminatedand aborts.Also:
DATETIME('now','subsec')for timestamp precision).WorkflowHandle.status()auto-refreshes stale DO stubs after abort.A picture of a cute animal (not mandatory, but encouraged)
