Add Run.wakeUp() method to interrupt pending sleeps#1232
Conversation
Create new 'testing/' section and update Foundations index page. Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1772375177894629?thread_ts=1772375177.894629&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1772375177894629?thread_ts=1772375177.894629&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1772375177894629?thread_ts=1772375177.894629&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Update documentation to emphasize unit testing for steps only. Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1772375177894629?thread_ts=1772375177.894629&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Move testing to top-level, fix content and update meta files. Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1772375177894629?thread_ts=1772375177.894629&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Add 'globalSetup' script and vitest config, and update docs for test debugging. Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1772375177894629?thread_ts=1772375177.894629&cid=C09125LC4AX Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
… sleeps Exposes the existing `wakeUpRun` logic as an instance method on the `Run` class, allowing users to skip sleep() calls in tests or custom UIs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 02a1c30 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (46 failed)turso (46 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
There was a problem hiding this comment.
Pull request overview
Adds a public Run.wakeUp() API to programmatically interrupt pending sleep() waits (primarily for testing and tooling), and updates exports + docs so the new capability is available from workflow/api.
Changes:
- Add
Run.wakeUp(options?)on the core runtimeRunclass, delegating to the existingwakeUpRunhelper. - Export
StopSleepOptions/StopSleepResultfromworkflow/apiandworkflow/api-workflow. - Add tests and documentation examples demonstrating skipping sleeps via
wakeUp().
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/workflow/src/api.ts | Re-export StopSleepOptions/StopSleepResult for runtime consumers. |
| packages/workflow/src/api-workflow.ts | Re-export types in workflow-only stub entrypoint. |
| packages/core/src/runtime/run.ts | Introduces Run.wakeUp() instance method delegating to wakeUpRun. |
| packages/core/src/runtime/runs.test.ts | Adds unit tests for Run.wakeUp() and refactors test helper placement. |
| docs/content/docs/testing/index.mdx | Updates integration testing example to demonstrate skipping a long sleep() via wakeUp(). |
| docs/content/docs/api-reference/workflow-api/get-run.mdx | Documents wakeUp() usage and surfaces StopSleep* types in the API reference. |
| .github/workflows/claude.yml | Removes the Claude Code GitHub Action workflow. |
| .changeset/add-run-wake-up.md | Adds changeset entry for patch releases of @workflow/core and workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,50 +0,0 @@ | |||
| name: Claude Code | |||
There was a problem hiding this comment.
this diff is showing up because of git rebase issues. main already removed this. it won't be included in the rebase/squash merge
There was a problem hiding this comment.
Restored the file to match the base branch — the deletion no longer shows in this PR's diff.
Use the // @setup comment pattern to provide type context without rendering the setup line, keeping the snippet lean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
Summary
Run.wakeUp(options?)instance method that delegates to the existingwakeUpRunhelper, letting users programmatically interrupt pendingsleep()callsStopSleepOptionsandStopSleepResulttypes fromworkflow/apiwakeUp()to skip sleeps in testswakeUp()docs and examples to thegetRun()API reference pageTest plan
Run.wakeUp()(delegates correctly, passes correlationIds, handles no pending waits)🤖 Generated with Claude Code