Skip to content

[cli] Add workflow migrate temporal and cloudflare-workflows; Durable Objects guide - #5489

Open
pranaygp wants to merge 13 commits into
mainfrom
codemod-for-steprun-to-use-step-migration-temporal-cloudflare
Open

pranaygp wants to merge 13 commits into
mainfrom
codemod-for-steprun-to-use-step-migration-temporal-cloudflare

Conversation

@pranaygp

@pranaygp pranaygp commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This follows #5317 (Inngest) with the same treatment for Temporal and Cloudflare Workflows: a codemod in workflow migrate, a runnable workbench fixture, docs and skill updates, and a live parity check against the real platform. Cloudflare Durable Objects get a new guide instead of a codemod. Many Durable Object workloads are durable per-entity state machines that map well to one workflow run per entity, with WebSockets mapping to streams plus hooks. Whether a given object fits is a design decision, not a mechanical rewrite.

@workflow/cli (minor)

  • Shared engine. File discovery from the project's tsconfig, the TypeScript passes, annotation validation and refusing unparseable output now live in lib/migrate/project.ts behind a small MigrationFramework interface. Each codemod supplies its own detection, transform and report. The report's function ID becomes sourceId; the Inngest changeset hasn't been released, so nothing published changes.
    • Parameter inference now runs in rounds, so a captured parameter whose type depends on another inferred one is typed too.
    • A framework can migrate extra files it discovers, such as Temporal activity modules that import nothing from Temporal.
  • workflow migrate temporal
    • Workflows: exported functions of a workflows module become "use workflow".
    • Activities: each proxyActivities() becomes a direct import, and the activities become "use step" functions in their own module. retry.maximumAttempts becomes maxRetries = n - 1, and an activity with no limit gets a TODO, since Temporal retries without limit while the Workflow SDK default is 3.
    • Signals: each becomes a hook created when the run starts, with token ${runId}:<name>, so a signal sent early still waits. A small helper runs the original setHandler callbacks in order and re-checks condition() after each one.
    • Other mappings: sleep, child workflows (to start() plus run.returnValue), workflowInfo, uuid4, patched, log and ApplicationFailure.
    • TODOs: queries, updates, continueAsNew and cancellation scopes.
    • Report: client and worker calls with their replacements, plus a signal routing table.
  • workflow migrate cloudflare-workflows
    • Entrypoints: each WorkflowEntrypoint class becomes a "use workflow" function of the same name.
    • Steps: each step.do() callback becomes a "use step" function taking the variables it captured. retries.limit (default 5) becomes an explicit maxRetries on every step.
    • Durations: Cloudflare durations are carried over, with months and years converted.
    • Waits: step.waitForEvent() reads events, including those sent before the wait, from the run's start Hook, with Cloudflare's timeout error and default timeout.
    • wrangler config: read for vars and bindings. Bindings (KV, D1, R2, Queues, AI, Durable Objects) become TODOs.
    • Adapter: the report includes a drop-in workflowInstances() adapter for env.MY_WORKFLOW (create, get, status, sendEvent, terminate).
  • workflow migrate inngest: fixes the last two review findings on [cli] Add workflow migrate inngest codemod; refresh migration guides and skill for v5 #5317. A const options object that escapes into another container is now a TODO rather than read as final, and an unannotated rest parameter is typed as the tuple of the remaining inputs.

How it's tested

  • Unit tests: 378 CLI tests, including codemod suites for all three frameworks.
  • Runtime tests: in the vitest workbench, 27 runtime tests run the codemods' committed outputs and the Durable Objects guide's room pattern. CLI round-trip tests keep each committed output in sync with its fixture.
  • Live parity: each source app ran on the real platform locally and was compared with the codemod's migrated output, typechecked, built with Nitro and run on the Local World. One driver per pair sent identical requests and compared outputs and final statuses, after checking that each port was served by the build under test.
