Skip to content

docs: Add durable streaming migration guide, FAQ, and content enhancements#1323

Open
johnlindquist wants to merge 3 commits intomainfrom
docs/workflow-streaming-content
Open

docs: Add durable streaming migration guide, FAQ, and content enhancements#1323
johnlindquist wants to merge 3 commits intomainfrom
docs/workflow-streaming-content

Conversation

@johnlindquist
Copy link
Contributor

Summary

  • New: Migration guide (foundations/migrate-ephemeral-streaming.mdx) — Step-by-step guide for moving from ephemeral streaming to durable streaming with Workflow DevKit. Covers wrapping generation in a workflow step, exposing runId, swapping in WorkflowChatTransport, and common gotchas.
  • New: FAQ section (faq/index.mdx) — 13 questions covering troubleshooting (silent step failures, WorkflowChatTransport body shape), migration (incremental adoption, what you get after migrating), compatibility (local dev, AI SDK, frameworks, DurableAgent), and advanced usage (reconnection flow, user input hooks, redeploy behavior, multiple clients).
  • Enhanced: foundations/streaming.mdx — Added "Why durable streaming" section explaining the durability model vs ephemeral connections, with links to migration guide and resumable streams.
  • Enhanced: ai/resumable-streams.mdx — Added common gotchas callout for WorkflowChatTransport request body customization via prepareSendMessagesRequest, and local debugging tips using the Web UI.
  • Enhanced: deploying/world/local-world.mdx — Added "Why local development matters" section highlighting the step debugger for catching silent failures during development.
  • Enhanced: observability/index.mdx — Added debugging walkthrough for silent step failures using the Web UI, with step-by-step instructions.

Context

Based on real developer feedback from a Workflow migration (async-recipes app). The feedback identified these gaps:

  • No migration path from ephemeral to durable streaming
  • No FAQ or troubleshooting content
  • WorkflowChatTransport gotchas not documented near usage examples
  • "Works locally" story not prominent enough in local dev and observability docs

Test plan

  • Verify new pages render correctly in the docs site (npm run dev)
  • Verify navigation: migration guide appears under Foundations after Streaming
  • Verify navigation: FAQ appears in top-level nav before API Reference
  • Verify all internal links resolve (migration guide, FAQ cross-references)
  • Verify existing pages still render after enhancements (streaming, resumable-streams, local-world, observability)

P0: New content
- Add migration guide: ephemeral to durable streaming (foundations/)
- Add FAQ section with troubleshooting, migration, compatibility, and
  advanced usage questions
- Wire both into site navigation via meta.json

P1: Enhance existing docs
- streaming.mdx: Add "Why durable streaming" section explaining the
  durability model vs ephemeral connections
- resumable-streams.mdx: Add common gotchas for WorkflowChatTransport
  request body customization and local debugging tips
- local-world.mdx: Add "Why local development matters" section on
  debugging silent failures with the step debugger
- observability/index.mdx: Add debugging walkthrough for silent step
  failures using the Web UI
@johnlindquist johnlindquist requested a review from a team as a code owner March 11, 2026 03:30
@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2026

⚠️ No Changeset found

Latest commit: b566f42

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
Contributor

vercel bot commented Mar 11, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 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 🥇 Express 0.032s (+21.6% 🔺) 1.007s (~) 0.974s 10 1.00x
💻 Local Nitro 0.034s (+1.5%) 1.006s (~) 0.972s 10 1.05x
🐘 Postgres Nitro 0.052s (+36.4% 🔺) 1.012s (~) 0.960s 10 1.62x
🐘 Postgres Express 0.054s (+1.9%) 1.012s (~) 0.958s 10 1.67x
workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.102s (+2.9%) 2.006s (~) 0.904s 10 1.00x
💻 Local Nitro 1.107s (~) 2.006s (~) 0.899s 10 1.00x
🐘 Postgres Express 1.125s (~) 2.012s (~) 0.888s 10 1.02x
🐘 Postgres Nitro 1.125s (+2.3%) 2.013s (~) 0.888s 10 1.02x
workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 10.791s (+2.8%) 11.023s (~) 0.232s 3 1.00x
💻 Local Nitro 10.808s (~) 11.024s (~) 0.216s 3 1.00x
🐘 Postgres Nitro 10.835s (+2.1%) 11.043s (~) 0.208s 3 1.00x
🐘 Postgres Express 10.885s (+0.6%) 11.044s (~) 0.158s 3 1.01x
workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 26.968s (~) 27.063s (~) 0.095s 3 1.00x
🐘 Postgres Nitro 27.004s (+2.2%) 27.066s (~) 0.062s 3 1.00x
💻 Local Express 27.198s (+2.8%) 28.052s (+3.7%) 0.854s 3 1.01x
💻 Local Nitro 27.254s (~) 28.053s (~) 0.799s 3 1.01x
workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 53.713s (+1.7%) 54.104s (+1.9%) 0.391s 2 1.00x
🐘 Postgres Express 53.987s (~) 54.104s (~) 0.117s 2 1.01x
💻 Local Express 56.033s (+3.0%) 56.099s (+1.8%) 0.066s 2 1.04x
💻 Local Nitro 56.275s (~) 57.100s (~) 0.825s 2 1.05x
Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.354s (+5.8% 🔺) 2.011s (~) 0.657s 15 1.00x
🐘 Postgres Express 1.381s (+1.4%) 2.012s (~) 0.630s 15 1.02x
💻 Local Express 1.418s (+6.0% 🔺) 2.006s (~) 0.588s 15 1.05x
💻 Local Nitro 1.424s (+0.5%) 2.005s (~) 0.581s 15 1.05x
Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.987s (+15.5% 🔺) 2.597s (+16.7% 🔺) 0.611s 12 1.00x
🐘 Postgres Express 2.004s (+0.8%) 2.478s (-1.4%) 0.474s 13 1.01x
💻 Local Express 2.621s (+15.9% 🔺) 3.007s (~) 0.386s 10 1.32x
💻 Local Nitro 2.732s (+4.3%) 3.008s (~) 0.276s 10 1.38x
Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.612s (-4.0%) 4.309s (-6.4% 🟢) 0.697s 7 1.00x
🐘 Postgres Nitro 3.628s (+27.2% 🔺) 4.309s (+20.6% 🔺) 0.681s 7 1.00x
💻 Local Express 7.324s (+19.9% 🔺) 8.018s (+14.3% 🔺) 0.694s 4 2.03x
💻 Local Nitro 7.716s (+0.7%) 8.017s (~) 0.301s 4 2.14x
Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.379s (-0.6%) 2.012s (~) 0.633s 15 1.00x
🐘 Postgres Nitro 1.386s (+7.7% 🔺) 2.012s (~) 0.626s 15 1.01x
💻 Local Express 1.426s (+3.8%) 2.005s (~) 0.579s 15 1.03x
💻 Local Nitro 1.441s (+0.7%) 2.005s (~) 0.565s 15 1.04x
Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.060s (+4.6%) 2.603s (+3.6%) 0.542s 12 1.00x
🐘 Postgres Nitro 2.131s (+17.6% 🔺) 2.605s (+20.8% 🔺) 0.473s 12 1.03x
💻 Local Express 2.744s (+16.4% 🔺) 3.008s (~) 0.264s 10 1.33x
💻 Local Nitro 2.788s (+1.0%) 3.009s (~) 0.220s 10 1.35x
Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.479s (+10.8% 🔺) 4.146s (+9.3% 🔺) 0.667s 8 1.00x
🐘 Postgres Nitro 4.159s (+36.1% 🔺) 5.030s (+29.2% 🔺) 0.871s 6 1.20x
💻 Local Express 8.036s (+19.6% 🔺) 8.519s (+21.5% 🔺) 0.483s 4 2.31x
💻 Local Nitro 8.437s (-1.2%) 9.020s (~) 0.582s 4 2.42x
Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.171s (+56.1% 🔺) 1.003s (~) 0.012s (+26.1% 🔺) 1.017s (~) 0.846s 10 1.00x
💻 Local Nitro 0.179s (+4.7%) 1.002s (~) 0.012s (+7.8% 🔺) 1.018s (~) 0.838s 10 1.05x
🐘 Postgres Nitro 0.191s (+42.3% 🔺) 0.995s (~) 0.001s (~) 1.012s (~) 0.821s 10 1.12x
🐘 Postgres Express 0.205s (+10.9% 🔺) 0.994s (~) 0.001s (-18.8% 🟢) 1.014s (~) 0.809s 10 1.20x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 12/12
🐘 Postgres Nitro 6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 8/12
Nitro 🐘 Postgres 8/12
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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 538 0 67 605
✅ 💻 Local Development 576 0 84 660
✅ 📦 Local Production 576 0 84 660
❌ 🐘 Local Postgres 575 1 84 660
✅ 🪟 Windows 52 0 3 55
❌ 🌍 Community Worlds 118 56 15 189
✅ 📋 Other 138 0 27 165
Total 2573 57 364 2994

❌ Failed Tests

🐘 Local Postgres (1 failed)

hono-stable (1 failed):

  • webhookWorkflow
