Skip to content

Reuse resolved encryption keys and simplify payload key handling - #3113

Draft
NathanColosimo wants to merge 7 commits into
mainfrom
codex/reuse-suspension-key
Draft

Reuse resolved encryption keys and simplify payload key handling#3113
NathanColosimo wants to merge 7 commits into
mainfrom
codex/reuse-suspension-key

Conversation

@NathanColosimo

@NathanColosimo NathanColosimo commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What

  • pass the invocation-scoped PayloadKey into suspension handling, including the terminal pending-queue drain
  • let Run.returnValue resolve its key from the completed or failed run record it already fetched, instead of reading the same run twice
  • simplify serialization/encryption.ts from 322 to 197 lines without changing its wire formats or cryptography
  • replace two Symbol brands with the discriminated { kind: 'seal' } | { kind: 'run' } capability shapes
  • remove the one-use aesKeyOf and openSealedEnvelope helpers plus defensive tests for values outside the typed API
  • cover the reuse paths in the existing core test files
  • merge current main (a09d00135)

The full PR is now +202/-239 against main (net -37).

Why

Two duplicate operations exist on current main:

  1. workflowEntrypoint resolves the full run PayloadKey before replay. When replay suspends, handleSuspension independently calls getEncryptionKeyForRun(run) and imports another AES key even though the caller already has the stronger full capability. The same duplication happens when runWorkflow drains unawaited queue items at workflow completion or failure.
  2. Run.returnValue polls world.runs.get(runId). Once the run is completed or failed, its lazy key resolver calls world.runs.get(runId) again solely to pass that same entity to getEncryptionKeyForRun.

The key is immutable for a run, so the invocation and the in-process Run handle can reuse data already in hand. Nothing is cached globally or serialized.

The serialization layer also represented its two SDK-owned capabilities with unrelated Symbol.for brands, then needed repeated object/null/brand checks to recover their types. A string discriminant crosses realms without special machinery and gives the compiler one exhaustive state model:

  • bare CryptoKey: legacy symmetric read/write capability
  • { kind: 'run', aes, keyPair, aad }: owning run; symmetric read/write plus sealed reads
  • { kind: 'seal', recipientPublicKey, aad }: write-only sealed capability

The legacy bare CryptoKey remains unchanged to avoid turning this cleanup into an API migration.

Current start() behavior

The earlier version of this PR seeded the Run returned by start() with the encryption value used for the initial arguments. That is intentionally removed.

The capability probe now normally returns the target run public key. start() turns that into a write-only sealing capability with sealTo(...); it does not hold the symmetric key or X25519 private scalar needed to read return values or sealed stream data. Caching that value on Run would therefore be incorrect.

For modern cross-deployment starts, the public-key probe already removed the old run-key API request from start(). If the caller later awaits run.returnValue, one read-key lookup is still necessary so the caller can decrypt the result. This PR does not remove that necessary lookup.

Exact savings

Workflow suspension

For a normal Vercel workflow invocation, the run executes on its owning deployment. Reusing the invocation PayloadKey removes a second local per-run HKDF derivation and AES key import during each suspension-handling operation. It does not normally remove a network request because the owning deployment derives its run key locally. A World implementation that resolves keys remotely would also avoid that second remote lookup.

Terminal pending-queue drain

A workflow that completes or fails with unawaited hooks, waits, attributes, or abort work synthesizes a final suspension so those events are persisted. runWorkflow already has the PayloadKey; passing it into that final suspension removes the same redundant derivation/import there. No saving occurs when the pending queue is empty because the drain exits before suspension handling.

Run.returnValue

When a run reaches completed or failed, reuse of the polled WorkflowRun removes one redundant world.runs.get backend read. Key resolution itself still occurs once. For a cross-deployment handle, the necessary Vercel run-key API request still occurs once; for a same-deployment handle, the key is derived locally. In-progress polling is unchanged.

Deliberate limits

  • no process-wide or cross-invocation key cache
  • no key material added to serialized Run handles
  • no reuse for a Run reconstructed by getRun() until that handle resolves its key lazily
  • no change to encr or encp bytes, key derivation, sealed-payload behavior, deployment routing, or cryptographic operations
  • no broad split of every stream reviver into separate read-key and write-key APIs
  • no claim that workflow suspension normally crosses deployments

Verification

  • merged current main (a09d00135)
  • workspace-wide typecheck passed (46 packages)
  • @workflow/core build and typecheck passed
  • @workflow/core tests: 75 files; 1,651 passed; 3 expected failures
  • focused serialization tests: 152 passed
  • focused Biome check for the rewritten encryption module passed with no diagnostics
  • git diff --check passed

@vercel

vercel Bot commented Jul 25, 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 Ready Ready Preview, Comment Jul 29, 2026 5:23pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 29, 2026 5:23pm
example-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-express-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-nestjs-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 29, 2026 5:23pm
workflow-swc-playground Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workflow-tarballs Ready Ready Preview, Comment Jul 29, 2026 5:23pm
workflow-web Ready Ready Preview, Comment Jul 29, 2026 5:23pm

@changeset-bot

changeset-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6574d45

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 Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
workflow Patch
@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

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

❌ Failed E2E Tests

📦 Local Production (2 failed)

nextjs-turbopack-stable (1 failed):

  • webhookWorkflow | wrun_41KYQECEY70GNZKHM0526R16CP

nextjs-webpack-stable (1 failed):

  • webhookWorkflow | wrun_41KYQECEY70GNZKHM0526R16CP

E2E Test Summary

Summary
Passed Failed Skipped Total
✅ ▲ Vercel Production 1455 0 239 1694
✅ 💻 Local Development 1467 0 227 1694
❌ 📦 Local Production 1619 2 227 1848
✅ 🐘 Local Postgres 1621 0 227 1848
✅ 🪟 Windows 154 0 0 154
✅ 📋 Other 1020 0 212 1232
✅ vercel-multi-region 27 0 0 27
Total 7363 2 1132 8497
Details by Category

✅ ▲ Vercel Production

App Passed Failed Skipped
✅ astro 126 0 28
✅ example 126 0 28
✅ express 126 0 28
✅ fastify 126 0 28
✅ hono 126 0 28
✅ nextjs-turbopack 151 0 3
✅ nextjs-webpack 151 0 3
✅ nitro 126 0 28
✅ nuxt 126 0 28
✅ sveltekit 145 0 9
✅ vite 126 0 28

✅ 💻 Local Development

App Passed Failed Skipped
✅ astro-stable 128 0 26
✅ express-stable 128 0 26
✅ fastify-stable 128 0 26
✅ hono-stable 128 0 26
✅ nextjs-turbopack-canary 135 0 19
✅ nextjs-turbopack-stable 154 0 0
✅ nextjs-webpack-canary 135 0 19
✅ nitro-stable 128 0 26
✅ nuxt-stable 128 0 26
✅ sveltekit-stable 147 0 7
✅ vite-stable 128 0 26

❌ 📦 Local Production

App Passed Failed Skipped
✅ astro-stable 128 0 26
✅ express-stable 128 0 26
✅ fastify-stable 128 0 26
✅ hono-stable 128 0 26
✅ nextjs-turbopack-canary 135 0 19
❌ nextjs-turbopack-stable 153 1 0
✅ nextjs-webpack-canary 135 0 19
❌ nextjs-webpack-stable 153 1 0
✅ nitro-stable 128 0 26
✅ nuxt-stable 128 0 26
✅ sveltekit-stable 147 0 7
✅ vite-stable 128 0 26

✅ 🐘 Local Postgres

App Passed Failed Skipped
✅ astro-stable 128 0 26
✅ express-stable 128 0 26
✅ fastify-stable 128 0 26
✅ hono-stable 128 0 26
✅ nextjs-turbopack-canary 135 0 19
✅ nextjs-turbopack-stable 154 0 0
✅ nextjs-webpack-canary 135 0 19
✅ nextjs-webpack-stable 154 0 0
✅ nitro-stable 128 0 26
✅ nuxt-stable 128 0 26
✅ sveltekit-stable 147 0 7
✅ vite-stable 128 0 26

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack 154 0 0

✅ 📋 Other

App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 128 0 26
✅ e2e-local-dev-tanstack-start- 128 0 26
✅ e2e-local-postgres-nest-stable 128 0 26
✅ e2e-local-postgres-tanstack-start- 128 0 26
✅ e2e-local-prod-nest-stable 128 0 26
✅ e2e-local-prod-tanstack-start- 128 0 26
✅ e2e-vercel-prod-nest 126 0 28
✅ e2e-vercel-prod-tanstack-start 126 0 28

✅ vercel-multi-region

App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

📋 View full workflow run

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 6574d45 · Wed, 29 Jul 2026 17:40:47 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 252 (-50%) 💚 1345 🔴 (+28%) 🔻 1426 🔴 (+32%) 🔻 1686 🔴 (+37%) 🔻 30
TTFS stream 1276 (+541%) 🔻 1313 🔴 (+26%) 🔻 1341 🔴 (+28%) 🔻 1392 🔴 (+27%) 🔻 30
TTFS hook + stream 479 (-12%) 1618 🔴 (+22%) 🔻 1656 🔴 (+21%) 🔻 1975 🔴 (+36%) 🔻 30
STSO 1020 steps (1-20) 167 (+2.5%) 332 🔴 (+19%) 🔻 387 🔴 (+29%) 🔻 599 🔴 (+78%) 🔻 19
STSO 1020 steps (101-120) 163 (-11%) 255 🔴 (+4.5%) 337 🔴 (-7.9%) 401 🔴 (-23%) 💚 19
STSO 1020 steps (1001-1020) 474 (-4.2%) 537 🔴 (-8.8%) 560 🔴 (-12%) 602 🔴 (-5.8%) 19
WO 1020 steps 394319 (-2.9%) 394319 (-2.9%) 394319 (-2.9%) 394319 (-2.9%) 1
SL stream latency 76 (-1.3%) 149 🔴 (+23%) 🔻 161 🔴 (+3.9%) 338 🔴 (+90%) 🔻 30
SO stream overhead (text) 101 (-3.8%) 155 (-23%) 💚 182 (-31%) 💚 311 (-55%) 💚 30
SO stream overhead (structured) 87 (-15%) 158 (+2.6%) 293 (+56%) 🔻 2606 🔴 (+887%) 🔻 30
📜 Previous results (6)

bd1330f

Tue, 28 Jul 2026 19:49:15 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1238 (+62%) 🔻 1289 🔴 (+22%) 🔻 1308 🔴 (+16%) 🔻 1326 🔴 (-4.0%) 30
TTFS stream 1255 (+28%) 🔻 1291 🔴 (+25%) 🔻 1323 🔴 (+26%) 🔻 1340 🔴 (+24%) 🔻 30
TTFS hook + stream 646 (-47%) 💚 1516 🔴 (+8.6%) 1543 🔴 (+3.3%) 1760 🔴 (-9.3%) 30
STSO 1020 steps (1-20) 168 (+29%) 🔻 265 🔴 (+2.7%) 326 🔴 (+8.7%) 346 🔴 (-18%) 💚 19
STSO 1020 steps (101-120) 170 (-14%) 241 🔴 (-19%) 💚 271 🔴 (-18%) 💚 409 🔴 (+12%) 19
STSO 1020 steps (1001-1020) 468 (+2.2%) 562 🔴 (+6.0%) 624 🔴 (+2.1%) 701 🔴 (+1.2%) 19
WO 1020 steps 382766 (-2.7%) 382766 (-2.7%) 382766 (-2.7%) 382766 (-2.7%) 1
SL stream latency 85 (+4.9%) 140 🔴 (-35%) 💚 143 🔴 (-68%) 💚 267 🔴 (-66%) 💚 30
SO stream overhead (text) 102 (+3.0%) 160 (-5.3%) 191 (-32%) 💚 337 (-65%) 💚 30
SO stream overhead (structured) 100 (-8.3%) 145 (-23%) 💚 151 (-42%) 💚 205 (-74%) 💚 30

3765aef

Mon, 27 Jul 2026 21:19:47 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1286 (+97%) 🔻 1422 🔴 (+20%) 🔻 1517 🔴 (+2.4%) 1883 🔴 (+21%) 🔻 30
TTFS stream 464 (+116%) 🔻 1471 🔴 (+29%) 🔻 1505 🔴 (+26%) 🔻 1686 🔴 (+21%) 🔻 30
TTFS hook + stream 1578 (+20%) 🔻 1845 🔴 (+27%) 🔻 1959 🔴 (+33%) 🔻 1992 🔴 (+11%) 30
STSO 1020 steps (1-20) 186 (-11%) 311 🔴 (+7.2%) 460 🔴 (+8.2%) 501 🔴 (-9.6%) 19
STSO 1020 steps (101-120) 203 (-2.9%) 277 🔴 (-6.1%) 342 🔴 (+1.2%) 624 🔴 (+0.6%) 19
STSO 1020 steps (1001-1020) 460 (-3.6%) 594 🔴 (+1.4%) 640 🔴 (-7.8%) 642 🔴 (-26%) 💚 19
WO 1020 steps 414763 (-6.2%) 414763 (-6.2%) 414763 (-6.2%) 414763 (-6.2%) 1
SL stream latency 111 (-0.9%) 174 🔴 (+6.1%) 297 🔴 (+67%) 🔻 389 🔴 (+87%) 🔻 30
SO stream overhead (text) 135 (-15%) 💚 193 (-30%) 💚 215 (-34%) 💚 461 (-47%) 💚 30
SO stream overhead (structured) 131 (-10%) 182 (-55%) 💚 197 (-69%) 💚 322 (-89%) 💚 30

fc47b54

Mon, 27 Jul 2026 20:50:08 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1272 (+79%) 🔻 1356 🔴 (+31%) 🔻 1385 🔴 (+27%) 🔻 1712 🔴 (+21%) 🔻 30
TTFS stream 1034 (+21%) 🔻 1436 🔴 (+50%) 🔻 1530 🔴 (+57%) 🔻 1645 🔴 (+65%) 🔻 30
TTFS hook + stream 1480 (+35%) 🔻 1694 🔴 (+38%) 🔻 1770 🔴 (+40%) 🔻 1938 🔴 (+32%) 🔻 30
STSO 1020 steps (1-20) 176 (-2.8%) 275 🔴 (±0%) 372 🔴 (+22%) 🔻 382 🔴 (-3.0%) 19
STSO 1020 steps (101-120) 196 (+5.4%) 312 🔴 (+17%) 🔻 375 🔴 (+25%) 🔻 405 🔴 (-83%) 💚 19
STSO 1020 steps (1001-1020) 475 (+6.3%) 638 🔴 (+24%) 🔻 1130 🔴 (+110%) 🔻 1255 🔴 (+91%) 🔻 19
WO 1020 steps 404950 (+5.3%) 404950 (+5.3%) 404950 (+5.3%) 404950 (+5.3%) 1
SL stream latency 111 (+44%) 🔻 185 🔴 (+49%) 🔻 229 🔴 (+59%) 🔻 446 🔴 (+75%) 🔻 30
SO stream overhead (text) 117 (+21%) 🔻 243 (+57%) 🔻 312 (+78%) 🔻 436 (+120%) 🔻 30
SO stream overhead (structured) 115 (+14%) 184 (+9.5%) 221 (+25%) 🔻 285 (-81%) 💚 30

8213433

Mon, 27 Jul 2026 20:06:10 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1028 (+45%) 🔻 1340 🔴 (+30%) 🔻 1359 🔴 (+25%) 🔻 1430 🔴 (+0.8%) 30
STSO 1020 steps (1-20) 165 (-8.8%) 301 🔴 (+9.1%) 326 🔴 (+7.2%) 739 🔴 (+88%) 🔻 19
STSO 1020 steps (101-120) 165 (-11%) 252 🔴 (-5.6%) 276 🔴 (-8.3%) 291 🔴 (-88%) 💚 19
STSO 1020 steps (1001-1020) 459 (+2.7%) 556 🔴 (+7.8%) 653 🔴 (+21%) 🔻 3334 🔴 (+407%) 🔻 19
WO 1020 steps 370875 (-3.6%) 370875 (-3.6%) 370875 (-3.6%) 370875 (-3.6%) 1
SL stream latency 98 (+27%) 🔻 143 🔴 (+15%) 🔻 159 🔴 (+10%) 184 🔴 (-28%) 💚 30
SO stream overhead (text) 94 (-3.1%) 138 (-11%) 161 (-8.0%) 302 (+53%) 🔻 30
SO stream overhead (structured) 96 (-5.0%) 138 (-18%) 💚 166 (-6.2%) 327 (-79%) 💚 30

706703b

Mon, 27 Jul 2026 17:32:26 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 220 (-77%) 💚 1313 🔴 (+13%) 1366 🔴 (+14%) 1428 🔴 (-4.6%) 30
TTFS stream 219 (-24%) 💚 1337 🔴 (+13%) 1362 🔴 (+11%) 1452 🔴 (+5.8%) 30
TTFS hook + stream 393 (-70%) 💚 1634 🔴 (+4.5%) 1658 🔴 (+0.6%) 1831 🔴 (+4.4%) 30
STSO 1020 steps (1-20) 182 (-3.2%) 280 🔴 (-8.8%) 319 🔴 (-16%) 💚 346 🔴 (-9.4%) 19
STSO 1020 steps (101-120) 188 (-6.5%) 339 🔴 (+16%) 🔻 355 🔴 (-2.7%) 387 🔴 (+1.0%) 19
STSO 1020 steps (1001-1020) 488 (-5.8%) 603 🔴 (-4.7%) 677 🔴 (+2.0%) 777 🔴 (-5.7%) 19
WO 1020 steps 421297 (-5.2%) 421297 (-5.2%) 421297 (-5.2%) 421297 (-5.2%) 1
SL stream latency 111 (+1.8%) 180 🔴 (-63%) 💚 212 🔴 (-70%) 💚 256 🔴 (-77%) 💚 30
SO stream overhead (text) 120 (-10%) 257 🔴 (+6.2%) 283 (-8.7%) 622 (+12%) 30
SO stream overhead (structured) 124 (-6.8%) 197 (-20%) 💚 212 (-28%) 💚 398 (-11%) 30

f96e55f

Sat, 25 Jul 2026 01:02:00 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 229 (-68%) 💚 1367 🔴 (+31%) 🔻 1387 🔴 (+26%) 🔻 1652 🔴 (+43%) 🔻 30
TTFS stream 227 (-77%) 💚 1358 🔴 (+26%) 🔻 1378 🔴 (+19%) 🔻 1408 🔴 (+9.9%) 30
TTFS hook + stream 474 (-63%) 💚 1596 🔴 (+14%) 1665 🔴 (+15%) 1730 🔴 (+3.3%) 30
STSO 1020 steps (1-20) 163 (-18%) 💚 318 🔴 (+15%) 🔻 497 🔴 (+44%) 🔻 961 🔴 (+148%) 🔻 19
STSO 1020 steps (101-120) 181 (-16%) 💚 257 🔴 (-8.2%) 339 🔴 (+14%) 880 🔴 (+133%) 🔻 19
STSO 1020 steps (1001-1020) 473 (-3.3%) 581 🔴 (+3.8%) 753 🔴 (+26%) 🔻 2888 🔴 (+377%) 🔻 19
WO 1020 steps 404905 (-1.8%) 404905 (-1.8%) 404905 (-1.8%) 404905 (-1.8%) 1
SL stream latency 97 (-2.0%) 166 🔴 (+27%) 🔻 192 🔴 (+30%) 🔻 323 🔴 (+55%) 🔻 30
SO stream overhead (text) 103 (-21%) 💚 216 (±0%) 267 (+8.5%) 454 (+68%) 🔻 30
SO stream overhead (structured) 123 (-12%) 226 (+2.3%) 286 (+15%) 474 (-32%) 💚 30
ℹ️ Metric definitions & methodology

Best/P75/P90/P99 deltas compare against the most recent benchmark run on main at the time of this run. 🔻 flags a delta worse than +15%, 💚 one better than −15%.

Metrics — TTFS: time to first step body (in-deployment start() → first step body, deployment clocks) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · SL: stream latency (in-deployment write → read propagation, readAt - writtenAt) · SO: stream overhead (end-to-end write+consume time beyond the modelled generation window)

Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · stream latency: parallel reader/writer steps on a dedicated stream; SL is the in-deployment write->read propagation (readAt - writtenAt) · stream overhead (text): writer streams 300 variable-length text token deltas paced at 100/s for 3s (a haiku-size LLM's token throughput) while a parallel reader drains the whole stream; SO is the end-to-end write+consume time beyond the 3s generation window (overhead/backpressure) · stream overhead (structured): same workload as stream overhead (text), but each delta is an AI-SDK-style structured object ({ type: 'text-delta', id, text }) instead of a raw string, so the SO gap vs the text scenario is the added serialization cost

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · SO 250/500/1000 · STSO (1-20) 20/30/60 · STSO (101-120) 30/45/90 · STSO (1001-1020) 40/60/120

All metrics are measured from deployment-side timestamps only. Runs are triggered by an in-deployment route that stamps the anchor (clientStart) right before start(), so the CI runner’s request and its path through api.vercel.com sit outside every measured window. TTFS = in-deployment start() → first step body (turbo uses the in-process fast path, non-turbo the dispatch path), and includes the VQS dispatch hop plus any /flow cold start. STSO/WO are measured between step bodies on the deployment. SL is measured inside the workflow (parallel reader/writer steps), so it no longer includes the api.vercel.com read path.

Cold starts are kept in the numbers on purpose — they are part of real bursty-workload latency. The workbench deployment cold-starts the /flow invocation for a large fraction of runs, inflating P75+; the Best column shows the fastest (warm-start) sample for comparison.

@NathanColosimo NathanColosimo changed the title Reuse resolved encryption keys during suspension handling Reuse resolved encryption keys across workflow operations Jul 27, 2026
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.

1 participant