Skip to content

Backport #2525: perf(core): decouple workflow VM seed/clock from startedAt#2530

Open
github-actions[bot] wants to merge 1 commit into
stablefrom
backport/pr-2525-to-stable
Open

Backport #2525: perf(core): decouple workflow VM seed/clock from startedAt#2530
github-actions[bot] wants to merge 1 commit into
stablefrom
backport/pr-2525-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated backport of #2525 to stable (backport job run).

AI recommendation: This is a self-contained change to @workflow/core's VM seed/clock derivation, and the targeted code (packages/core/src/workflow.ts, including the exact ${runId}:${workflowName}:${+startedAt} seed formula it replaces) already exists on stable, so it does not build on any main-only API. It carries an in-flight-replay migration caveat that the included changeset documents, but the change applies equally to both branches and a human can review the resulting PR.

Merge conflicts were resolved by AI (opencode with anthropic/claude-opus-4.8). Please review the conflict resolution carefully before merging.

Derive the deterministic RNG seed from `runId:workflowName:deploymentId`
and the VM's initial fixed clock from the ULID timestamp embedded in
`runId` (via the new `runIdCreatedAt` helper). All of these inputs are
available the instant a queue message arrives, so the VM seed and clock
no longer depend on `startedAt` (set only after the `run_started`
round-trip). This is the prerequisite for starting VM initialization
earlier on the critical path.

This changes the seed-derived value sequence for a given run, so the
affected deterministic test fixtures are regenerated accordingly.

Signed-off-by: Nathan Rajlich <[email protected]>
@changeset-bot

changeset-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 18b1479

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/core Minor
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
workflow Minor
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch

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

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Building Building Preview, Comment Jun 18, 2026 10:34pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jun 18, 2026 10:34pm
example-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-astro-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-express-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-fastify-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-hono-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-nitro-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workbench-vite-workflow Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jun 18, 2026 10:34pm
workflow-swc-playground Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workflow-tarballs Ready Ready Preview, Comment Jun 18, 2026 10:34pm
workflow-web Ready Ready Preview, Comment Jun 18, 2026 10:34pm

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1043 1 78 1122
✅ 💻 Local Development 1138 0 86 1224
✅ 📦 Local Production 1138 0 86 1224
✅ 🐘 Local Postgres 1126 0 98 1224
✅ 🪟 Windows 102 0 0 102
❌ 🌍 Community Worlds 76 99 6 181
✅ 📋 Other 574 0 38 612
Total 5197 100 392 5689

❌ Failed Tests

▲ Vercel Production (1 failed)

nitro (1 failed):

  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KVH0JRRZY7DXHN019D1KMZ1X | 🔍 observability
