Repository navigation
Conversation
…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>
🦋 Changeset detectedLatest commit: d036bf4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
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 |
🧪 E2E Test Results✅ All tests passed E2E Test SummarySummary
Details by Category✅ ▲ Vercel Production
✅ 🪟 Windows
✅ dynamic-runs
✅ vercel-http-transport
✅ vercel-multi-region
✅ vercel-queue-hold
✅ vercel-spec9
✅ vercel-ws-transport
|
📊 Workflow Benchmarkscommit Backend:
📈 STSO distribution vs main (inline / queue-hop histograms)1020 steps (inline) Cumulative STSO time: main 112515ms → this run 106772ms (Δ -5743ms, -5%) 📜 Previous results (3)7c9d080Tue, 17 Nov 2026 16:12:00 GMT · run logs
c1ef5ffMon, 16 Nov 2026 22:10:53 GMT · run logs
79b262fMon, 16 Nov 2026 21:27:31 GMT · run logs
ℹ️ Metric definitions & methodologyThe 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). Best/P75/P90/P99 deltas compare against the most recent benchmark run on 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 = Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor. |
Sim WorldSimulated world deterministic testing for races. Traces 🟠 The run produced no summary — see the job log. |
|
No measurements were produced. See the run log. |
| 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 |
| `${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` + | ||
| '}' |
| const name = ts.isIdentifier(callee) | ||
| ? callee.text | ||
| : ts.isPropertyAccessExpression(callee) | ||
| ? callee.name.text | ||
| : ''; | ||
| if ( | ||
| (name === 'proxyActivities' || name === 'proxyLocalActivities') && | ||
| call.typeArguments?.[0] | ||
| ) { |
karthikscale3
left a comment
There was a problem hiding this comment.
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}`, |
There was a problem hiding this comment.
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})`; |
There was a problem hiding this comment.
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}`); |
There was a problem hiding this comment.
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})\`` : '-'} |` |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
…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>
…; 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>
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>
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)tsconfig, the TypeScript passes, annotation validation and refusing unparseable output now live inlib/migrate/project.tsbehind a smallMigrationFrameworkinterface. Each codemod supplies its own detection, transform and report. The report's function ID becomessourceId; the Inngest changeset hasn't been released, so nothing published changes.workflow migrate temporal"use workflow".proxyActivities()becomes a direct import, and the activities become"use step"functions in their own module.retry.maximumAttemptsbecomesmaxRetries = n - 1, and an activity with no limit gets a TODO, since Temporal retries without limit while the Workflow SDK default is 3.${runId}:<name>, so a signal sent early still waits. A small helper runs the originalsetHandlercallbacks in order and re-checkscondition()after each one.sleep, child workflows (tostart()plusrun.returnValue),workflowInfo,uuid4,patched,logandApplicationFailure.continueAsNewand cancellation scopes.workflow migrate cloudflare-workflowsWorkflowEntrypointclass becomes a"use workflow"function of the same name.step.do()callback becomes a"use step"function taking the variables it captured.retries.limit(default 5) becomes an explicitmaxRetrieson every step.step.waitForEvent()reads events, including those sent before the wait, from the run's start Hook, with Cloudflare's timeout error and default timeout.workflowInstances()adapter forenv.MY_WORKFLOW(create,get,status,sendEvent,terminate).workflow migrate inngest: fixes the last two review findings on [cli] Addworkflow migrate inngestcodemod; refresh migration guides and skill for v5 #5317. Aconstoptions 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
@temporalio/*1.25.0, Temporal CLI 1.10.1 dev serverwrangler dev)orderEmptyendserroredon both, with Cloudflare's genericWorkflowFatalErrormessage versus the step's own message (documented)inngest@4.26.2andinngest@3.54.2,inngest-cli dev1.51.0Docs 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:
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 temporalandcloudflare-workflowssections.Comparisons index: a Durable Objects row and card.
migrating-to-workflow-sdkskill, 0.5.0: newcloudflare-workflowsandcloudflare-durable-objectsreferences, an updatedtemporalreference, and intake and checklist entries for all three.Flow control, schedules and continue-as-new across the guides
continueAsNew()andcontinueAsNewSuggestedTODOs say the same.start()with the occurrence'sexecutionIdas a start token. This is in the Temporal, AWS, Cloudflare and Trigger.dev guides, their skill references, and the scheduling cookbook. The Cloudflare codemod marksscheduled()handlers and reports wrangler Cron Triggers, and the Temporal codemod reportsclient.schedule.create().RetryableError, linking the Inngest flow-control section.Inline
"use step"closuresThe 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:
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