🌍 Community Worlds (56 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (51 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 48 0 7
✅ example 48 0 7
✅ express 48 0 7
✅ fastify 48 0 7
✅ hono 48 0 7
✅ nextjs-turbopack 53 0 2
✅ nextjs-webpack 53 0 2
✅ nitro 48 0 7
✅ nuxt 48 0 7
✅ sveltekit 48 0 7
✅ vite 48 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 46 0 9
✅ express-stable 46 0 9
✅ fastify-stable 46 0 9
✅ hono-stable 46 0 9
✅ nextjs-turbopack-canary 52 0 3
✅ nextjs-turbopack-stable 52 0 3
✅ nextjs-webpack-canary 52 0 3
✅ nextjs-webpack-stable 52 0 3
✅ nitro-stable 46 0 9
✅ nuxt-stable 46 0 9
✅ sveltekit-stable 46 0 9
✅ vite-stable 46 0 9
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 46 0 9
✅ express-stable 46 0 9
✅ fastify-stable 46 0 9
✅ hono-stable 46 0 9
✅ nextjs-turbopack-canary 52 0 3
✅ nextjs-turbopack-stable 52 0 3
✅ nextjs-webpack-canary 52 0 3
✅ nextjs-webpack-stable 52 0 3
✅ nitro-stable 46 0 9
✅ nuxt-stable 46 0 9
✅ sveltekit-stable 46 0 9
✅ vite-stable 46 0 9
❌ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 46 0 9
✅ express-stable 46 0 9
✅ fastify-stable 46 0 9
❌ hono-stable 45 1 9
✅ nextjs-turbopack-canary 52 0 3
✅ nextjs-turbopack-stable 52 0 3
✅ nextjs-webpack-canary 52 0 3
✅ nextjs-webpack-stable 52 0 3
✅ nitro-stable 46 0 9
✅ nuxt-stable 46 0 9
✅ sveltekit-stable 46 0 9
✅ vite-stable 46 0 9
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 52 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
❌ mongodb 52 3 3
✅ redis-dev 3 0 2
❌ redis 53 2 3
✅ turso-dev 3 0 2
❌ turso 4 51 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 46 0 9
✅ e2e-local-postgres-nest-stable 46 0 9
✅ e2e-local-prod-nest-stable 46 0 9

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Use DurableAgent string model IDs ("anthropic/claude-haiku-4.5") instead
of AI SDK provider functions (openai("gpt-4o")) in new docs content.
- Use workflow-level getWritable() instead of wrapping in a step
- DurableAgent internally creates steps, no manual "use step" needed
- Use ModelMessage type with convertToModelMessages
- Split workflow definition and route handler into separate files
  matching the pattern in ai/index.mdx
Copy link
Member

@VaguelySerious VaguelySerious left a comment

Choose a reason for hiding this comment

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

Overall LGTM, some preliminary comments, will let @pranaygp comment before approving

<Callout type="warn">
**Request body customization**

`WorkflowChatTransport` shapes its POST body differently than the default AI SDK transport. If you need custom fields in the request body (such as a model selector, temperature, or session metadata), use the `prepareSendMessagesRequest` hook to override the request:
Copy link
Member

Choose a reason for hiding this comment

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

Should ask an agent whether this is still the case on main, we made some minor changes to this in the recent past

npx workflow inspect runs --web
```

Check that the run is still active and that the `startIndex` in the reconnection request matches the last chunk the client received. The Web UI shows the full step trace, including stream chunk counts.
Copy link
Member

Choose a reason for hiding this comment

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

still active

The run doesn't need to be active to connect to a stream


### My reconnection endpoint returns an empty stream. What is wrong?

Check that the `runId` in the reconnection URL matches the run you want to resume. Verify the run is still active by inspecting it in the Web UI or CLI:
Copy link
Member

Choose a reason for hiding this comment

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

still active

The run doesn't need to be active to connect to a stream


### What happens to in-progress runs when I redeploy?

This depends on the [World](/docs/deploying) you are using. With the [Vercel World](/docs/deploying/world/vercel-world), runs are backed by durable infrastructure and survive deployments. With the [Local World](/docs/deploying/world/local-world), the in-memory queue does not persist across server restarts, so in-progress runs will not resume.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This depends on the [World](/docs/deploying) you are using. With the [Vercel World](/docs/deploying/world/vercel-world), runs are backed by durable infrastructure and survive deployments. With the [Local World](/docs/deploying/world/local-world), the in-memory queue does not persist across server restarts, so in-progress runs will not resume.
This depends on the [World](/docs/deploying) you are using. With the [Vercel World](/docs/deploying/world/vercel-world), runs continue to run on their original deployment, so deploying comes without risk. With the [Local World](/docs/deploying/world/local-world), the in-memory queue does not persist across server restarts, so in-progress runs will not resume.

@@ -0,0 +1,264 @@
---
title: Migrate from Ephemeral to Durable Streaming
Copy link
Member

Choose a reason for hiding this comment

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

This guide is a close copy of the Durable Agent guide I wrote a while back. I think it's nice to have a more focused example like here, though unsure if the duplication is worth it, vs. linking to the durable agent guide in other areas

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