Skip to content

feat(openworkflow): change sleeping status to 'running'#347

Merged
jamescmartinez merged 1 commit into
mainfrom
running
Feb 26, 2026
Merged

feat(openworkflow): change sleeping status to 'running'#347
jamescmartinez merged 1 commit into
mainfrom
running

Conversation

@jamescmartinez
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 26, 2026 02:24
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/cli@347
npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/dashboard@347
npm i https://pkg.pr.new/openworkflowdev/openworkflow@347

commit: 1f971cc

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 clearing workerId during 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 of running.

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.

@jamescmartinez jamescmartinez merged commit 7d27712 into main Feb 26, 2026
14 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants