Skip to content

fix(docs): correct API usage in cookbook examples#1709

Merged
TooTallNate merged 3 commits into
mainfrom
fix/docs-cookbook-api-correctness
Apr 14, 2026
Merged

fix(docs): correct API usage in cookbook examples#1709
TooTallNate merged 3 commits into
mainfrom
fix/docs-cookbook-api-correctness

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Apr 13, 2026

Summary

Audited all 23 cookbook documentation files against the real SDK API surface. Fixed incorrect APIs, removed aspirational/non-existent patterns, corrected inaccurate claims, and added [!code highlight] markers throughout.

API correctness fixes

  • ai-sdk.mdx, chat-sdk.mdx (3 instances): return start() returned Run not Response — use createUIMessageStreamResponse({ stream: run.readable }) instead
  • tool-orchestration.mdx: Table incorrectly stated getWritable() is unavailable at workflow level; removed invalid generic on createWebhook()
  • stop-workflow.mdx: Replaced non-existent { stop: true } prepareStep return with { toolChoice: "none" }; moved maxSteps from DurableAgent constructor to stream() options; removed @skip-typecheck comments
  • durable-objects.mdx: Removed erroneous "use step" directive from API route handler
  • child-workflows.mdx: Fixed comment referencing non-existent "queued" / "starting" statuses
  • serializable-steps.mdx, durable-objects.mdx: Fixed @workflow/ai/providers/anthropic@workflow/ai/anthropic

Content corrections

  • publishing-libraries.mdx: Fixed "must be JSON-serializable" — workflow supports Date, Map, Set, RegExp, BigInt, Uint8Array, URL, Error, and custom classes. Added link to serialization reference. Rewrote credential guidance to present env vars and explicit passing as equally valid (both safe with encryption enabled).
  • custom-serialization.mdx: Fixed "class instances lose their prototype chain" — they throw a serialization error. Removed incorrect "Manual Registration for Library Authors" section (build process discovers classes in node_modules). Removed step-as-factory comparison section (page should focus on custom class serialization). Fixed return new thisreturn new WorkflowStorageClient. Replaced "serde" shorthand with explicit "custom class serialization" throughout.
  • serializable-steps.mdx: Removed "Bundle optimization with dynamic imports" section (SWC plugin dead-code-eliminates unused imports automatically).

Code highlights

Added [!code highlight] markers to key lines across all 23 cookbook files to draw attention to the important API calls and patterns in each example.

Copilot AI review requested due to automatic review settings April 13, 2026 06:49
@TooTallNate TooTallNate requested a review from a team as a code owner April 13, 2026 06:49
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 13, 2026

⚠️ No Changeset found

Latest commit: dec27a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 13, 2026

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 Apr 14, 2026 7:56am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Apr 14, 2026 7:56am
example-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-astro-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-express-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-fastify-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-hono-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-nitro-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-nuxt-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-sveltekit-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workbench-vite-workflow Ready Ready Preview, Comment Apr 14, 2026 7:56am
workflow-docs Ready Ready Preview, Comment, Open in v0 Apr 14, 2026 7:56am
workflow-swc-playground Ready Ready Preview, Comment Apr 14, 2026 7:56am

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 922 1 67 990
✅ 💻 Local Development 683 0 127 810
✅ 📦 Local Production 898 0 182 1080
✅ 🐘 Local Postgres 898 0 182 1080
✅ 🪟 Windows 82 0 8 90
❌ 🌍 Community Worlds 133 74 24 231
✅ 📋 Other 228 0 42 270
Total 3844 75 632 4551

❌ Failed Tests

▲ Vercel Production (1 failed)

fastify (1 failed):

  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KP5G0KKA0KFZ6KVHHWHBVEHS | 🔍 observability
🌍 Community Worlds (74 failed)

mongodb (7 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KP5FS9TEME0JZ27JMRZY0BQS
  • webhookWorkflow | wrun_01KP5FSJG2VQTXGXSCMEY2854X
  • fetchWorkflow | wrun_01KP5FWYM23CZ0ZJJPJ9HNMVS6
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KP5G18F293PA9QCBWXFFVYTH
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KP5G8TFP7CGKT42N1YCN1E0K

redis (7 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KP5FS9TEME0JZ27JMRZY0BQS
  • webhookWorkflow | wrun_01KP5FSJG2VQTXGXSCMEY2854X
  • fetchWorkflow | wrun_01KP5FWYM23CZ0ZJJPJ9HNMVS6
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KP5G18F293PA9QCBWXFFVYTH
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KP5G8TFP7CGKT42N1YCN1E0K

turso (60 failed):

  • addTenWorkflow | wrun_01KP5FR3MVFQM1QM3BV9HRANZX
  • addTenWorkflow | wrun_01KP5FR3MVFQM1QM3BV9HRANZX
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KP5FRVJ2FH5XH1H25GDX7AK8
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KP5FRAAV1EKHX9RKGP631FKS
  • promiseRaceWorkflow | wrun_01KP5FRG7RW4RGHGSP9699N8M2
  • promiseAnyWorkflow | wrun_01KP5FRJA1TFYQ1MCYHKBF30R4
  • importedStepOnlyWorkflow | wrun_01KP5FS7D9MV5J377CNGW6BNK0
  • hookWorkflow | wrun_01KP5FRYG09G85VXKRCNKE11GH
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KP5FS9TEME0JZ27JMRZY0BQS
  • webhookWorkflow | wrun_01KP5FSJG2VQTXGXSCMEY2854X
  • sleepingWorkflow | wrun_01KP5FSRTPKFYG8BJP4CH0467M
  • parallelSleepWorkflow | wrun_01KP5FT4TTEX0PKG7MKDY1071R
  • nullByteWorkflow | wrun_01KP5FT82ZD36142RFAN3TF405
  • workflowAndStepMetadataWorkflow | wrun_01KP5FTA6Y3MGDKGVRD6MR3ATX
  • fetchWorkflow | wrun_01KP5FWYM23CZ0ZJJPJ9HNMVS6
  • promiseRaceStressTestWorkflow | wrun_01KP5FX225C1TTN0S18AWZHZ0N
  • 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_01KP5G0KKA0KFZ6KVHHWHBVEHS
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KP5G18F293PA9QCBWXFFVYTH
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KP5G1XV56HTQSV5MQJMH4HEA
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KP5G2JC60S4K893J8BTTYMFY
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KP5G2VPEVAJXYD29CAB8HSQH
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KP5G318RNPM0NN102QX345Q7
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KP5G33BRWNFKJER1R7YMKSJK
  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KP5G3ERBZ56NY0RE0RYE5SST
  • 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_01KP5G3YDHY0DDTHXFV6VNPN81
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KP5G446T8AXDD794FYM6R75A
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KP5G4BKC6M0HYF990RME9EB5
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KP5G4JC1FN30AP7MTYZCCNE4
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KP5G4S7X4DX4JMXRFG7ZB23N
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KP5G50B7NDQ0FC73N9T6ECP6
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KP5G573791R108ZRC0M4FFKW
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KP5G5JGXZ3BFTSYEVKPNJT3F
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KP5G5VKD4XW1VG8SV4HM6NPY
  • cancelRun - cancelling a running workflow | wrun_01KP5G629G6Z472S00G345PQAB
  • cancelRun via CLI - cancelling a running workflow | wrun_01KP5G6C0SSVR154VY8PB2ZA6J
  • 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_01KP5G6RGZJBS8C1QC02J047NC
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KP5G7F9DDE2HPKF9VPSG2JB2
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KP5G7V7KH6BFMYBNT57N5WQN
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KP5G8F1W2D6PSPR07S3ND4KE
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KP5G8NY4AE975B9TS9EY1H15
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KP5G8TFP7CGKT42N1YCN1E0K
  • getterStepWorkflow - getter functions with "use step" directive | wrun_01KP5G96YQ8ZTY4YAPC90X8GC9

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 83 0 7
✅ example 83 0 7
✅ express 83 0 7
❌ fastify 82 1 7
✅ hono 83 0 7
✅ nextjs-turbopack 88 0 2
✅ nextjs-webpack 88 0 2
✅ nitro 83 0 7
✅ nuxt 83 0 7
✅ sveltekit 83 0 7
✅ vite 83 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 76 0 14
✅ fastify-stable 76 0 14
✅ nextjs-turbopack-stable 82 0 8
✅ nextjs-webpack-canary 63 0 27
✅ nextjs-webpack-stable 82 0 8
✅ nitro-stable 76 0 14
✅ nuxt-stable 76 0 14
✅ sveltekit-stable 76 0 14
✅ vite-stable 76 0 14
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 76 0 14
✅ express-stable 76 0 14
✅ fastify-stable 76 0 14
✅ hono-stable 76 0 14
✅ nextjs-turbopack-canary 63 0 27
✅ nextjs-turbopack-stable 82 0 8
✅ nextjs-webpack-canary 63 0 27
✅ nextjs-webpack-stable 82 0 8
✅ nitro-stable 76 0 14
✅ nuxt-stable 76 0 14
✅ sveltekit-stable 76 0 14
✅ vite-stable 76 0 14
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 76 0 14
✅ express-stable 76 0 14
✅ fastify-stable 76 0 14
✅ hono-stable 76 0 14
✅ nextjs-turbopack-canary 63 0 27
✅ nextjs-turbopack-stable 82 0 8
✅ nextjs-webpack-canary 63 0 27
✅ nextjs-webpack-stable 82 0 8
✅ nitro-stable 76 0 14
✅ nuxt-stable 76 0 14
✅ sveltekit-stable 76 0 14
✅ vite-stable 76 0 14
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 82 0 8
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 6 0 0
❌ mongodb 56 7 8
✅ redis-dev 6 0 0
❌ redis 56 7 8
✅ turso-dev 6 0 0
❌ turso 3 60 8
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 76 0 14
✅ e2e-local-postgres-nest-stable 76 0 14
✅ e2e-local-prod-nest-stable 76 0 14

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.042s (+1.2%) 1.006s (~) 0.964s 10 1.00x
💻 Local Express 0.043s (+17.6% 🔺) 1.005s (~) 0.962s 10 1.01x
🐘 Postgres Express 0.062s (+8.0% 🔺) 1.014s (~) 0.952s 10 1.47x
🐘 Postgres Nitro 0.068s (+2.1%) 1.012s (~) 0.943s 10 1.62x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.244s (-5.5% 🟢) 2.081s (+15.5% 🔺) 1.836s 10 1.00x
▲ Vercel Nitro 0.426s (+65.1% 🔺) 2.538s (+25.8% 🔺) 2.111s 10 1.75x

🔍 Observability: Express | Nitro

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.126s (~) 2.005s (~) 0.880s 10 1.00x
💻 Local Express 1.126s (+2.6%) 2.006s (~) 0.880s 10 1.00x
🐘 Postgres Express 1.137s (-1.2%) 2.010s (~) 0.873s 10 1.01x
🐘 Postgres Nitro 1.167s (+1.5%) 2.011s (~) 0.844s 10 1.04x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.964s (-1.0%) 3.276s (-15.2% 🟢) 1.312s 10 1.00x
▲ Vercel Nitro 2.033s (+6.7% 🔺) 3.922s (+2.4%) 1.889s 10 1.04x

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 10.872s (~) 11.023s (~) 0.151s 3 1.00x
🐘 Postgres Express 10.901s (~) 11.023s (~) 0.123s 3 1.00x
💻 Local Nitro 10.917s (~) 11.023s (~) 0.106s 3 1.00x
💻 Local Express 10.949s (+2.9%) 11.024s (~) 0.075s 3 1.01x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 16.923s (-10.8% 🟢) 19.331s (-5.8% 🟢) 2.408s 2 1.00x
▲ Vercel Express 17.466s (-1.4%) 18.518s (-8.4% 🟢) 1.052s 2 1.03x

🔍 Observability: Nitro | Express

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 14.529s (~) 15.023s (~) 0.494s 4 1.00x
🐘 Postgres Express 14.557s (~) 15.021s (~) 0.464s 4 1.00x
💻 Local Express 14.971s (+5.1% 🔺) 15.280s (+1.7%) 0.309s 4 1.03x
💻 Local Nitro 14.993s (~) 15.279s (+1.7%) 0.286s 4 1.03x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 32.080s (-6.0% 🟢) 34.247s (-5.1% 🟢) 2.167s 2 1.00x
▲ Vercel Express 34.549s (-3.3%) 35.825s (-5.3% 🟢) 1.276s 2 1.08x

🔍 Observability: Nitro | Express

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 13.851s (-0.7%) 14.021s (-2.0%) 0.170s 7 1.00x
🐘 Postgres Nitro 13.947s (-1.2%) 14.447s (-2.0%) 0.500s 7 1.01x
💻 Local Express 16.387s (+8.9% 🔺) 17.031s (+9.7% 🔺) 0.644s 6 1.18x
💻 Local Nitro 16.796s (~) 17.031s (~) 0.235s 6 1.21x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 52.732s (-4.9%) 54.812s (-5.0% 🟢) 2.080s 2 1.00x
▲ Vercel Express 56.471s (+3.7%) 58.062s (+2.9%) 1.592s 2 1.07x

🔍 Observability: Nitro | Express

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.272s (-0.7%) 2.009s (~) 0.736s 15 1.00x
🐘 Postgres Express 1.279s (~) 2.009s (~) 0.730s 15 1.00x
💻 Local Nitro 1.506s (-1.1%) 2.006s (~) 0.500s 15 1.18x
💻 Local Express 1.513s (+5.0%) 2.005s (~) 0.492s 15 1.19x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.126s (-27.3% 🟢) 4.289s (-7.9% 🟢) 2.164s 8 1.00x
▲ Vercel Express 2.727s (+1.4%) 4.357s (-2.2%) 1.630s 7 1.28x

🔍 Observability: Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.329s (-0.8%) 3.010s (~) 0.681s 10 1.00x
🐘 Postgres Nitro 2.369s (+0.5%) 3.009s (~) 0.640s 10 1.02x
💻 Local Express 2.915s (+13.1% 🔺) 3.454s (+14.8% 🔺) 0.538s 9 1.25x
💻 Local Nitro 3.102s (+4.6%) 3.759s (~) 0.658s 8 1.33x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.849s (+4.3%) 4.476s (-2.6%) 1.627s 7 1.00x
▲ Vercel Express 3.274s (+24.2% 🔺) 4.576s (+4.1%) 1.301s 7 1.15x

🔍 Observability: Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.438s (-1.4%) 4.011s (~) 0.572s 8 1.00x
🐘 Postgres Express 3.472s (-0.6%) 4.008s (~) 0.536s 8 1.01x
💻 Local Express 7.685s (+14.4% 🔺) 8.267s (+17.8% 🔺) 0.582s 4 2.24x
💻 Local Nitro 8.271s (-1.2%) 9.022s (~) 0.751s 4 2.41x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.161s (+21.3% 🔺) 5.256s (+24.1% 🔺) 2.095s 6 1.00x
▲ Vercel Express 3.444s (+10.1% 🔺) 5.058s (+2.6%) 1.614s 6 1.09x

🔍 Observability: Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.254s (-1.0%) 2.008s (~) 0.754s 15 1.00x
🐘 Postgres Nitro 1.261s (-0.5%) 2.008s (~) 0.747s 15 1.01x
💻 Local Express 1.559s (+6.3% 🔺) 2.006s (~) 0.447s 15 1.24x
💻 Local Nitro 1.565s (+2.7%) 2.006s (~) 0.441s 15 1.25x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.146s (+4.7%) 3.771s (-7.9% 🟢) 1.625s 8 1.00x
▲ Vercel Express 2.449s (+6.5% 🔺) 4.126s (-4.6%) 1.677s 8 1.14x

🔍 Observability: Nitro | Express

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.331s (-1.4%) 3.010s (~) 0.679s 10 1.00x
🐘 Postgres Nitro 2.395s (+1.3%) 3.010s (~) 0.614s 10 1.03x
💻 Local Express 2.802s (-5.7% 🟢) 3.007s (-10.0% 🟢) 0.205s 10 1.20x
💻 Local Nitro 2.918s (-5.8% 🟢) 3.761s (-6.2% 🟢) 0.843s 8 1.25x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.402s (-3.8%) 3.986s (-4.9%) 1.584s 8 1.00x
▲ Vercel Express 2.621s (-3.0%) 4.430s (+0.9%) 1.809s 7 1.09x

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.474s (-1.0%) 4.010s (~) 0.536s 8 1.00x
🐘 Postgres Nitro 3.494s (~) 4.012s (~) 0.518s 8 1.01x
💻 Local Express 8.074s (~) 8.773s (~) 0.698s 4 2.32x
💻 Local Nitro 8.755s (-6.3% 🟢) 9.026s (-10.0% 🟢) 0.271s 4 2.52x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.341s (+3.8%) 4.822s (-5.8% 🟢) 1.481s 7 1.00x
▲ Vercel Nitro 3.498s (+17.5% 🔺) 5.370s (+6.3% 🔺) 1.873s 6 1.05x

🔍 Observability: Express | Nitro

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.798s (-4.2%) 1.006s (~) 0.207s 60 1.00x
🐘 Postgres Nitro 0.813s (-2.9%) 1.006s (~) 0.193s 60 1.02x
💻 Local Nitro 1.001s (+1.1%) 1.338s (+6.6% 🔺) 0.338s 45 1.25x
💻 Local Express 1.021s (+45.8% 🔺) 1.654s (+64.7% 🔺) 0.633s 37 1.28x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 9.085s (-6.1% 🟢) 10.676s (-7.6% 🟢) 1.591s 6 1.00x
▲ Vercel Nitro 9.622s (+3.1%) 11.744s (+5.4% 🔺) 2.122s 6 1.06x

🔍 Observability: Express | Nitro

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.901s (-3.2%) 2.053s (-7.8% 🟢) 0.152s 44 1.00x
🐘 Postgres Nitro 1.924s (-0.7%) 2.076s (-7.8% 🟢) 0.151s 44 1.01x
💻 Local Nitro 3.040s (+0.7%) 3.801s (+6.0% 🔺) 0.761s 24 1.60x
💻 Local Express 3.046s (+24.8% 🔺) 3.801s (+19.5% 🔺) 0.755s 24 1.60x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 28.176s (+0.8%) 30.085s (~) 1.909s 3 1.00x
▲ Vercel Express 28.867s (+3.4%) 30.365s (~) 1.497s 3 1.02x

🔍 Observability: Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.935s (+1.1%) 4.331s (+4.4%) 0.395s 28 1.00x
🐘 Postgres Express 3.965s (-1.4%) 4.296s (-3.6%) 0.330s 28 1.01x
💻 Local Express 8.918s (+22.1% 🔺) 9.324s (+17.3% 🔺) 0.407s 13 2.27x
💻 Local Nitro 9.175s (-0.8%) 10.018s (~) 0.844s 12 2.33x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 70.739s (-7.6% 🟢) 72.687s (-7.3% 🟢) 1.948s 2 1.00x
▲ Vercel Express 73.110s (+3.0%) 74.097s (+0.6%) 0.987s 2 1.03x

🔍 Observability: Nitro | Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.281s (-0.6%) 1.007s (~) 0.726s 60 1.00x
🐘 Postgres Nitro 0.282s (+2.5%) 1.007s (~) 0.724s 60 1.01x
💻 Local Express 0.570s (-2.2%) 1.004s (~) 0.434s 60 2.03x
💻 Local Nitro 0.600s (+3.4%) 1.022s (+1.7%) 0.421s 59 2.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.486s (+3.0%) 3.002s (-6.7% 🟢) 1.516s 20 1.00x
▲ Vercel Nitro 1.578s (+15.0% 🔺) 3.189s (+8.7% 🔺) 1.612s 19 1.06x

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.490s (-2.6%) 1.006s (~) 0.517s 90 1.00x
🐘 Postgres Nitro 0.502s (~) 1.007s (~) 0.505s 90 1.02x
💻 Local Express 2.378s (-0.7%) 3.008s (~) 0.631s 30 4.86x
💻 Local Nitro 2.556s (+3.3%) 3.010s (~) 0.454s 30 5.22x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.610s (~) 3.765s (-16.0% 🟢) 1.155s 24 1.00x
▲ Vercel Nitro 2.875s (+4.4%) 4.505s (~) 1.629s 20 1.10x

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.781s (-1.1%) 1.008s (~) 0.226s 120 1.00x
🐘 Postgres Nitro 0.798s (+2.0%) 1.009s (~) 0.210s 119 1.02x
💻 Local Express 10.516s (+5.1% 🔺) 11.029s (+3.2%) 0.513s 11 13.46x
💻 Local Nitro 11.237s (+1.2%) 11.937s (+0.8%) 0.700s 11 14.38x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 7.365s (+10.3% 🔺) 8.999s (+2.4%) 1.634s 14 1.00x
▲ Vercel Express 7.513s (+13.9% 🔺) 8.782s (+1.9%) 1.269s 15 1.02x

🔍 Observability: Nitro | Express

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.201s (-0.9%) 1.004s (~) 0.012s (+2.5%) 1.018s (~) 0.817s 10 1.00x
🐘 Postgres Express 0.202s (-2.3%) 0.998s (~) 0.001s (~) 1.010s (~) 0.808s 10 1.00x
🐘 Postgres Nitro 0.204s (-4.5%) 0.997s (~) 0.002s (+23.1% 🔺) 1.010s (~) 0.806s 10 1.01x
💻 Local Express 0.213s (+52.6% 🔺) 1.004s (~) 0.010s (+7.4% 🔺) 1.016s (~) 0.803s 10 1.06x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.763s (+138.6% 🔺) 5.322s (+77.5% 🔺) 6.217s (+1577.1% 🔺) 12.220s (+221.1% 🔺) 8.456s 10 1.00x
▲ Vercel Express 4.344s (+183.3% 🔺) 5.759s (+108.1% 🔺) 6.338s (+795.5% 🔺) 12.728s (+220.7% 🔺) 8.384s 10 1.15x

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.611s (~) 1.005s (~) 0.004s (-23.1% 🟢) 1.022s (~) 0.411s 59 1.00x
🐘 Postgres Nitro 0.611s (~) 1.005s (~) 0.004s (+11.4% 🔺) 1.022s (~) 0.411s 59 1.00x
💻 Local Nitro 0.832s (+14.6% 🔺) 1.012s (~) 0.010s (+5.5% 🔺) 1.117s (+9.1% 🔺) 0.284s 54 1.36x
💻 Local Express 0.956s (+71.3% 🔺) 1.012s (~) 0.010s (+12.0% 🔺) 1.228s (+20.2% 🔺) 0.272s 49 1.57x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.878s (-6.6% 🟢) 5.025s (-15.1% 🟢) 0.231s (-15.9% 🟢) 5.594s (-15.9% 🟢) 1.716s 11 1.00x
▲ Vercel Nitro 4.097s (-8.5% 🟢) 5.508s (-8.9% 🟢) 0.226s (-20.0% 🟢) 6.152s (-11.7% 🟢) 2.056s 10 1.06x

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.939s (-0.7%) 1.172s (~) 0.000s (-66.7% 🟢) 1.186s (~) 0.247s 51 1.00x
🐘 Postgres Nitro 0.991s (+1.1%) 1.321s (+10.8% 🔺) 0.000s (-44.6% 🟢) 1.334s (+9.6% 🔺) 0.343s 46 1.06x
💻 Local Express 1.212s (+6.3% 🔺) 2.019s (~) 0.000s (+37.5% 🔺) 2.021s (~) 0.809s 30 1.29x
💻 Local Nitro 1.242s (~) 2.021s (~) 0.000s (+12.5% 🔺) 2.023s (~) 0.781s 30 1.32x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.759s (-6.0% 🟢) 4.052s (-2.9%) 0.000s (-100.0% 🟢) 4.540s (-2.6%) 1.781s 14 1.00x
▲ Vercel Express 2.784s (+6.2% 🔺) 3.783s (-1.3%) 0.001s (-72.4% 🟢) 4.136s (-4.2%) 1.353s 15 1.01x

🔍 Observability: Nitro | Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.710s (-3.0%) 2.139s (+1.9%) 0.000s (+3.6%) 2.157s (+2.1%) 0.446s 28 1.00x
🐘 Postgres Express 1.829s (+2.8%) 2.214s (+3.6%) 0.000s (+Infinity% 🔺) 2.232s (+4.0%) 0.403s 28 1.07x
💻 Local Express 3.410s (+4.1%) 4.032s (+3.2%) 0.001s (-22.4% 🟢) 4.034s (+3.2%) 0.625s 15 1.99x
💻 Local Nitro 3.545s (+1.2%) 4.032s (-1.7%) 0.000s (-71.4% 🟢) 4.035s (-1.7%) 0.490s 15 2.07x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.582s (-8.0% 🟢) 4.942s (-9.1% 🟢) 0.000s (-100.0% 🟢) 5.367s (-9.9% 🟢) 1.785s 12 1.00x
▲ Vercel Express 4.203s (-0.7%) 5.008s (-11.4% 🟢) 0.000s (-100.0% 🟢) 5.396s (-14.4% 🟢) 1.193s 12 1.17x

🔍 Observability: Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 13/21
🐘 Postgres Express 15/21
▲ Vercel Nitro 14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 17/21
Nitro 🐘 Postgres 17/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Copy link
Copy Markdown
Contributor

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

Updates cookbook documentation examples to match the current Workflow + AI SDK API surface, avoiding copy/paste code that would fail type-checking or at runtime.

Changes:

  • Fixes API route examples to await start(...) and return an AI SDK createUIMessageStreamResponse({ stream: run.readable }) (with x-workflow-run-id).
  • Corrects mismatched/invalid API details (run.runId vs run.id, webhook generics, status names, getWritable() capability table).
  • Updates the “stop workflow” pattern to use prepareStep returning { toolChoice: "none" } and moves maxSteps to agent.stream() options; removes an erroneous "use step" directive from a route handler.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/content/docs/cookbook/integrations/chat-sdk.mdx Fix route handlers to return createUIMessageStreamResponse using run.readable and run.runId.
docs/content/docs/cookbook/integrations/ai-sdk.mdx Same streaming response pattern correction for start() integration example.
docs/content/docs/cookbook/common-patterns/child-workflows.mdx Corrects non-final status comment to match WorkflowRunStatus (pending, running).
docs/content/docs/cookbook/agent-patterns/tool-orchestration.mdx Fixes getWritable() availability table and removes invalid createWebhook<...>() generic usage.
docs/content/docs/cookbook/agent-patterns/stop-workflow.mdx Replaces non-existent { stop: true } with { toolChoice: "none" }; moves maxSteps to stream() options; removes skip-typecheck comments.
docs/content/docs/cookbook/advanced/secure-credentials.mdx Fixes returned run id property from run.id to run.runId.
docs/content/docs/cookbook/advanced/durable-objects.mdx Removes incorrect "use step" directive from an API route snippet using resumeHook.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TooTallNate TooTallNate enabled auto-merge (squash) April 14, 2026 07:27
@TooTallNate TooTallNate disabled auto-merge April 14, 2026 07:36
Fix 9 issues across 6 cookbook files found during API audit:

- ai-sdk, chat-sdk: return start() returned Run not Response;
  use createUIMessageStreamResponse with run.readable instead
- tool-orchestration: getWritable() is available at workflow level
  (table was wrong); remove invalid generic on createWebhook()
- stop-workflow: replace non-existent { stop: true } prepareStep
  return with { toolChoice: "none" }; move maxSteps from
  DurableAgent constructor to stream() options
- durable-objects: remove erroneous "use step" from API route
- child-workflows: fix comment referencing non-existent statuses
  (queued/starting -> pending/running)
…kbook

- Fix @workflow/ai import path: providers/anthropic -> anthropic
  (serializable-steps, durable-objects)
- Remove 'Bundle optimization with dynamic imports' section from
  serializable-steps — SWC plugin dead-code-eliminates unused
  imports from the workflow bundle automatically
- Fix serialization claims in publishing-libraries: workflow supports
  Date, Map, Set, RegExp, BigInt, Uint8Array, URL, Error, and custom
  serde classes — not just JSON. Link to serialization reference.
- Rewrite secrets guidance: encryption protects the event log, so
  this is a best practice not a hard requirement
- Fix custom-serialization: class instances throw a serialization
  error (not silently lose prototype chain); remove incorrect
  'Manual Registration for Library Authors' section (the build
  process discovers classes in node_modules); fix return new this
  -> return new WorkflowStorageClient; reorder Decision Guide to
  recommend custom serde as the default approach
…l guidance

- Add [!code highlight] markers to key lines across all 23 cookbook
  files to emphasize important API calls and patterns
- Remove step-as-factory comparison section from custom-serialization
  page — the page should focus solely on custom class serialization
- Replace 'serde' shorthand with explicit 'custom class serialization'
  throughout for clarity
- Rewrite credential guidance in publishing-libraries to present
  both patterns (env vars and passing explicitly) as equally valid
  when workflow encryption is enabled
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.

3 participants