Commit Graph

1208 Commits

Author SHA1 Message Date
Pranay Prakash e295bae417 feat: allow start() to be called directly inside workflow functions (#1491)
* feat: allow start() to be called directly inside workflow functions

Add 'use step' to start() so it can be called directly from workflow
code. The SWC compiler strips the function body in workflow mode and
replaces it with a step proxy. When called from a workflow:

1. The workflow function reference is serialized via WorkflowFunction
   reducer (serializes { workflowId })
2. start() executes in the step context with full Node.js access
3. The returned Run is serialized via WORKFLOW_SERIALIZE and deserialized
   back in the workflow VM
4. Run getters (.status, .returnValue, etc.) are 'use step' getters
   that each execute as separate steps

Also re-exports start from @workflow/core/runtime/start in api-workflow.ts
instead of using a throwing stub, adds e2e tests for startFromWorkflow
(with hook communication) and fibonacciWorkflow (recursive composition).

* fix(next): don't copy package step files in deferred builder to avoid duplicate classes

Files belonging to packages (detected by walking up to find a
package.json with a name field) are imported via relative path
instead of being copied to __workflow_step_files__/. Copying creates
a second module instance which breaks JS native private field (#)
brand checks when the runtime creates instances from one copy and
the step handler accesses fields from the other.

* fix(next): only skip copying package files that are serde classes, not all package step files

Regular package step files (like fetch) must still be copied to ensure
the SWC loader registers them. Only serde class files from packages are
excluded from copying since those define classes with JS native private
fields (#) that break when duplicated.

* fix(next): generate thin wrappers for package serde step files instead of full copies

For package files that define serde classes (like Run), generate a thin
wrapper that imports the original class and registers steps/classes from
the manifest. This avoids duplicating the class definition (which breaks
JS native private field brand checks) while still registering all step
functions and the class in the serialization registry.

Regular package step files (like fetch) are still copied as before.

* fix(next): use forceStepModeFiles to transform package serde files in step mode

Instead of copying package serde+step files (which creates duplicate
classes with #private brand check issues) or generating fragile wrappers,
add the original file paths to a shared forceStepModeFiles set. The
loader checks this set and transforms those files in step mode directly,
so the SWC plugin generates proper step registrations on the original
class — no duplication, no reimplemented registration logic.

* fix(next): use step mode for all files with step/serde patterns, not just copies

The loader now selects step mode for any file that has 'use step'
directives or serde patterns, regardless of whether it's a deferred
step copy. Step mode is a superset of client mode — the only addition
is step registry IIFEs, which are harmless for non-step consumers.

This means package serde+step files (like Run) no longer need to be
copied to get step registrations. They're imported directly in the
step route and the loader transforms the original file in step mode.
One class instance, no duplication, no wrapper generation.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2026-04-17 07:40:25 -07:00
Nishant Singh 3f6d98f3f0 [ai] Align toolsToModelTools with core AI SDK's prepareToolsAndToolChoice (#1544) 2026-04-17 07:38:29 -07:00
Nathan Rajlich a12c0e8511 ci: bump opencode model to claude-opus-4.7 in backport workflow (#1795) 2026-04-17 07:17:36 -07:00
Peter Wielander 71d594c5dd [ci] Skip community world E2E tests on main (#1783) 2026-04-16 18:34:18 -07:00
Nathan Rajlich 5e0a0c7ab0 Prefer stable version for docs app conflicts in backport workflow (#1791)
* Prefer stable version for docs app conflicts in backport workflow

After #1786 restored a minimal Next.js placeholder docs app on stable,
docs app conflicts should resolve to the stable branch version rather
than being deleted. Only docs/content/ is actively maintained on stable,
so conflicts there should still be resolved normally.

Update both the auto-resolution logic in backport.yml and the AI prompt
to reflect the new policy, and update AGENTS.md to match.

* Use git show :2:$file to detect ours-side presence in conflicts

git ls-files --error-unmatch succeeds for unmerged paths even when
the file only exists on the incoming (theirs) side, which would then
fail on git checkout --ours. Use git show :2:$file to specifically
check for a stage-2 entry, which indicates the file exists on the
ours (stable) side.
2026-04-16 18:23:17 -07:00
Nathan Rajlich 69af0c1374 ci: upgrade pnpm/action-setup to v5 and read version from package.json (#1785)
* ci: upgrade pnpm/action-setup to v6 and read version from package.json

Removes hardcoded pnpm version (10.14.0) from all workflows and instead
reads the version from the packageManager field in package.json, so CI
stays in sync with the version used locally.

* ci: update setup-workflow-dev composite action to use pnpm/action-setup@v6

Also removes the pnpm-version input since the action now reads the
version from package.json#packageManager.

* ci: downgrade pnpm/action-setup to v5

v6 installs pnpm 11 RC/beta, which has a regression
(pnpm/pnpm#11264, pnpm/action-setup#225/#227/#228) that causes
'ERR_PNPM_BROKEN_LOCKFILE: expected a single document in the stream'
when the project's packageManager pins a 10.x pnpm version. v5 is the
latest stable release before v6 and supports reading the version from
package.json#packageManager.
2026-04-17 01:17:27 +00:00
Nathan Rajlich 417c4930be refactor(swc-plugin): remove client transform mode, merge into step mode (#1686)
* refactor(swc-plugin): remove client transform mode, merge into step mode

Remove the `client` transform mode from the SWC compiler plugin. The
`client` and `step` modes were nearly identical — both preserved step
function bodies, replaced workflow bodies with throw stubs, and emitted
the same JSON manifest. Step mode now absorbs all client-mode behaviors:

- Dead code elimination (previously only workflow + client)
- Hoisted variable references for object property steps
- All integrations use mode: 'step' instead of 'client'

BREAKING CHANGE: The `client` value for the SWC plugin `mode` option is
no longer accepted. Use `step` instead.

* fix(nitro): force-inline workflow packages in dev mode for serde classId registration

In dev mode, Nitro's Rollup externalizes npm packages like @workflow/core,
so the SWC transform plugin never processes files like run.js. This means
serde classes (e.g. Run) never get the classId registration IIFE, causing
serialization failures when step functions return Run instances.

Uses a Rollup resolveId hook to force workflow SDK packages to be bundled
(non-external) while leaving all other dependencies external. This is more
targeted than noExternals=true which bundles everything and causes TDZ
errors from circular imports in packages like vue-bundle-renderer/h3.

The Nitro module now also ignores .nitro/workflow/** in watchOptions so
writing generated workflow bundles does not retrigger Nitro's own dev
bundle rebuild loop.

Also wraps dev:reload workflow rebuilds and makes LocalBuilder.build()
atomic (writes to temp files, renames on success) to avoid partial output
state during HMR.

For Nuxt, also configures Vite's ssr.noExternal to bundle workflow
packages in the SSR context.

* fix(nitro,nuxt): address review feedback on dev-mode classId fix

- nitro builders: use crypto.randomUUID() for temp file suffix instead of
  Date.now() to avoid collisions under rapid/concurrent build() calls,
  and serialize concurrent build() calls through an internal queue so
  two overlapping dev rebuilds cannot clobber each other's temp outputs.

- nitro index: use fileURLToPath() to convert file:// URLs to filesystem
  paths, which correctly handles Windows paths (file:///C:/... -> C:\...)
  and percent-decoding, instead of relying on new URL(...).pathname.

- nuxt module: normalize vite.ssr.noExternal to an array (preserving any
  existing string/RegExp/array entry) before appending workflow package
  matchers, so the force-bundle behavior is not a no-op when noExternal
  is already set to a non-array value.
2026-04-16 22:50:46 +00:00
John Lindquist cda0b12eed docs(migration-guides): audit and fix accuracy across four source frameworks (#1779)
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-04-16 22:44:20 +00:00
workflow-devkit-release-bot[bot] 5714c2335a Version Packages (beta) (#1711) workflow@5.0.0-beta.2 2026-04-16 15:34:32 -07:00
Nathan Rajlich b7d6595c25 fix false-positive unconsumed event in hook loop replay (#1778) 2026-04-16 15:05:27 -07:00
Nathan Rajlich b5a723932b Improve backport workflow: auto-resolve docs and lockfile conflicts, add DCO signoff (#1770)
* Auto-resolve docs/ and pnpm-lock.yaml conflicts in backport workflow

The docs/ directory is not maintained on the stable branch. When cherry-picking
from main to stable, any conflicts in docs/ files are now auto-resolved by
deleting them. Lockfile conflicts are resolved by re-running pnpm install.
If these resolve all conflicts, the cherry-pick pushes directly to stable
without needing AI resolution or a separate PR.

* Add --signoff to cherry-pick to pass DCO check

* Preserve docs/content/ in backport conflict resolution

The docs/content/ directory is kept on stable because the markdown
files are bundled into npm packages via prepack scripts. Update the
conflict auto-resolution to only delete docs app files (outside of
docs/content/), and update AGENTS.md accordingly.

* Address review: setup pnpm before cherry-pick, fix grep pipefail, guard lockfile resolution

- Move pnpm/node setup before the cherry-pick step so pnpm install
  is available during conflict resolution
- Add || true to the docs grep pipeline to prevent pipefail exit
  when there are no non-content docs conflicts
- Only run pnpm install for lockfile conflicts when no other
  conflicts remain, to avoid choking on conflict markers

* Let pnpm resolve lockfile conflicts natively

* Remove redundant Setup Node.js step for opencode path

Node.js is now set up unconditionally at the start of the job for
the cherry-pick step's pnpm install, so the conditional setup for
the opencode path is redundant.
2026-04-16 14:15:13 -07:00
Nathan Rajlich 136bd35a98 fix(swc-plugin): preserve step function names in stack traces after bundler minification (#1743)
* fix(swc-plugin): preserve step function names in stack traces after bundler minification

Add Object.defineProperty(fn, 'name', { value, configurable: true }) to the
IIFE step registration so the original function name survives bundler name
mangling (e.g. Turbopack renaming errorStepFn to eD). V8 uses the .name
property for stack traces, so this ensures 'at errorStepFn (...)' appears
instead of 'at eD (...)'.

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Nathan Rajlich <n@n8.io>

---------

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-16 20:20:26 +00:00
Pranay Prakash f102ed925d Add Python SDK beta documentation page (#1775)
* feat: add Python SVG icon and related documentation

Slack-Thread: https://vercel.slack.com/archives/C0AG7R4PU22/p1776354109663229?thread_ts=1776354109.663229&cid=C0AG7R4PU22
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>

* feat: reintroduce Python SDK card in getting-started guide

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

* feat: add beta badge to Python SDK documentation sidebar item

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

* feat: enhance sidebar item with badge and layout update

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

* feat: refactor sidebar item badges to use array and function for mapping

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

* feat: add Python getting started guide card in beta

Added a new card for the Python getting started guide with a beta badge.

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

* feat: simplify description of Workflow Python SDK

Updated the description for clarity and conciseness.

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

* feat: enhance Python SDK documentation and examples

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

* fix: update Python SDK documentation link for language parameter

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

---------

Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
2026-04-16 09:58:10 -07:00
Peter Wielander 340c085681 [world-vercel] Use stream close control frame to decide whether to reconnect to stream (#1742) 2026-04-16 09:52:44 -07:00
Karthik Kalyan 40fe57fa75 fix sitemap (#1773) 2026-04-16 08:52:55 -07:00
Pranay Prakash f41fb74d38 docs: remove experimental labeling from workflow ai api refs (#1774) 2026-04-16 08:51:48 -07:00
Karthik Kalyan bcf818c2c7 disable minification for web (#1768) 2026-04-16 05:53:29 -07:00
christopherkindl fbdd4e7398 Refine homepage feature grid and templates section (#1745)
* Refine homepage: simplify feature grid, update templates section

Remove "Zero infrastructure management", "Deploy confidently", "No timeout
limits", and "Pay for what you use" sections from the feature grid. Update
the observability section with new copy, larger typography, and CTA buttons
for Vercel and self-hosting. Redesign the templates section with a
side-by-side layout, "All examples" button, and vercel.com/workflow card
images with dark mode support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* Make observability CTA buttons stack vertically on mobile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* Add Vercel section with o11y dashboard, update homepage layout

- Add O11yDashboard SVG component with Vercel dashboard preview
  showing sidebar nav and observability trace visualization
- Add VercelSection with desktop (offset right) and mobile views
- Update "Run anywhere" section with new copy and CTA buttons
- Normalize all grid section buttons to h-10
- Fix mobile padding in UseCases section
- Remove barrel file for vercel-com-visuals, use direct imports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* Make use-case selector inline on mobile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

---------

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 09:34:56 +02:00
Tom Dale 5a4296412f fix(packaging): embed source content in sourcemaps (#1769)
Enable TypeScript inlineSources in the shared package tsconfig so published @workflow packages ship self-contained JavaScript sourcemaps. This fixes Vite and Vitest warnings in downstream repos when sourcemaps point at ../src/*.ts paths that are not published.
2026-04-16 00:21:03 -07:00
Pranay Prakash 5f4d683383 [docs] Fix comment missing closing brace (#1767) 2026-04-15 21:55:01 -07:00
Peter Wielander 11cfb8f3fb [world-local] Cross-process streaming for local dev via polling, enable e2e tests (#1739) 2026-04-15 19:38:00 -07:00
Nathan Rajlich 173756dc4d [docs] Rename workflowdevkit to workflowsdk and useworkflow.dev to workflow-sdk.dev (#1759)
* [docs] Rename workflowdevkit references to workflowsdk

* [docs] Rename useworkflow.dev to workflow-sdk.dev

* [chore] Add changeset for domain rename

* [docs] Revert sitemap rewrite to useworkflow.dev (crawled-sitemap not yet available for new domain)
2026-04-15 18:01:48 -07:00
christopherkindl 6fba441999 [docs] Remove performance section on worlds pages (#1753)
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-04-15 16:40:56 -07:00
Mitul Shah 3d784a5edb Content negation for cookbook route (#1752)
* cookbook md

* Update proxy.ts
2026-04-15 18:55:33 -04:00
Peter Wielander f1dfd6d29e Open Fix PR backport script env variable naming (#1755) 2026-04-15 15:01:39 -07:00
Peter Wielander 0810b75872 [core] Re-try runtime replays that exceed deadline up to three times (#1740) 2026-04-15 14:26:27 -07:00
Mitul Shah c1405fbf08 Fix "Edit this page on GitHub" link path (#1750)
* feat: add redirect rule to strip.md extension from routes

Added a new redirect to remove.md extension from any route.

Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1776281595825439?thread_ts=1776281595.825439&cid=C09125LC4AX
Co-authored-by: Mitul Shah <19615826+mitul-s@users.noreply.github.com>

* feat: update GitHub edit URL path for Geistdocs component

Updated GitHub edit URL to correct directory structure for documentation files.

Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1776281595825439?thread_ts=1776281595.825439&cid=C09125LC4AX
Co-authored-by: Mitul Shah <19615826+mitul-s@users.noreply.github.com>

* Update next.config.ts

* Fix URL path in EditSource component

Signed-off-by: Mitul Shah <mitulxshah@gmail.com>

---------

Signed-off-by: Mitul Shah <mitulxshah@gmail.com>
Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Mitul Shah <19615826+mitul-s@users.noreply.github.com>
2026-04-15 20:49:06 +00:00
John Lindquist ffefbbce01 [docs] Polish migration guides for scanability (#1721)
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-04-15 13:04:22 -07:00
Pranay Prakash 4edf581306 Add workflow runtime detection example to getWorkflowMetadata docs (#1744) 2026-04-15 11:58:30 -07:00
christopherkindl f26db3416f Add command-prompt component to docs (#1733)
* [docs] Add command-prompt component

Port the command-prompt compound component from vercel-marketing for use on the workflow docs/landing page. Replaces geist icon imports with hard-copied SVG fallbacks and uses the local cn() utility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [docs] Replace hero CTA with command-prompt component

Swap the "Get Started" button and inline `npm i workflow` copy block for the
CommandPrompt compound component, matching the vercel.com/workflow hero. Shows
"For humans" / "For agents" tabs with animated copy-to-clipboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [docs] Fix icon alignment and add missing font utilities

- Remove conflicting p-3.5 on copy button (was larger than w-6 h-6 container)
- Use size-8 for the copy button hit target with flex centering
- Remove geist-specific -mt-0.5 hack on check icon
- Add text-label-14-mono and text-label-16-mono utility classes to match
  geist DS typography tokens used by the command-prompt component

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [docs] Fix copy button alignment in command-prompt

- Use size-8 instead of size-6 + p-3.5 for proper icon centering
- Both icon spans use absolute + flex centering
- Remove -mt-0.5 geist-specific hack on check icon
- Nudge copy button 2px right for optical alignment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* DCO Remediation Commit for christopherkindl <53372002+christopherkindl@users.noreply.github.com>

I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 0b74a796be
I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 020900e8a9
I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: f81c2a6ee2
I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 07b771eee9

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

---------

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:49:34 +00:00
Karthik Kalyan eba7df381c [cli] Fix false "data expired" warning in CLI for non-expired runs (#1736)
* fix cli expiredAt check

* fix cli expiredAt check

* fix cli expiredAt check
2026-04-14 19:12:24 -07:00
Nathan Rajlich ac09f40771 feat: add clickable Run reference rendering in observability UI (#1681)
* feat: add clickable Run reference rendering in observability UI

When a serialized Run object appears in step input/output data, it is
now rendered as a clickable purple badge showing the runId. Clicking
navigates to the target run's detail page.

Changes:
- serialization-format.ts: Add RunRef type, isRunRef(), serializedRunToRunRef(),
  and 'Run' entry in observabilityRevivers
- data-inspector.tsx: Add RunRefInline component (purple badge), RunClickContext,
  collapseRefs() to make refs non-expandable in ObjectInspector
- attribute-panel.tsx: Thread onRunClick prop, wrap in RunClickContext.Provider
- entity-detail-panel.tsx: Thread onRunClick prop
- run-trace-view.tsx: Thread onRunClick prop
- workflow-trace-view.tsx: Thread onRunClick prop, reset selected span on run change
- trace-span-construction.ts: Show step name for builtin steps instead of empty string
- hydration.ts: Re-export RunRef types
- run-detail-view.tsx: Add handleRunRefClick that navigates to /run/{targetRunId}

* fix: guard collapseRefs against class instances and memoize result

Only recurse into plain objects (prototype is Object.prototype or null)
to avoid stripping class instances like Date, Error, Map, etc. that
have their own rendering in NodeRenderer. Also memoize the collapsed
result to avoid recomputing on every render.

* fix: detect Run instances in Instance reviver instead of fake Run serde key

The Run class goes through the standard Instance serialization pipeline
(WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE), not a dedicated 'Run' key.
Move the RunRef detection into serializedInstanceToRef() which checks
if the className is 'Run' and the data contains a runId string, then
returns a RunRef instead of a generic ClassInstanceRef.

* fix: use serializedInstanceToRef in web and CLI Instance revivers

Both the web and CLI hydration layers override the observabilityRevivers
Instance handler with their own implementation (for react-inspector
named constructors and CLI inspect.custom respectively), bypassing the
RunRef detection in serializedInstanceToRef. Fix by calling
serializedInstanceToRef first and returning a RunRef when detected.
2026-04-14 21:09:49 +00:00
Peter Wielander c57eeff0ce [web] Support standalone deploy to vercel (#1732) 2026-04-14 12:50:12 -07:00
Nathan Rajlich 886dbc4e40 Use pull_request_target for backport workflow to support fork PRs (#1731)
* Use pull_request_target for backport workflow to support fork PRs

Signed-off-by: Nathan Rajlich <n@n8.io>

* Reduce GITHUB_TOKEN permissions to read-only

Signed-off-by: Nathan Rajlich <n@n8.io>

---------

Signed-off-by: Nathan Rajlich <n@n8.io>
2026-04-14 12:11:40 -07:00
Nathan Rajlich dff030e072 Fix web/web-shared version drift by marking them as fixed in changesets (#1729)
@workflow/web-shared is a devDependency of @workflow/web because it is
bundled into web's build output. This means changesets does not bump
web's version when only web-shared has changes, causing version drift.

Adding both packages to a fixed group ensures they always receive the
same version bump. See https://github.com/changesets/changesets/issues/944
2026-04-14 11:46:20 -07:00
Karthik Kalyan 3eb5034dd8 [web-shared] Enable in-line decryption for data inspector in detail panel (#1722)
* decryption flow for detail panel data inspector

* decryption flow for detail panel data inspector

* update spinner
2026-04-14 09:16:50 -07:00
Seena Z 86ebe9fe9f [ai] Avoid crashing on malformed streamed tool-call input (#1707) 2026-04-14 09:14:11 -07:00
christopherkindl 80595e6463 [home][docs] migrate to new geistdocs facelift (#1666)
* fix: migrate to new facelift

* add: max-w- for footer

* update

* DCO Remediation Commit for christopherkindl <53372002+christopherkindl@users.noreply.github.com>

I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: ba7353f1fc
I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: e83ca813b1
I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 8e69ff0d6b

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* Fix: Mobile menu's "close on route change" useEffect has empty dependency array [], making it a no-op that never fires on actual route changes.


This commit fixes the issue reported at docs/components/geistdocs/mobile-menu.tsx:80

## Bug Analysis

The `MobileMenu` component at `docs/components/geistdocs/mobile-menu.tsx` line 80 has a useEffect intended to close the menu on route changes:

```js
useEffect(() => {
  setShow(false);
}, []);
```

The empty dependency array `[]` means this effect runs exactly once — on initial mount — when `show` is already `false` (its initial state). This is a complete no-op. It never detects or responds to route changes.

**When this manifests:** If a user opens the mobile menu and then navigates via browser back/forward buttons, the menu remains open and `document.body.style.overflow` stays set to `'hidden'`, completely locking page scroll. While clicking the `NavLink` items within the menu closes it via their `onClick={close}` handlers, programmatic/browser-level navigation bypasses those handlers.

**Impact:** Users on mobile who use browser navigation while the menu is open will have a broken experience — the menu stays open overlaying the page and body scroll is locked.

## Fix

Replaced the empty-dependency useEffect with the correct pattern already demonstrated in the sibling `sidebar.tsx` component:

1.  Added `usePathname()` from `next/navigation` to track the current route.
2.  Added a `useRef` to store the previous pathname.
3.  Updated the useEffect to depend on `pathname`, comparing it to the previous value and closing the menu when a change is detected.

This ensures the menu closes on any route change, whether triggered by clicking a link, browser back/forward, or programmatic navigation.


Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: christopherkindl <christopher.kindl@gmail.com>

* fix(docs): use ds-gray-900 token for muted-foreground color

Replace hardcoded oklch values with var(--ds-gray-900) for both light
and dark mode to stay in sync with the design system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): update world component colors to use 900-level tokens

Align icon and badge colors with design system by switching from 500/600
shades to 900-level variants across WorldDetailHero and
WorldTestingPerformance components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): update world page colors and align hero layout with TOC grid

- Align hero quick links with TOC sidebar using matching grid layout
- Add shrink-0 to hero icons for consistent vertical alignment
- Update benchmark bar colors (green for fastest, blue for others)
- Remove extra px-4 padding from hero section

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* polish: /worlds page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* feat(docs): add filterable world cards with section grouping

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): use radix checkbox with SSR placeholder to prevent layout shift

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): use badge tabs for world filters instead of checkboxes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* revert: restore .husky/pre-commit from main

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): improve benchmark history chart UI and API performance

Benchmark history dialog:
- Fix DialogContent accessibility warning (use DialogDescription)
- Fix 2MB unstable_cache error by using in-memory cache for snapshot map
- Add Geist-style underline variant to Tabs component
- Add skeleton loading state matching stat cards + chart layout
- Add Geist shimmer effect to Skeleton component (--ds-gray-100/200 gradient)
- Add --ds-shadow-tooltip token and apply to chart tooltip
- Use design tokens for all chart colors (--ds-blue-800, --ds-green-800, --ds-purple-900)
- Use linear interpolation, solid gridlines (--ds-gray-400), no animations
- Add 10% fill area under single-line charts, hide for multi-line
- Add white ring to chart dots, equidistant x-axis labels
- Stale-while-revalidate client cache for instant mode switching
- Stat cards refactored to use .map() over a data array
- Lock dialog height with min-h to prevent layout shift

API performance:
- Early exit on gh-pages pagination (cap at MAX_ITEMS * 3)
- Use snapshot timestamp for releases (eliminates 30 serial API calls)
- Increase fetch batch size from 10 to 30
- Remove unstable_cache, rely on in-memory + fetch-level caching

Other:
- Add recharts.d.ts type augmentation for React 19 compatibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): add missing geist tokens and utilities from homepage-visuals

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* [DO NOT MERGE][home] Adds vercel-com workflow visuals (#1674)

* add: visualizations

* DCO Remediation Commit for christopherkindl <53372002+christopherkindl@users.noreply.github.com>

I, christopherkindl <53372002+christopherkindl@users.noreply.github.com>, hereby add my Signed-off-by to this commit: eefbc9744a

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix: adjust bar border radius and add @container to feature cards

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix: use rounded-lg for bar border radius, add @container to wide card

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* revert: restore geistdocs.css from main

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

---------

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(docs): add mobile docs bar to cookbook pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): add mobile docs bar to cookbook pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): increase hero section vertical spacing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* chore(docs): remove recharts React 19 type shim

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): hoist useTransform calls to top level of components

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): add optional chaining for world.features access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): log warning when benchmark pagination cap is hit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): make filter badges keyboard accessible

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): clean up setTimeout on unmount in globe path components

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* feat(docs): add full-width frameworks section to homepage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* feat(docs): update navbar logo and add framework logos from geist symbols

- Replace LogoWorkflowSdk with Geist symbols wordmark (LogoWorkflow)
- Add currentColor framework logo icons from geistcn-assets
- Add full-width frameworks section to homepage with colored logos
- TanStack shown as "Coming soon" with analytics tracking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* docs: add comment noting timestamp semantic change in benchmark API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

* fix(docs): move frameworks section after effortless setup on homepage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>

---------

Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 13:36:44 +02:00
Nathan Rajlich 335a7ce6a6 fix(docs): correct API usage in cookbook examples (#1709)
* fix(docs): correct API usage in cookbook examples

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)

* fix(docs): correct serialization claims, imports, and patterns in cookbook

- 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

* fix(docs): add code highlights, remove serde shorthand, fix credential 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
2026-04-14 00:53:17 -07:00
Nathan Rajlich b67f54f1eb fix(docs): remove aspirational workflow-level deduplication pattern (#1705)
The 'Pattern: Workflow-level deduplication' section documented a
start({ id }) API that does not exist. Run IDs are auto-generated
ULIDs and there is no option to specify a custom ID. Remove the
section and related references.
2026-04-14 00:45:42 -07:00
Karthik Kalyan fb8e42dd76 remove secure credential (#1723) 2026-04-13 21:23:44 -07:00
Karthik Kalyan 1df1cb9750 Bump vite (#1719) 2026-04-13 18:21:37 -07:00
Karthik Kalyan df115fde8c [web][web-shared][core] Make encrypted markers clickable and detect encryption before span selection (#1716)
* Make encrypted markers clickable to trigger decryption and detect encryption at run level before span selection

* Make encrypted markers clickable to trigger decryption and detect encryption at run level before span selection

* Make encrypted markers clickable to trigger decryption and detect encryption at run level before span selection

* Make encrypted markers clickable to trigger decryption and detect encryption at run level before span selection

* Make encrypted markers clickable to trigger decryption and detect encryption at run level before span selection
2026-04-13 17:11:58 -07:00
Nathan Rajlich 11b85d0783 Add AI-powered conflict resolution to backport workflow (#1693)
* Add AI-powered conflict resolution to backport workflow

Signed-off-by: Nathan Rajlich <n@n8.io>

* Use anthropic/claude-opus-4.6 model identifier

Signed-off-by: Nathan Rajlich <n@n8.io>

* Address review feedback on AI conflict resolution

Signed-off-by: Nathan Rajlich <n@n8.io>

* Update .github/workflows/backport.yml

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Signed-off-by: Nathan Rajlich <n@n8.io>

* Fix script injection in gh pr create --title

Signed-off-by: Nathan Rajlich <n@n8.io>

---------

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-04-13 22:03:24 +00:00
Karthik Kalyan 3f4870cb6d [docs] Update tweet wall (#1708)
* update tweet wall

* update tweet wall
2026-04-13 13:06:03 -07:00
Nathan Rajlich 1fa6397241 Move swc-playground-wasm into workbench/swc-playground (#1704)
* move swc-playground-wasm into workbench/swc-playground

Move the Rust/WASM source from packages/swc-playground-wasm into
workbench/swc-playground/wasm/ so it is no longer built as part of
the packages/* turbo filter in CI. The WASM build now runs as part
of the playground's own prebuild/dev scripts, avoiding Rust toolchain
failures in unrelated CI jobs.

* fix: ensure default rustup toolchain in wasm build

The Vercel build environment has rustup installed but no default
toolchain configured. Add a check for this and install stable
if needed. Also check for VERCEL env var in addition to CI.

* fix: ensure cargo bin dir is in PATH on Vercel

After cargo install wasm-pack, the binary lives in $CARGO_HOME/bin
which may not be in PATH on the Vercel build environment. Always
add the cargo bin directory to PATH after ensuring the toolchain.
2026-04-13 12:30:30 -07:00
Nathan Rajlich e788e3b41c fix(builders): restore discovery WeakMap cache for dev rebuilds (#1699)
Move `workflow/runtime` resolution from `createStepsBundle` into
`discoverEntries` so callers pass the original `inputFiles` array
reference. This restores the WeakMap cache hit when
`createWorkflowsBundle` and `createStepsBundle` are called with
the same inputFiles, avoiding a redundant second esbuild discovery
pass per build that was causing E2E Local Dev Tests to flake on CI.
2026-04-13 11:54:45 -07:00
Nathan Rajlich fe131105f2 fix(next): resolve next/package.json from working directory first (#1701)
* fix(next): resolve next/package.json from working directory first

In npm workspaces monorepos, `@workflow/next` can be hoisted to the root
`node_modules/` while `next` stays in a workspace's local `node_modules/`.
The eager `require('next/package.json')` on the fallback path resolved
relative to `@workflow/next`'s own location, failing before the correct
working-directory-relative resolution could run.

Restructure `resolveNextVersion()` to try the working directory path first,
fall back to the package-relative path second, and wrap both in separate
try/catch blocks so neither can crash the process.

Closes #1680

* fix(next): capture resolution errors and include workingDir in error message

Address review feedback: capture caught errors from both resolution
attempts and attach them via `cause` on the final thrown error. Include
the working directory in the error message to aid debugging in monorepo
and CI environments.
2026-04-13 17:35:00 +00:00
John Lindquist 41d0d7e39d docs: add workflow migration guides and skill (#1584)
* docs: add workflow migration guides and migration skill

Create migration guides for AWS Step Functions, Inngest, and Temporal under
docs/content/docs/getting-started/. Each guide provides side-by-side code
comparisons and a realistic order-processing saga example.

Add skills/migrating-to-vercel-workflow/ with SKILL.md, reference docs for
each source platform (aws-step-functions, inngest, temporal), shared patterns,
resume routing, runtime targets, and 5 eval scenarios.

Update create-webhook API reference with webhook resume choice clarifications.
Update getting-started meta.json to include migration guide navigation entries.

* In PR #1584 (migration-guides branch), make two changes to the migration guides:

1. Move migration guides to a top-level "Migration Guides" nav section:
   - Create docs/content/docs/migration-guides/ directory
   - Move the 3 migrating-from-*.mdx files from getting-started/ into migration-guides/
   - Create migration-guides/meta.json with title "Migration Guides" listing temporal, inngest, aws-step-functions
   - Add "migration-guides" between "errors" and "api-reference" in docs/content/docs/meta.json
   - Remove the 3 migration entries from getting-started/meta.json

2. Replace all "Vercel Workflow" language with "Workflow SDK" across docs and skills:
   - In all 3 MDX migration guides: replace "Vercel Workflow" with "the Workflow SDK" or "Workflow SDK" in frontmatter, headings, table headers, and body text
   - Replace "shipping on Vercel" with neutral phrasing, "Vercel-managed execution" with "managed execution", "Vercel's infrastructure" with neutral phrasing
   - Replace Vercel-specific pricing paragraphs with generic "Efficient resource usage" bullet
   - Replace "Deploy to Vercel first..." checklist items with neutral deployment guidance
   - Keep vercel-world prerequisite links (real package name)
   - Rename skills/migrating-to-vercel-workflow/ to skills/migrating-to-workflow-sdk/
   - Update all skill SKILL.md, evals/, and references/ files to replace "Vercel Workflow" with "Workflow SDK"
   - Update runtime-targets.md section headers from "Non-Vercel" to "Self-hosted"

* fix type checks

---------

Co-authored-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>
2026-04-12 09:13:49 -07:00
John Lindquist 851a530164 Add cookbook with 50 workflow pattern recipes (#1564)
* Add cookbook section with 50 workflow pattern recipes

Migrate the "Workflow API Explorer" decision tree concept from
workflow-campaign-demos into useworkflow.dev docs as a Cookbook.

Infrastructure:
- docs/lib/cookbook-tree.ts: decision tree data, 50 recipe metadata entries, slug-to-category mapping
- docs/components/geistdocs/cookbook-explorer.tsx: interactive "I want to..." decision tree UI with breadcrumb navigation
- docs/content/docs/cookbook/index.mdx: landing page rendering CookbookExplorer component
- docs/content/docs/cookbook/meta.json + 8 category meta.json files for sidebar nav
- docs/content/docs/meta.json: added cookbook to docs nav between foundations and how-it-works
- docs/app/[lang]/docs/[[...slug]]/page.tsx: registered CookbookExplorer component

50 recipe MDX files across 8 categories (payments, approvals, resilience,
notifications, webhooks, data-processing, routing, observability), each with:
- Frontmatter (title, description, type: guide, summary with use-case scenario)
- Simplified code snippet (core pattern only, stripped of demo UI concerns)
- Full implementation code snippet (exact source from campaign demos)
- Key APIs section with links to API reference docs

* ploop: iteration 1 checkpoint

Automated checkpoint commit.

Ploop-Iter: 1

* fix: polish cookbook public routing

Keep the cookbook surface canonical at /cookbooks so docs navigation, sitemap output, and AI/chat entry points stop leaking the legacy /docs/cookbook paths.

Correct the approval-chain example so the docs teach the intended sequential approval semantics instead of implying the workflow approves after the first successful level. This keeps the cookbook aligned with the docs quality bar and avoids misleading readers with inconsistent behavior.

Ploop-Iter: 2

* docs: canonicalize cookbook doc routes

Align cookbook-facing docs outputs with the new public route so
redirects, sitemap entries, and LLM-facing exports stay consistent.
This keeps the polished cookbook section discoverable at its canonical
location while trimming the last demo-heavy recipe examples toward the
same concise style as the rest of the docs.

Ploop-Iter: 3

* ploop: iteration 4 checkpoint

Automated checkpoint commit.

Ploop-Iter: 4

* fix(docs): finalize cookbook route split

Keep cookbook content discoverable after moving it to a first-class /cookbooks surface so navigation, canonical metadata, and markdown consumers resolve the new public URLs consistently.

Avoid serving the legacy /docs/cookbook tree as if it were still part of the docs section, which reduces duplicate navigation paths and prevents stale static output from competing with the new route structure.

Ploop-Iter: 5

* docs: improve cookbook discovery

The cookbook landing page needs to work for both exploratory users and users who already know the pattern they want. This keeps the guided decision tree while adding shared category metadata and a searchable browse mode so recipe discovery feels faster and more consistent with the rest of the docs experience.

Ploop-Iter: 6

* docs: refine cookbook pattern examples

Tighten the simplified cookbook recipes so the examples teach the intended workflow semantics clearly and consistently. The changes keep the documentation focused on the core control-flow patterns reviewers called out, while removing ambiguity around partial arrivals, deadlines, and first-success behavior.

Ploop-Iter: 7

* docs: decouple cookbook sidebar tree

Separate cookbook navigation from the docs page tree so the standalone /cookbooks experience stays stable after the route move and the main docs sidebar no longer leaks cookbook entries.\n\nThis keeps cookbook navigation driven by explicit recipe metadata, which avoids duplicated section titles and makes the docs and cookbook surfaces easier to evolve independently.\n\nPloop-Iter: 8

* fix(docs): align cookbook public nav

Keep cookbook pages on their public /cookbooks surface so metadata and copied markdown do not leak legacy /docs/cookbook paths.\n\nSimplify sidebar rendering to trust the injected page tree, which avoids route-specific filtering and keeps cookbook navigation consistent with the active layout tree.\n\nPloop-Iter: 9

* refactor(docs): decouple cookbook routing

Move cookbook rendering off the shared docs route so cookbook pages can behave like a first-class docs surface without leaking cookbook-specific UI into the main docs experience.

Centralizing cookbook tree filtering keeps sidebar behavior consistent in one place and avoids duplicate cookbook navigation state across layouts.

Ploop-Iter: 10

* docs: improve cookbook explorer accessibility

Improve the cookbooks entrypoint so loading and keyboard navigation
are usable without visual cues, and keep guided and browse modes
resilient while the route hydrates.

Ploop-Iter: 11

* ploop: iteration 12 checkpoint

Automated checkpoint commit.

Ploop-Iter: 12

* docs: rename cookbooks route to cookbook (singular)

* docs: add 5 cookbook overview design variations

Add getRecipeHref, getRecipesByCategory, and collectSlugs helpers to
cookbook-tree.ts, then create 5 distinct overview page variations at
/cookbook/v1 through /cookbook/v5 for side-by-side comparison:

- v1: Category Grid (zero-JS scannable overview)
- v2: Search-First (real-time filtering with category pills)
- v3: Accordion Catalog (expandable category sections)
- v4: Decision Wizard (step-by-step guided questions)
- v5: Problem-Solution Table (master-detail by scenario)

Also adds .impeccable.md with project design context.

* docs: remove unrelated package.json bumps and generated artifacts

* docs: restructure cookbook from 50 recipes into 27 consolidated pages

Restructure the cookbook based on team meeting feedback, toolbar comments,
mux-ai pattern analysis, and Vercel org code search. Consolidates duplicates,
adds missing patterns, ensures all examples have proper directives and
type-check against the real workflow SDK.

New structure:
- common-patterns/ (9): saga, batching, rate-limiting, fan-out,
  scheduling, idempotency, webhooks, content-router, child-workflows
- agent-patterns/ (5): durable-agent, tool-streaming,
  human-in-the-loop, tool-orchestration, stop-workflow
- integrations/ (3): ai-sdk, sandbox, chat-sdk
- advanced/ (6): serializable-steps, durable-objects,
  isomorphic-packages, secure-credentials, custom-serialization,
  publishing-libraries

All 92 code snippets pass docs-typecheck against real workflow SDK types.
Deleted 8 old category folders. Updated cookbook-tree.ts, explorer, nav.

* docs: add workflow migration guides

Help teams evaluating the GA launch translate existing durable workflow systems into Vercel Workflow without reverse-engineering concept parity from product docs alone.

The guides focus on real migration decisions and concrete TypeScript examples so adoption can be driven by implementation clarity rather than platform marketing.

Ploop-Iter: 1

* ploop: iteration 2 checkpoint

Automated checkpoint commit.

Ploop-Iter: 2

* docs: refine workflow migration guides

Clarify the migration narrative for GA so teams evaluating a move from Temporal, Inngest, or Step Functions get examples that are realistic enough to trust and pricing guidance that matches the current platform model.

The Inngest guide needed a complete order-saga flow so the durable orchestration, compensation, and streaming patterns read as a credible migration target instead of a partial sketch. The pricing language across all three guides also needed to be aligned with current Workflow and Vercel compute billing semantics to avoid creating the wrong cost expectations during evaluation.

Ploop-Iter: 3

* ploop: iteration 1 checkpoint

Automated checkpoint commit.

Ploop-Iter: 1

* docs(skill): refine workflow migration guidance

Clarify migration rules so agents choose the correct resume primitive, keep streaming guidance aligned with runtime behavior, and avoid implying Vercel-managed execution for self-hosted targets.

This reduces avoidable migration mistakes in generated guidance and keeps the skill consistent with the acceptance criteria used to evaluate it.

Ploop-Iter: 2

* ploop: iteration 3 checkpoint

Automated checkpoint commit.

Ploop-Iter: 3

* docs(skills): refine workflow migration guidance

Reduce the migration skill entry point to the decision surface agents need\nso they can select the correct resume pattern without carrying duplicate\nexamples in the initial context.\n\nClarify framework precedence so prompts that explicitly ask for\nframework-agnostic boundaries do not get Hono- or Next-specific route\nshapes, while preserving framework-specific examples when requested.\n\nCentralize canonical resume examples in the shared patterns reference to\nkeep the guidance consistent across migration paths and reduce drift.\n\nPloop-Iter: 4

* docs: add workflow deep-dive references

Add a cohesive set of deep-dive reference articles so the GA launch
has architecture-level documentation grounded in the current SDK
implementation. This gives readers verified explanations of runtime,
replay, streaming, compiler, and cost-model behavior while linking the
series together for easier navigation.

Ploop-Iter: 1

* ploop: iteration 5 checkpoint

Automated checkpoint commit.

Ploop-Iter: 5

* docs: normalize deep-dive related links

Keep the new deep-dive reference pages cross-linked so readers can move between adjacent runtime concepts without depending on older how-it-works pages alone.

This preserves navigational consistency across the GA launch docs set and reduces the chance that architectural explanations drift into isolated pages that are harder to discover and maintain.

Ploop-Iter: 2

* docs(skill): refine workflow migration routing

Tighten the migration guidance so agents choose the correct resume surface and runtime boundary earlier, reducing incorrect mixed patterns in generated migrations.

Add explicit fast paths for self-hosted targets and Step Functions task-token callbacks so the skill stays consistent on callback URL vs deterministic resume decisions.

Ploop-Iter: 6

* docs: refine workflow migration skill guidance

Clarify route selection so the migration skill composes resume, runtime, and app-boundary concerns deterministically. Add a canonical Step Functions self-hosted Hono callback recipe so migrations produce the correct callback-url pattern without mixing incompatible hook surfaces.\n\nPloop-Iter: 7

* docs: checkpoint deep-dive drafts

Preserve the verified GA launch deep-dive drafts in git so the campaign work can continue from a stable checkpoint.

Capture the reviewed documentation progress now to reduce risk of drift between source-backed research and the publishable drafts.

Ploop-Iter: 3

* docs(skills): tighten workflow migration routing

Clarify the migration skill's route-selection rules so generated guidance stays consistent across resume surfaces, runtime targets, and named framework boundaries.

This reduces ambiguous outputs where agents might mix framework syntaxes or invent callback routes for webhook-based flows, which leads to migration guidance that does not match the user's runtime model.

Ploop-Iter: 8

* docs: finalize workflow deep dives

Clarify the runtime mechanics behind the GA deep-dive series so launch content stays aligned with the implementation and existing docs. Tightening these explanations reduces the risk of readers internalizing inaccurate mental models about replay, compilation, and workflow execution.\n\nPloop-Iter: 4

* docs(skills): refine workflow migration routing

Clarify route selection so migrations choose the correct resume surface and app boundary patterns for the target runtime and framework. Strengthen verification guidance to reject invented callback routes in URL-based flows and keep examples aligned with the documented migration rules.

Ploop-Iter: 9

* docs: sync compiler deep-dive runtime details

Align the compiler deep-dive trio with the actual Workflow runtime so launch materials describe the same execution model users rely on. This keeps the GA narrative accurate around deterministic replay, step queue triggers, and runtime bundle responsibilities, reducing the risk of docs teaching an architecture the SDK does not implement.

Ploop-Iter: 5

* docs(skill): tighten workflow migration guidance

Reduce hot-path skill context so migration routing stays easier to select and
verify during activation.

Trimmed examples and converted long invalid samples into concise failure rules
so the skill points agents to on-demand references instead of loading bulky
worked code by default.

Ploop-Iter: 10

* docs: tighten workflow migration guidance

Clarify route-key planning and resume-surface defaults so migration outputs
stay deterministic when prompts underspecify callback behavior.

Strengthen the deep-dive docs to trace runtime handoffs more directly,
which reduces ambiguity about how the compiler split maps to durable
execution behavior.

Ploop-Iter: 11

* docs: refine streaming and cost deep dives

Clarify the operational model behind durable streaming and zero-cost suspension so launch materials stay source-accurate for readers comparing workflow runtimes.

The updates make the workflow-step boundary, persistence path, and queue-driven cost story more explicit, reducing ambiguity around where stream I/O is allowed and why long waits do not consume compute.

Ploop-Iter: 6

* ploop: iteration 12 checkpoint

Automated checkpoint commit.

Ploop-Iter: 12

* docs: tighten deep-dive streaming accuracy

Align the launch deep dives with the current runtime so campaign content does not misstate suspension behavior or streaming backend capabilities.

These edits clarify the distinct resume paths for step suspension versus timed waits and document the backend-specific streaming guarantees now available across local, Vercel, and Postgres worlds, reducing the risk that readers build incorrect mental models from launch materials.

Ploop-Iter: 7

* docs(skills): refine callback resume taxonomy

Clarify when migrations should use deterministic internal resume versus generated callback URLs so skill outputs stay consistent across frameworks and hosting targets. Distinguish default webhook responses from manual-response flows to prevent ambiguous guidance and keep the shared callback references directly inspectable.\n\nPloop-Iter: 13

* docs: refine deep-dive runtime wording

Clarify the runtime semantics behind suspension and durable streaming so the GA launch materials stay aligned with the source of truth.

These edits tighten descriptions around wake-up paths, backend behavior, and stream lifecycle details to reduce ambiguity for readers comparing the docs to the implementation.

Ploop-Iter: 8

* docs: clarify webhook response mode defaults

Clarify when migrations should use the default webhook behavior versus
manual responses so agents make the same callback choice across the
skill entrypoint, shared patterns, and API reference.

This reduces avoidable ambiguity for callback-url prompts and makes the
default 202 behavior explicit unless a prompt requires custom response
semantics.

Ploop-Iter: 14

* docs: align cost model wake-up semantics

Prevent the GA launch materials from teaching an incorrect mental model about how suspended runs wake back up. The updated wording keeps the blog, social, and reference variants anchored to the real runtime paths so readers understand which transitions are queue-delayed, which are step-driven re-enqueues, and why that distinction matters for the cost story.

Ploop-Iter: 9

* ploop: iteration 10 checkpoint

Automated checkpoint commit.

Ploop-Iter: 10

* docs: clarify webhook resume choices

Explain the resume-surface decision points so migration and API guidance steer authors toward the correct webhook or hook pattern for the prompt.

Reduce common callback-routing mistakes early in the docs and skill so agents make fewer wrong assumptions during workflow migrations.

Ploop-Iter: 15

* docs: tighten cost model deep dives

Clarify the cost-model narrative so launch materials make source-verifiable
claims about suspension, wake-up paths, and polling behavior.

This keeps the GA messaging aligned with the runtime's actual control
flow and avoids overclaiming where the implementation has narrower
semantics than the original copy suggested.

Ploop-Iter: 11

* docs(skills): tighten resume routing guidance

Keep the migration skill entrypoint small so agents load the routing contract only when the source actually pauses for external resume. Clarify the public webhook docs around the default callback flow to reduce accidental use of lower-level runtime APIs.\n\nPloop-Iter: 16

* docs: tighten deep-dive runtime claims

Align the launch materials with the current runtime semantics so the
cost-model and execution-model narrative stays defensible against the
actual implementation.

This keeps the GA campaign focused on claims we can support directly from
source, especially around suspension, re-enqueue behavior, and the
difference between orchestration compute and client-side polling helpers.

Ploop-Iter: 12

* docs: correct cost model deep dive claims

Align the cost-model launch content with the runtime's actual suspension and re-entry mechanics so GA messaging does not overstate identical-cost waits or imply residency that the queue-based engine does not have.

This keeps the public explanation consistent with source-backed behavior around timed wake-ups, explicit workflow re-queue after step completion, and the distinction between idle worker residency and boundary I/O.

Ploop-Iter: 13

* chore: remove non-cookbook files from cookbook branch

Remove deep-dive articles, migration guides/skill, vercel-toolbar skill,
workflow-skills test fixtures, and misc artifacts that belong in separate
branches (deep-dives, migration-guides). Revert create-webhook.mdx,
getting-started/meta.json, and code-transform.mdx to main versions.

* docs: address toolbar feedback on cookbook pages

Address Vercel toolbar comments from Nathan Rajlich, Peter Wielander, Pranay Prakash, and Karthik Kalyanaraman on the cookbook branch.

In saga.mdx, remove the unnecessary `if (!(error instanceof FatalError)) throw error;` guard in the catch block — compensations should always unwind regardless of error type. Replace the `while/pop()!()` loop with a cleaner `for...of reverse()` to avoid the non-null assertion.

In ai-sdk.mdx, split the "Using Different Providers" section into two subsections: "Vercel Gateway (string model IDs)" clarifying that all string model IDs route through Gateway, and "Direct Provider Access" showing how to import from provider packages like `@workflow/ai/openai` to bypass Gateway. Change the "Tool Functions as Steps" section to "Tool Functions with Steps" and reword to explain that tool execute functions can optionally include steps via "use step" but don't have to — when they aren't steps, they run in workflow context and can modify workflow state directly.

In sandbox.mdx, rewrite the page to reflect that `@vercel/sandbox` now has first-class Workflow SDK support. Replace all `declare function` stubs and `// TODO` placeholders with real `import { Sandbox } from "@vercel/sandbox"`. Remove the four separate "use step" wrapper functions (provisionSandbox, runCommand, teardownSandbox, saveSandboxSnapshot) and show direct `Sandbox.create()`, `sandbox.runCommand()`, and `sandbox.destroy()` calls in the workflow function since these implicitly run as steps. Simplify the agent tool example to use inline execute functions that call Sandbox methods directly with an `activeSandbox` variable for workflow state.

Across all cookbook files, replace "Workflow DevKit" with "Workflow SDK" (8 instances in 5 files: publishing-libraries.mdx, secure-credentials.mdx, ai-sdk.mdx, chat-sdk.mdx, sandbox.mdx).

* docs: simplify cookbook index to plain MDX listing

Replace the interactive CookbookExplorer (726-line decision tree + browse
component) with a simple MDX page that lists recipes grouped by category
with linked titles and descriptions. Remove v1-v5 design variations and
trim cookbook-tree.ts to sidebar-only metadata.

* fix type checks

---------

Co-authored-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>
2026-04-11 17:40:07 -07:00