🌍 Community Worlds (99 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KVH08K3GCGR0J7V22ES0QAKV
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KVH08SVWMN8WRGDZS8YEG9BJ
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KVH0958YDZFSRT9T7EHDWTJB
  • sleepingWorkflow | wrun_01KVH0A6NK601P7NK0KQPSG17J
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KVH0HQ7CSNZP5QM036740974
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KVH0J2Y9TPEDV0WMK9QN44M6
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KVH0JA3VHK9136K4M2TSXHB7
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KVH0JRRZY7DXHN019D1KMZ1X
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KVH0KJXD5SMG8JH6B3FZAWMV
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KVH0KPPRM19QXCMY1S73MQRT
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KVH0KXCNNKE6FPNETNT0G9P3
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KVH0M1YCBERFQWBDNCNKEGEE
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KVH0MAJVFS53A2BTH91EQTCS
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KVH0T0N289B3YQSP8XFG72CN

turso (80 failed):

  • addTenWorkflow | wrun_01KVH07M5KZ5DG2M75FPWNQXG9
  • addTenWorkflow | wrun_01KVH07M5KZ5DG2M75FPWNQXG9
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KVH07TZTMSH5YS3Y4P7WZPPH
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KVH07W755M0ZE1WNK0KYG63Z
  • promiseRaceWorkflow | wrun_01KVH080RW30ATB8QF10YV6363
  • promiseAnyWorkflow | wrun_01KVH082ZT4BGFJC219MS0KZCS
  • importedStepOnlyWorkflow | wrun_01KVH0871G8X4Z547NZD5QTH09
  • readableStreamWorkflow | wrun_01KVH085KFPZJJGBBDHWE1FT15
  • hookWorkflow | wrun_01KVH08K3GCGR0J7V22ES0QAKV
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KVH08SVWMN8WRGDZS8YEG9BJ
  • webhookWorkflow | wrun_01KVH08YKM0DDEH926M4NANTTG
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KVH0958YDZFSRT9T7EHDWTJB
  • sleepingWorkflow | wrun_01KVH0A6NK601P7NK0KQPSG17J
  • parallelSleepWorkflow | wrun_01KVH0AQ38ZVBM6NGB0TPB2DYD
  • nullByteWorkflow | wrun_01KVH0ATESW5XJAWE02HAHGEQ9
  • workflowAndStepMetadataWorkflow | wrun_01KVH0AWTXVSKSKS6KCGA6KJQV
  • outputStreamWorkflow no startIndex (reads all chunks)
  • outputStreamWorkflow positive startIndex (skips first chunk)
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01KVH0D97SFM8RDG6Y2HFHQF9J
  • writableForwardedFromWorkflowWorkflow | wrun_01KVH0DQ5DDA4AVYYQMZZ1XTAA
  • writableForwardedFromStepWorkflow | wrun_01KVH0DVE17QHAHFY1GPF9J00J
  • fetchWorkflow | wrun_01KVH0DZ2T4NAD61X8AC6GBFD7
  • promiseRaceStressTestWorkflow | wrun_01KVH0E2G1Q4WHHYA8QCVFA08K
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • error handling not registered WorkflowNotRegisteredError fails the run when workflow does not exist
  • error handling not registered StepNotRegisteredError fails the step but workflow can catch it
  • error handling not registered StepNotRegisteredError fails the run when not caught in workflow
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KVH0HAFRK88X9SDSRTNBDPWY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KVH0HQ7CSNZP5QM036740974
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KVH0J2Y9TPEDV0WMK9QN44M6
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KVH0J5B30KDNC5H2W3TTKV41
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KVH0J7QWKJAZ03ZCEHCW0FF0
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KVH0JA3VHK9136K4M2TSXHB7
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KVH0JRRZY7DXHN019D1KMZ1X
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KVH0KJXD5SMG8JH6B3FZAWMV
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KVH0KPPRM19QXCMY1S73MQRT
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KVH0KXCNNKE6FPNETNT0G9P3
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KVH0M1YCBERFQWBDNCNKEGEE
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KVH0MAJVFS53A2BTH91EQTCS
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KVH0MJSTW330051VVTJH3Y0X
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KVH0N20D8KH8NDBN4QK13DET
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KVH0NASY1Y0FQKDPWAN5APWC
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KVH0NGMJKRKR0053MBQNY9Y4
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KVH0NK0EWWSB1WST1P87696F
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KVH0P2JD53GNKB01N5SCAVRE
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KVH0P84C0NFV131SYBGJ8A8V
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KVH0PEVG05XJF5J6A5XNR8BN
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KVH0PNMZ41FE724X88ST4XQR
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KVH0PVBXPSK0CM8B2DZR4V86
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KVH0Q37HN3V7T7HAENZ5JQW7
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KVH0Q9YMH8VQQ0GC1S9CZGXA
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KVH0QPABABSSHF7ZKBACDZHZ
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KVH0QY61F49QC3AC7HMFSXB1
  • cancelRun - cancelling a running workflow | wrun_01KVH0R4NG4FWJQJEPCJGBY5FV
  • cancelRun via CLI - cancelling a running workflow | wrun_01KVH0RDSA64773SMPYSNRFHDM
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KVH0RSES5WMGD96N794YM39R
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KVH0S9SAZ8N590WJY1MQHZRP
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KVH0SMB6KT7WG9RSDGNFAAT6
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KVH0SW5494CE1NP4WQBBC411
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KVH0SYHKG41C1HG7N11NJDR6
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KVH0T0N289B3YQSP8XFG72CN

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 94 0 8
✅ example 94 0 8
✅ express 94 0 8
✅ fastify 94 0 8
✅ hono 94 0 8
✅ nextjs-turbopack 99 0 3
✅ nextjs-webpack 99 0 3
❌ nitro 93 1 8
✅ nuxt 94 0 8
✅ sveltekit 94 0 8
✅ vite 94 0 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 96 0 6
✅ express-stable 96 0 6
✅ fastify-stable 96 0 6
✅ hono-stable 96 0 6
✅ nextjs-turbopack-canary 83 0 19
✅ nextjs-turbopack-stable 102 0 0
✅ nextjs-webpack-canary 83 0 19
✅ nextjs-webpack-stable 102 0 0
✅ nitro-stable 96 0 6
✅ nuxt-stable 96 0 6
✅ sveltekit-stable 96 0 6
✅ vite-stable 96 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 96 0 6
✅ express-stable 96 0 6
✅ fastify-stable 96 0 6
✅ hono-stable 96 0 6
✅ nextjs-turbopack-canary 83 0 19
✅ nextjs-turbopack-stable 102 0 0
✅ nextjs-webpack-canary 83 0 19
✅ nextjs-webpack-stable 102 0 0
✅ nitro-stable 96 0 6
✅ nuxt-stable 96 0 6
✅ sveltekit-stable 96 0 6
✅ vite-stable 96 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 95 0 7
✅ express-stable 95 0 7
✅ fastify-stable 95 0 7
✅ hono-stable 95 0 7
✅ nextjs-turbopack-canary 82 0 20
✅ nextjs-turbopack-stable 101 0 1
✅ nextjs-webpack-canary 82 0 20
✅ nextjs-webpack-stable 101 0 1
✅ nitro-stable 95 0 7
✅ nuxt-stable 95 0 7
✅ sveltekit-stable 95 0 7
✅ vite-stable 95 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 102 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
✅ redis-dev 3 0 2
❌ redis 64 19 0
✅ turso-dev 3 0 2
❌ turso 3 80 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 96 0 6
✅ e2e-local-dev-tanstack-start-stable 96 0 6
✅ e2e-local-postgres-nest-stable 95 0 7
✅ e2e-local-postgres-tanstack-start-stable 95 0 7
✅ e2e-local-prod-nest-stable 96 0 6
✅ e2e-local-prod-tanstack-start-stable 96 0 6

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

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.

0 participants