feat(openworkflow): change sleeping status to 'running'#347
Merged
Conversation
commit: |
There was a problem hiding this comment.
Pull request overview
This PR updates OpenWorkflow’s durable wait behavior so that workflows that are “sleeping” (e.g., step.sleep or invoke waits) remain in running status while being parked by clearing workerId and setting availableAt, with legacy sleeping retained for backward compatibility.
Changes:
- Update backend implementations to “park” workflows by keeping
status = "running"and clearingworkerIdduring waits (while still supporting legacy"sleeping"rows). - Update worker/execution and backend test suites to assert the new parked semantics and add legacy-compatibility tests for Postgres/SQLite.
- Refresh public docs/UI status handling to describe/handle deprecated statuses (
sleeping,succeeded) and the new meaning ofrunning.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/openworkflow/worker/worker.test.ts | Updates worker behavior tests to expect parked runs to remain running with workerId = null. |
| packages/openworkflow/worker/execution.ts | Updates execution documentation/comments for paused/parked workflow handling. |
| packages/openworkflow/worker/execution.test.ts | Updates execution tests and adds a helper to wait for the “parked” invariant (running + workerId=null + availableAt!=null). |
| packages/openworkflow/testing/backend.testsuite.ts | Adjusts backend conformance tests for new parked semantics and count expectations. |
| packages/openworkflow/sqlite/backend.ts | Changes sleepWorkflowRun() to park runs as running and expands legacy handling. |
| packages/openworkflow/sqlite/backend.test.ts | Adds a legacy compatibility test to ensure old sleeping rows can still be claimed. |
| packages/openworkflow/postgres/backend.ts | Changes sleepWorkflowRun() to park runs as running and updates parent wake logic for parked runs. |
| packages/openworkflow/postgres/backend.test.ts | Adds a legacy compatibility test to ensure old sleeping rows can still be claimed. |
| packages/openworkflow/core/workflow-run.ts | Marks sleeping as deprecated in the status type definition. |
| packages/openworkflow/core/backend.ts | Marks sleeping counts as deprecated but retained for backward compatibility. |
| packages/openworkflow/client/client.ts | Updates cancellation docs to mention legacy sleeping status. |
| packages/dashboard/src/lib/status.ts | Annotates legacy statuses and includes deprecated statuses in terminal/cancelable sets for UI logic. |
| ARCHITECTURE.md | Updates state machine documentation to define “parked” runs as running with workerId=null until availableAt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
No description provided.