Source Versions Result
Temporal @temporalio/* 1.25.0, Temporal CLI 1.10.1 dev server 15 of 15 scenarios match
Cloudflare Workflows wrangler 4.163.0 (wrangler dev) 13 of 14 match; orderEmpty ends errored on both, with Cloudflare's generic WorkflowFatalError message versus the step's own message (documented)
Cloudflare Durable Objects (guide pattern) wrangler 4.163.0 7 of 7 match: broadcast order, reconnect catch-up, late-joiner history, concurrent counter, one entity under concurrent first requests, separate rooms, idle alarm
Inngest (regression) inngest@4.26.2 and inngest@3.54.2, inngest-cli dev 1.51.0 22 of 22 match

Docs and skill

  • Temporal and Cloudflare Workflows guides: each gains a "Run the codemod" section with real before/after output, a what-it-converts matrix, what behaves differently, and verify and cut-over sections.

  • New Durable Objects guide:

    • when an object is a workflow run and when it isn't;
    • a concept mapping and a worked chat-room migration (a hook loop for commands, a stream for broadcasts, one idle timer that re-arms);
    • why there's no codemod;
    • verify and cut over.

    Where it doesn't map: hot request/response traffic, many readers between writes, unbounded events in one run, raw WebSocket control, connected-client cost, and placement. Each has a workaround.

  • CLI reference: workflow migrate temporal and cloudflare-workflows sections.

  • Comparisons index: a Durable Objects row and card.

  • migrating-to-workflow-sdk skill, 0.5.0: new cloudflare-workflows and cloudflare-durable-objects references, an updated temporal reference, and intake and checklist entries for all three.

Flow control, schedules and continue-as-new across the guides

  • No continue-as-new, by design. Other engines restart a run because they cap its history and payloads. Workflow SDK limits are far higher, and on the QuickJS engine snapshotting keeps resumes fast and exempts a run from the default event limit, so a long loop stays one run.
    • Where it's explained: a new section in the Temporal guide, plus the AWS, Cloudflare, Inngest, Trigger.dev and AgentCore guides, the comparisons index, the Durable Objects guide's long-lived entities, the versioning page and the skill.
    • Successor runs: these are now only for moving onto newer code.
    • Codemod: the Temporal codemod's continueAsNew() and continueAsNewSuggested TODOs say the same.
  • Schedules: cron triggers map to Vercel Schedules, whose queue consumer calls start() with the occurrence's executionId as a start token. This is in the Temporal, AWS, Cloudflare and Trigger.dev guides, their skill references, and the scheduling cookbook. The Cloudflare codemod marks scheduled() handlers and reports wrangler Cron Triggers, and the Temporal codemod reports client.schedule.create().
  • Flow control: the Inngest guide's callout and the Trigger.dev and Temporal guides map concurrency, rate limits and throttling to start tokens and RetryableError, linking the Inngest flow-control section.

Inline "use step" closures

The Inngest and Cloudflare Workflows guides said a step function only gets its arguments. That's wrong: a "use step" closure inside a workflow reads the workflow's variables, because the compiler records what it captures with the call. The guides now say the codemods lift steps to module scope because that's the recommended style (testable, reusable, named in the trace), and that captured values are serialized like arguments.

A new "Steps defined inside a workflow" section in Foundations covers the rules, each checked at runtime:

  • captured values must be serializable, and a captured local function fails to serialize;
  • they are copies;
  • assigning to one fails.

An inner step can be a function declaration, an arrow function or a function expression; function expressions work since #5503. The skill and the codemod's comments say the same, and the codemods' behaviour is unchanged.

🤖 Generated with Claude Code

vercel Bot and others added 7 commits November 16, 2026 21:17
…fig and rest-parameter gaps

Move file discovery, the TypeScript passes and output validation out of the
Inngest codemod into a framework-neutral engine with a small
MigrationFramework interface, so other source frameworks can plug in. The
report's function ID becomes sourceId (unreleased).

Inngest: a const config that escapes into another container is a TODO
rather than read as final, and an unannotated rest parameter is typed as
the tuple of the remaining inputs.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
…un per entity

Many Durable Objects are per-entity, long-lived state machines. The guide
maps them to one run per entity: the ID becomes a start token (one run per
ID, like idFromName), methods and incoming WebSocket messages become
resumeHook() commands read by a hook loop, state becomes workflow locals,
the alarm becomes one sleep() at a time, and outgoing WebSocket messages
become a resumable stream. It says where this does not map, why there is
no codemod, and how to verify and cut over. A skill reference and a vitest
workbench runtime test of the room pattern come with it.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Exported functions of a Temporal workflows module become "use workflow"
functions, proxyActivities() becomes a direct import of the activities,
which get "use step" and the proxy's maximumAttempts as maxRetries.
Signals become hooks created when the run starts, with the original
handler run for each payload and condition() re-checked after each one.
sleep, executeChild/startChild, workflowInfo, uuid4, patched, log,
ApplicationFailure and the activity attempt are mapped; queries, updates,
continueAsNew and cancellation scopes are TODOs. The report lists client
calls and a signal routing table.

Shared: a FileKit for per-file edits, TODOs and aliased Workflow imports;
frameworks can add files outside the text filter (activities modules);
report types accept file-level steps and other frameworks' kinds.

The vitest workbench runs the codemod's output for a fixture.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
…migration-temporal-cloudflare

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
… Workflows guide and skill

Each class extending WorkflowEntrypoint becomes a "use workflow" function
and each step.do() callback a "use step" function taking the variables it
captured from run(). Semantics follow Cloudflare's engine: retries.limit
(default 5) becomes maxRetries, Cloudflare durations (30-day months) carry
over, and step.waitForEvent() reads the run's events from its start Hook by
type in arrival order, keeping events sent before the wait and throwing
Cloudflare's timeout error. Vars read in steps become process.env;
bindings, step timeouts and rollback handlers are TODOs. The report lists
binding calls and includes a drop-in workflowInstances() adapter.

Shared engine: AST helpers and capture analysis in their own modules,
framework-neutral report field types, and parameter types inferred in
rounds so a type that depends on another inferred parameter is not any.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
…to-use-step-migration-temporal-cloudflare

# Conflicts:
#	packages/cli/src/lib/migrate/frameworks.ts
#	packages/cli/src/lib/migrate/report-types.ts

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
…ate; index, CLI reference and skill

- Command help lists the three frameworks, and the CLI prints `(was X)`
  only when the workflow name differs from the source name.
- CLI reference: sections for workflow migrate temporal and
  cloudflare-workflows, and a pointer to the Durable Objects guide.
- Comparisons index: Durable Objects row and card; the codemod callout
  lists all three codemods.
- migrating-to-workflow-sdk skill 0.5.0: intake, references and checks for
  Temporal, Cloudflare Workflows and Durable Objects.
- Changeset for @workflow/cli.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
@pranaygp
pranaygp requested a review from a team as a code owner November 16, 2026 21:17
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
example-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-express-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-python-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workflow-docs Error Error v0 Nov 17, 2026 6:57pm UTC
workflow-swc-playground Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workflow-tarballs Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC
workflow-web Ready Ready Preview, v0 Nov 17, 2026 6:57pm UTC

Copilot AI balanced review requested due to automatic review settings November 16, 2026 21:17
@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d036bf4

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

This PR includes changesets to release 18 packages
Name Type
@workflow/cli Minor
workflow Patch
@workflow/world-testing Patch
@workflow/world-cloudflare Patch
@workflow/core Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

✅ All tests passed

E2E Test Summary

Summary
Passed Failed Skipped Total
✅ ▲ Vercel Production 4649 0 940 5589
✅ 🪟 Windows 401 0 13 414
✅ dynamic-runs 0 0 0 0
✅ vercel-http-transport 1054 0 188 1242
✅ vercel-multi-region 27 0 0 27
✅ vercel-queue-hold 4 0 0 4
✅ vercel-spec9 395 0 19 414
✅ vercel-ws-transport 712 0 116 828
Total 7242 0 1276 8518
Details by Category

✅ ▲ Vercel Production

App Passed Failed Skipped
✅ astro-node 171 0 36
✅ astro-quickjs 170 0 37
✅ example-node 171 0 36
✅ example-quickjs 170 0 37
✅ express-node 171 0 36
✅ express-quickjs 170 0 37
✅ fastify-node 171 0 36
✅ fastify-quickjs 170 0 37
✅ hono-node 171 0 36
✅ hono-quickjs 170 0 37
✅ nest-node 171 0 36
✅ nest-quickjs 170 0 37
✅ nextjs-turbopack-node 199 0 8
✅ nextjs-turbopack-quickjs 198 0 9
✅ nextjs-webpack-node 199 0 8
✅ nextjs-webpack-quickjs 198 0 9
✅ nitro-node 171 0 36
✅ nitro-quickjs 170 0 37
✅ nuxt-node 171 0 36
✅ nuxt-quickjs 170 0 37
✅ python-node 66 0 141
✅ sveltekit-node 190 0 17
✅ sveltekit-quickjs 189 0 18
✅ tanstack-start-node 171 0 36
✅ tanstack-start-quickjs 170 0 37
✅ vite-node 171 0 36
✅ vite-quickjs 170 0 37

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack-node 201 0 6
✅ nextjs-turbopack-quickjs 200 0 7

✅ dynamic-runs

App Passed Failed Skipped
✅ astro-vercel 0 0 0
✅ example-vercel 0 0 0
✅ express-vercel 0 0 0
✅ fastify-vercel 0 0 0
✅ hono-vercel 0 0 0
✅ nest-vercel 0 0 0
✅ nextjs-turbopack-vercel 0 0 0
✅ nextjs-webpack-vercel 0 0 0
✅ nitro-vercel 0 0 0
✅ nuxt-vercel 0 0 0
✅ sveltekit-vercel 0 0 0
✅ tanstack-start-vercel 0 0 0
✅ vite-vercel 0 0 0

✅ vercel-http-transport

App Passed Failed Skipped
✅ example 171 0 36
✅ express 171 0 36
✅ hono 171 0 36
✅ nextjs-turbopack 199 0 8
✅ nitro 171 0 36
✅ vite 171 0 36

✅ vercel-multi-region

App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

✅ vercel-queue-hold

App Passed Failed Skipped
✅ nextjs-turbopack 4 0 0

✅ vercel-spec9

App Passed Failed Skipped
✅ nextjs-turbopack-node 198 0 9
✅ nextjs-turbopack-quickjs 197 0 10

✅ vercel-ws-transport

App Passed Failed Skipped
✅ example 171 0 36
✅ express 171 0 36
✅ nextjs-turbopack 199 0 8
✅ vite 171 0 36

📋 View full workflow run

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit d036bf4 · Tue, 17 Nov 2026 19:09:26 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 171 (-23%) 💚 274 🔴 (-81%) 💚 312 🔴 (-83%) 💚 378 (-83%) 💚 30
TTFS stream 156 (-88%) 💚 318 🔴 (-77%) 💚 357 🔴 (-75%) 💚 417 (-71%) 💚 30
TTFS hook + stream 294 (-80%) 💚 443 🔴 (-72%) 💚 506 🔴 (-70%) 💚 3099 🔴 (+82%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 380 (+3.5%) 702 (-58%) 💚 1929 (+5.4%) 2298 (+25%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 967 (-4.0%) 4295 (-2.4%) 5756 (±0%) 6193 (+2.4%) 10
STSO 1020 steps (inline) 64 (-7.2%) 108 (-6.9%) 127 (-11%) 199 (-13%) 1019
WO 1020 steps 108242 (-4.1%) 108242 (-4.1%) 108242 (-4.1%) 108242 (-4.1%) 1
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 112515ms → this run 106772ms (Δ -5743ms, -5%)

   50-100 ms  ███████████████████████┃  main 525  this 529    +4
  100-150 ms  ███████████████████░┃     main 415  this 459   +44
  150-200 ms  ┃██                       main  59  this  21   -38
  200-250 ms  ┃                         main  14  this   7    -7
  250-300 ms  ┃                         main   2  this   1    -1
  300-350 ms  ┃                         main   2  this   1    -1
  350-400 ms  ┃                         main   0  this   1    +1
  400-450 ms  ┃                         main   1  this   0    -1
2900-2950 ms  ┃                         main   1  this   0    -1
📜 Previous results (3)

7c9d080

Tue, 17 Nov 2026 16:12:00 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 131 (-88%) 💚 228 🔴 (-85%) 💚 331 🔴 (-79%) 💚 1309 🔴 (-25%) 💚 30
TTFS stream 143 (-44%) 💚 211 🔴 (-86%) 💚 227 (-85%) 💚 328 (-81%) 💚 30
TTFS hook + stream 284 (-71%) 💚 387 🔴 (-79%) 💚 433 🔴 (-77%) 💚 605 🔴 (-70%) 💚 30
Fan-out TTFS Promise.all(100 steps) 307 (-16%) 💚 1455 (+107%) 🔻 1587 (-19%) 💚 1611 (-22%) 💚 10
Fan-out TTLS Promise.all(100 steps) 1053 (-21%) 💚 4299 (+12%) 4702 (+2.9%) 4973 (-2.0%) 10
STSO 1020 steps (inline) 62 (-14%) 104 (-20%) 💚 122 (-20%) 💚 186 (-7.9%) 1019
WO 1020 steps 105460 (-18%) 💚 105460 (-18%) 💚 105460 (-18%) 💚 105460 (-18%) 💚 1

c1ef5ff

Mon, 16 Nov 2026 22:10:53 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1514 (+14%) 2113 🔴 (+45%) 🔻 2155 🔴 (+42%) 🔻 2225 🔴 (+41%) 🔻 30
TTFS stream 1739 (+86%) 🔻 1838 🔴 (+29%) 🔻 2046 🔴 (+38%) 🔻 2133 🔴 (+38%) 🔻 30
TTFS hook + stream 1966 (+31%) 🔻 2030 🔴 (+22%) 🔻 2046 🔴 (+21%) 🔻 2256 🔴 (+3.4%) 30
Fan-out TTFS Promise.all(100 steps) 318 (-4.5%) 626 (+10%) 2110 (+180%) 🔻 2130 (+27%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 1051 (-42%) 💚 4102 (+2.1%) 5498 (+30%) 🔻 7160 (+39%) 🔻 10
STSO 1020 steps (inline) 79 (-2.5%) 94 (-16%) 💚 111 (-17%) 💚 146 (-42%) 💚 1019
WO 1020 steps 95481 (-16%) 💚 95481 (-16%) 💚 95481 (-16%) 💚 95481 (-16%) 💚 1

79b262f

Mon, 16 Nov 2026 21:27:31 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1785 (+89%) 🔻 1911 🔴 (+28%) 🔻 2127 🔴 (+38%) 🔻 2331 🔴 (+15%) 30
TTFS stream 1766 (+648%) 🔻 2053 🔴 (+41%) 🔻 2072 🔴 (+39%) 🔻 2156 🔴 (+36%) 🔻 30
TTFS hook + stream 2014 (+38%) 🔻 2274 🔴 (+44%) 🔻 2327 🔴 (+39%) 🔻 2489 🔴 (+42%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 299 (-12%) 535 (+2.7%) 536 (-16%) 💚 2173 (+42%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 996 (+23%) 🔻 3834 (-2.4%) 3983 (-4.9%) 7114 (+25%) 🔻 10
STSO 1020 steps (inline) 74 (-6.3%) 100 (±0%) 119 (+1.7%) 169 (-4.0%) 1019
WO 1020 steps 100771 (+1.3%) 100771 (+1.3%) 100771 (+1.3%) 100771 (+1.3%) 1
ℹ️ Metric definitions & methodology

The collapsed STSO distribution section above buckets every step gap, split inline (same warm process — pure framework overhead) vs queue-hop (fresh process — dispatch, reinit, replay). █ = main, ┃ = this run, ░ = fill.

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) · Fan-out TTFS: fan-out time to first step (in-deployment start() → first of the parallel step bodies to complete) · Fan-out TTLS: fan-out time to last step (in-deployment start() → last of the parallel step bodies to complete, i.e. when the Promise.all resolves) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored)

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 · Promise.all(100 steps): 100 trivial no-op steps started together in a single Promise.all; Fan-out TTFS is the first of them to complete and Fan-out TTLS the last, both from the in-deployment clientStart, so their gap is the spread the runtime adds across the fan-out

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600

All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = start() → first step body (includes dispatch + any cold start); Fan-out TTFS/TTLS = first/last step completion of one Promise.all from the same anchor (the gap is the runtime’s fan-out spread); STSO/WO between step bodies. Streaming delivery performance is measured in durabench.

Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 The run produced no summary — see the job log.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

No measurements were produced. See the run log.

Comment on lines +772 to +781
const name = names.allocate(base);
const refText = closure.getText(sf);
keptRanges.push([closure.getStart(sf), closure.end]);
lifted.push(() =>
stepFunction(
name,
'',
`${indentUnit}return ${refText}()${semi}`,
'',
limit

@vercel vercel Bot Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Passing a function reference to step.do() drops its context argument, so callbacks reading ctx.attempt or ctx.step.name fail after migration.

Fix on Vercel

Comment on lines +1203 to +1214
`${I}${I}${I}${I}if (result === timedOut) {\n` +
`${I}${I}${I}${I}${I}throw new Error(\`WorkflowTimeoutError: Execution timed out after \${timeoutMs}ms\`)${semi}\n` +
`${I}${I}${I}${I}}\n` +
`${I}${I}${I}${I}pending = undefined${semi}\n` +
`${I}${I}${I}${I}const next = result${t(` as IteratorResult<${event}>`)}${semi}\n` +
`${I}${I}${I}${I}if (next.done) throw new Error('The event hook closed')${semi}\n` +
`${I}${I}${I}${I}if (next.value.type === type) return next.value${t(' as { type: string; payload: T; timestamp: Date }')}${semi}\n` +
`${I}${I}${I}${I}early.push(next.value)${semi}\n` +
`${I}${I}${I}}\n` +
`${I}${I}},\n` +
`${I}}${semi}\n` +
'}'

@vercel vercel Bot Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Parallel step.waitForEvent() calls share the same pending iterator result, allowing one event to satisfy multiple waits or be buffered multiple times.

Fix on Vercel

Comment on lines +1659 to +1667
const name = ts.isIdentifier(callee)
? callee.text
: ts.isPropertyAccessExpression(callee)
? callee.name.text
: '';
if (
(name === 'proxyActivities' || name === 'proxyLocalActivities') &&
call.typeArguments?.[0]
) {

@vercel vercel Bot Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aliasing proxyActivities or proxyLocalActivities causes the codemod to replace the proxy with direct imports without converting the activities into steps.

Fix on Vercel

@karthikscale3 karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Find: Reviewed and tested this revision with real source-provider execution and fresh CLI migrations. Built the CLI/SDK and a standalone Nitro app from the generated code; all 378 CLI tests and 22 selected committed runtime tests passed. Ran 24 source-vs-migrated comparisons using Temporal 1.25.0 / Temporal CLI 1.10.1 and Wrangler 4.162.0, plus dedicated child-lifecycle and timer-summary checks. Confirmed five additional issues inline. The already-documented Cloudflare fatal-error message difference is excluded from these findings. The three existing inline findings were also not duplicated.

`${I}handle${t('<Args extends unknown[]>')}(hook${t(`: ${hookType}<Args>`)}, handler${t(': (...args: Args) => unknown')})${t(': void')} {`,
`${I}${I}void (async () => {`,
`${I}${I}${I}for await (const args of hook) {`,
`${I}${I}${I}${I}await handler(...args)${s}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Find: [P1] Preserve asynchronous signal-handler concurrency

Awaiting the handler before consuming the next signal changes Temporal's async-handler semantics and can deadlock otherwise valid workflows. I ran setHandler(arrive, async () => { count++; await condition(() => count >= 2); }) with a main condition(() => count >= 2, '2 seconds') and sent two arrive signals. Temporal 1.25.0 returned { completed: true, count: 2 }; the fresh codemod output, typechecked and built with Nitro against Local World, returned { completed: false, count: 1 }. The first handler prevents the second signal from being read, and condition waiters are only notified after that handler completes. Preserve this behavior or leave async handlers as explicit TODOs; this migration currently reports zero TODOs.

const options = workflowId
? `, { experimental_hook: { token: ${kit.render(workflowId)} } }`
: '';
const started = `${start}(${kit.render(target)}, ${argsText}${options})`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Find: [P2] Account for Temporal's default parent-close policy

startChild() defaults to terminating its child when the parent closes, whereas this ordinary start() leaves the child running. I tested a parent that awaits startChild(slowChild, { args: [], workflowId: childId }) and immediately returns, with the child sleeping for two seconds. The real Temporal server reported the child as TERMINATED; the generated SDK workflow let it finish as completed with its return value. This also allows child side effects to continue after a parent fails. The codemod reports zero TODOs because there is no explicit option to drop. Preserve the default/explicit parent-close policy or mark this lifecycle change for manual migration.

);
const kind = context.bindings.get(name);
if (context.vars.has(name) && inStep) {
replace(node, () => `process.env.${name}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Find: [P2] Preserve the types of non-string Wrangler vars

Wrangler vars can contain booleans, numbers, and JSON objects, but every var is rewritten to the string-valued process.env without conversion or a TODO. With vars: { ENABLED: false, COUNT: 7 }, I ran a step returning { enabled: Boolean(this.env.ENABLED), countType: typeof this.env.COUNT }: Wrangler 4.162.0 returned { enabled: false, countType: 'number' }, while the typechecked, Nitro-built migrated app with ENABLED=false COUNT=7 returned { enabled: true, countType: 'string' }. Boolean feature flags can therefore silently switch on. Retain var type/value information when reading the config and either decode non-string values appropriately or flag them for manual conversion.

for (const w of context.workflows) {
const target = byClass.get(w.className);
out.push(
`| \`${w.binding}\` | \`${w.className}\` | ${target ? `\`${target.workflow}\` in \`${target.file}\`` : 'not migrated'} | ${target ? `\`workflowInstances('${target.workflow}', ${target.workflow})\`` : '-'} |`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Find: [P2] Keep the configured workflow name in the adapter event

The suggested adapter call uses the class/function name even though readWranglerConfig() already records the configured workflow name. The adapter assigns that argument to event.workflowName, changing source behavior whenever the configured name differs from the class name. In a live comparison, a step returning event.workflowName returned 'source-nameworkflow' under Wrangler and 'NameWorkflow' after following this report's workflowInstances('NameWorkflow', NameWorkflow) instruction. Both runs completed and migration reported zero TODOs. Carry the original configured name into the event, keeping the generated inbox token namespace consistent (or separating the two names).

case 'sleep': {
const sleep = kit.use('workflow', 'sleep');
kit.replace(call.expression, sleep);
if (call.arguments.length > 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Find: [P2] Remove timer options from the rewritten sleep call

This branch reports that timer-summary options were dropped, but only the callee is replaced, so the second argument remains. await sleep('1 millisecond', { summary: 'review timer' }) typechecks and runs with Temporal 1.25.0; after the actual CLI migration, it becomes the same two-argument call imported from workflow, and TypeScript fails with TS2554: Expected 1 arguments, but got 2. The command still reports zero TODOs. Remove the unsupported options argument when rewriting the call so a valid source project remains buildable.

vercel Bot and others added 2 commits November 16, 2026 22:01
…rkflow SDK across the migration guides

- Workflow SDK has no continue-as-new by design: run limits are far
  higher, and on the QuickJS engine snapshotting keeps resumes fast and
  exempts a run from the default event limit, so long loops stay one run.
  Say so in the Temporal guide (new section), the AWS, Cloudflare, Inngest,
  trigger.dev and AgentCore limits paragraphs, the comparisons index, the
  Durable Objects guide's long-lived entities, the versioning page and the
  skill. A successor run is only for moving onto newer code. The Temporal
  codemod's continueAsNew and continueAsNewSuggested TODOs say the same.
- Schedules: point cron triggers at Vercel Schedules with an executionId
  start token in the Temporal, AWS, Cloudflare and trigger.dev guides and
  skill references and the scheduling cookbook. The Cloudflare codemod
  marks scheduled() handlers and reports wrangler Cron Triggers; the
  Temporal codemod reports client.schedule.create().
- Flow control: the Inngest guide's callout and the trigger.dev and
  Temporal guides map concurrency, rate limits and throttling to start
  tokens and RetryableError, linking the Inngest flow-control section.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
@vercel-internal-security-reviewer

Copy link
Copy Markdown

Security review details

vercel Bot and others added 2 commits November 17, 2026 16:04
…; say why the codemods lift steps anyway

A "use step" function declared inside a workflow reads the workflow's
variables: the compiler hoists it and records what it captures with the
call. The Inngest and Cloudflare Workflows guides said a step function
only gets its arguments, which is wrong. They now say the codemods lift
steps to module scope because that is the recommended style (testable,
reusable, named in the trace), and that captured values are serialized
like arguments.

- Foundations: a short "Steps defined inside a workflow" section, with
  the rules verified at runtime: captured values must be serializable, are
  copies, and assigning to one fails.
- Skill and codemod comments and messages say the same.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
vercel Bot and others added 2 commits November 17, 2026 18:53
Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Now that a "use step" function expression bound to a variable compiles as a
nested step (#5503), drop the advice to use only arrow functions and
function declarations, and say how each form is named.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

This branch had an error being deployed

1 failed deployment
Preview – workflow-docs — d036bf43 Deployed Nov 17, 2026 by vercel[bot]
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