Commit Graph

232 Commits

Author SHA1 Message Date
github-actions[bot] 7024b5b00e [world-vercel] Fix deploymentId "latest" resolving against the wrong team (#3844) (#3848)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-27 14:28:28 -07:00
github-actions[bot] 2cf8838f7b Backport #2908: Fix Nitro cleanup for React Router and add setup guides (#2923)
* Fix Nitro cleanup for React Router and add setup guides (#2908)

* fix(nitro): support React Router Vite builds

* refactor(nitro): simplify React Router cleanup

* docs(react-router): specify cleanup version

* fix(nitro): close temporary Vite servers

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

* fix Nitro React Router stable backport

* scope Nitro cleanup to Vite builds

* remove unnecessary esbuild service shutdown

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

---------

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
2026-08-24 15:37:48 -07:00
github-actions[bot] 4c93a5fe45 Backport #2914: Add WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS env var to local world (#2921)
* feat(world-local): add WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS env var (#2914)

The recoverActiveRuns factory option had no environment variable, so
disabling startup re-enqueueing of pending/running runs required a custom
world module via WORKFLOW_TARGET_WORLD. Wire an env fallback
(0/false disables, 1/true enables, explicit factory option wins) and
document it in the worlds configuration reference and local world guide.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>

* Fix: Destructuring a non-existent `clearCache` property from `createStorage()` return causes TS2339 build failure in `packages/world-local/src/index.ts`

This commit fixes the issue reported at packages/world-local/src/index.ts:65

## Bug

At `packages/world-local/src/index.ts:65` the backport introduced:

```ts
const { clearCache: clearStorageCache, ...storage } = createStorage(
  mergedConfig.dataDir,
  tag
);
```

`createStorage` returns `LocalStorage`, defined in `storage/index.ts:13` as:

```ts
export type LocalStorage = Omit<Storage, 'runs'> & { runs: LocalRunsStorage };
```

On the `stable` branch this type has **no** `clearCache` property (a repo-wide grep found no `clearCache` definition anywhere under `packages/world-local/src` — the only match was this destructuring itself). Destructuring a property that doesn't exist on the type triggers:

```
src/index.ts(65,11): error TS2339: Property 'clearCache' does not exist on type 'LocalStorage'
```

Additionally, `clearStorageCache` was never referenced after being bound, so even if the property existed it would be dead code.

**Trigger:** Any `tsc` build/typecheck of the `world-local` package fails deterministically — all 15 deployment builds reported the identical error.

## Fix

The `clearCache` destructuring is unrelated to the intended backport (which is only the `resolveRecoverActiveRuns` env-var fallback). Reverted line 65 to the original form:

```ts
const storage = createStorage(mergedConfig.dataDir, tag);
```

This removes the reference to the non-existent property while preserving the env-var feature, resolving the TS2339 error.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

---------

Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
2026-08-24 15:37:20 -07:00
github-actions[bot] 53fb5bf848 [docs] Reduce noise in changelog files (#2075) (#2219)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 15:32:27 -07:00
github-actions[bot] 5556b4cde5 fix(core): make step-argument serialization failures catchable in workflow code (#3675) (#3687)
* fix(core): make step-argument serialization failures catchable in workflow code

A step whose arguments fail to serialize is now finalized by the
suspension handler as step_created + step_failed (mirroring a step-body
failure) instead of rejecting the whole suspension. The next replay —
forced in-process, since no step message is dispatched for the failed
step — rejects the step's promise with the SerializationError, so a
try/catch around the step call observes it. Uncaught, the error
propagates out of the workflow body and fails the run as a fatal
USER_ERROR immediately, instead of redelivering the orchestrator
message until max deliveries (49/48) as reported in production on v4.

* Serialize the step_failed error with the VM global; one-sentence changeset

Addresses review feedback: dehydrateStepError in
finalizeUnserializableStep now receives suspension.globalThis like every
other dehydration in this file. Error detection is realm-independent, so
the host-created SerializationError serializes identically, but VM-realm
values guest code threw into the cause chain are now detected by the
realm-sensitive reducers.

* Address review: QuickJS engine support, deferred-batch join, drain gate, placeholder marker, telemetry, docs

- QuickJS: dumpPendingOps now catches a step input's serialization
  failure per-op, reframes it as a SerializationError with the same
  framed message as dehydrateStepArguments, and surfaces it on the
  pending op instead of failing the whole collection. The entrypoint's
  dispatchPendingOps finalizes such steps as step_created (placeholder
  input) + step_failed, excludes them from inline claims and queue
  publishes, marks them handled, and raises the requeue signal so the
  failure is observed even when the feed lags — mirroring the node:vm
  engine, so both engines agree: catchable in workflow code, USER_ERROR
  with the framed message when uncaught. Both step-argument e2e tests
  now pass on WORKFLOW_VM=quickjs.
- runtime.ts: the failed-step replay path now joins
  suspensionResult.deferredBatchWork before continuing, so a trailing
  chunk commit or step-message publish rejection propagates instead of
  being swallowed after ack; committed inline claims are documented as
  deliberately handed to owned recovery.
- Terminal drain: finalization is gated on a stepDispatch target. The
  drain caller has no replay to observe a finalization, so a completed
  run no longer gains failed-step rows for an unawaited unserializable
  step — the rethrown error is swallowed by the drain's catch,
  preserving its pre-existing behavior.
- The placeholder input now carries a marker string ('[input
  unavailable: step argument serialization failed]', shared via
  runtime/unserializable-step.ts) so inspect/o11y don't render the
  failed step as a genuine zero-argument call.
- New workflow.steps.failed_serialization span attribute on the
  suspension span, so occurrence is measurable without log search.
- Docs: v5 serialization-failed error page documents where each
  boundary's failure surfaces (catchable step failure vs run failure)
  and the no-retry USER_ERROR semantics; foundations/errors-and-retries
  gains a Serialization Failures section with the try/catch shape.

* Guard the finalization crash window; self-contained docs samples

- A crash or transient failure between finalization's two durable
  writes leaves a lone placeholder step_created, and redelivery then
  dispatches the step through normal crash recovery — previously
  running user code with the placeholder arguments. The placeholder
  now carries a structural flag on the input triple's top level (which
  user code never controls, so no false positives), and the step
  executor checks it after hydration: instead of running the body, it
  throws the intended fatal SerializationError, completing the
  interrupted finalization as step_failed. Applies to both engines
  (they share the placeholder and the executor).
- Regression tests: executor fails a placeholder-input step without
  running the body (and doesn't trip on a genuine argument equal to
  the display marker); handleSuspension rejects for redelivery when
  step_failed can't be written after step_created landed, leaving the
  recoverable placeholder behind; mixed bad-step + large fan-out
  returns the failure set alongside still-pending deferredBatchWork
  whose rejection surfaces — the contract the runtime's failed-step
  join (added previously) relies on.
- Docs: the two new code samples are now self-contained so the docs
  code-sample typecheck passes.

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-20 18:44:04 +00:00
Peter Wielander 30da02423f Backport #3370: [world-vercel] Recover from wedged HTTP/2 events connections (#3375) 2026-08-06 17:44:23 -07:00
Peter Wielander 7fd2e4a4e0 [world-vercel] Backport the optimized HTTP/2 transport to stable (#3233) 2026-07-30 19:59:15 -07:00
github-actions[bot] 332afdee1e docs: fix stale and broken vercel.com links (#2910) (#2911)
Audited every vercel.com link in docs/content (20 unique URLs,
HTTP-validated including anchor fragments):

- project-configuration#regions (2x): the #regions anchor no longer
  exists on that page — content moved to the vercel-json subpage; now
  links project-configuration/vercel-json#regions
- gateway/api-reference/overview (2x): hard 404; the AI Gateway docs
  restructured — 'get an API key' context now points at
  ai-gateway/authentication
- observability/otel-overview (1x): redirects to
  tracing/instrumentation; link the final URL
- docs/workflow and docs/workflow/python (8x): redirect to the plural
  docs/workflows paths; link the final URLs (also drops a redundant
  ?language=py param that the redirect discards)

All other links (queues, queues/pricing + anchors, plans/hobby,
limits, regions, sandbox, workflows/pricing#storage-retention,
cli/project-linking, audit-log, home, help, blog) verified 200 with
live anchors.

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-13 16:58:21 -07:00
github-actions[bot] f927d6933b fix(nitro): use workspaceDir for monorepos (#2713) (#2720)
* fix(nitro): use workspaceDir for monorepos

* test: stabilize Next canary HMR e2e

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-01 20:10:56 +00:00
github-actions[bot] 280a34a403 [ai] Drop orphan UI chunks after negative-index reconnect (#2082) (#2670)
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-06-26 21:38:27 +00:00
github-actions[bot] 3eb7e97677 fix(world-postgres): rename setup command (#2644) (#2651)
Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-25 16:54:42 -07:00
github-actions[bot] 22730357b1 [docs] Document minimum SDK version for using hook.getConflict (#2423) (#2561)
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-22 13:26:22 -07:00
github-actions[bot] c5d14c8a89 Backport #2545: Remove lazy discovery from workflow/next (#2557)
* Remove lazy discovery from workflow/next (#2545)

Signed-off-by: JJ Kasper <jj@jjsweb.site>

* Remove lazy discovery config from Next workbenches

---------

Signed-off-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2026-06-22 20:10:34 +00:00
github-actions[bot] 4c49cc8895 [builders] Fix unicode-escape crash in workflow graph extraction (#2324) (#2541)
Co-authored-by: EfeDurmaz16 <efebarandurmaz05@gmail.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-06-20 12:49:09 -07:00
github-actions[bot] 20a6d73a0a fix(core): make deploymentId 'latest' a no-op in non-Vercel worlds (#2397) (#2464)
* fix(core): make deploymentId 'latest' a no-op in non-Vercel worlds

Previously, start({ deploymentId: 'latest' }) threw a WorkflowRuntimeError
in any World that doesn't implement resolveLatestDeploymentId() (local dev,
Postgres). That meant a workflow which opts into 'latest' on Vercel would
fail outright in local development.

Resolving 'latest' only means something in worlds with atomic, immutable
deployments. In other worlds there is nothing to resolve between, so instead
of throwing we now log a warning and fall back to the current deployment,
making 'latest' an effective no-op there.

- start.ts: warn + fall back to currentDeploymentId instead of throwing
- start.test.ts: replace the "should throw" test with a warn + fallback test
- e2e.test.ts: assert 'latest' completes (no-op) on non-Vercel worlds
- docs: note the no-op behavior in v4 + v5 start.mdx



* fix(core): warn once for deploymentId 'latest' no-op; harden test cleanup

Address PR review:
- Gate the 'latest'-has-no-effect warning behind a once-per-process guard
  (mirrors the warnOnce pattern in constants.ts) so a workflow that hardcodes
  'latest' for Vercel doesn't flood local/Postgres dev logs on every run.
  Exposes _resetLatestNoOpWarnForTests() (@internal) for unit tests.
- start.test.ts: reset the guard in beforeEach and restore spies in afterEach
  via vi.restoreAllMocks() so a throwing assertion can't leak the
  runtimeLogger.warn spy into later tests; drop the manual mockRestore().
- Add a test asserting the warning fires exactly once across repeated
  'latest' starts while every run still falls back to the current deployment.



---------

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 18:54:07 -07:00
github-actions[bot] 3bb5de1669 feat(cli): print run deep links with --url, fix dashboard route (#2467) (#2469)
Add a `--url` flag to `inspect`/`web` that prints a run's observability
dashboard deep link to stdout and exits — no browser, no local server —
so scripts and agents can share a link instead of opening a UI.

Fix the Vercel dashboard URL to the current
`…/workflows/runs/<id>?environment=<env>` route (drop the legacy
`/observability` segment) and respect `--env`. Apply the same route fix
to the e2e helpers, CI aggregation scripts, and the nextjs-turbopack
workbench. Document deep-linking in the workflow skill and observability
docs.

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 18:52:47 -07:00
github-actions[bot] 977a4a29d9 [next] Clarify serverExternalPackages warning (#2417) (#2431) 2026-06-15 19:36:11 +02:00
github-actions[bot] 296b785db0 Replace hook.hasConflict with hook.getConflict() returning the conflicting Run (#2373) (#2382)
* feat: replace hook.hasConflict with hook.getConflict (Promise<Run | null>)

hasConflict's boolean didn't expose WHICH run owns the token, so the
duplicate run couldn't act on the conflict. getConflict resolves with
null once registration commits, or with a Run handle for the conflicting
run — letting the workflow return/log the owner's runId, inspect its
status, await its result, or cancel it and continue, all in code.

The workflow-mode create-hook module exposes the bundle's compiled Run
class (durable step-proxy methods) on a well-known symbol so the host-
side hook consumer can construct the conflicting run inside the VM.
Contexts without the class (plain unit tests) fall back to a { runId }
object, which is also the documented v4 shape (no native Run
serialization in v4).



* fix: never resolve getConflict with a non-Run fallback shape

getConflict's contract is Promise<Run | null>. In the degenerate cases
where a real Run cannot be constructed — a hook_conflict event persisted
by an old world without conflictingRunId, or a context that never loaded
the workflow-mode create-hook module — reject with HookConflictError
instead of resolving with a { runId }-shaped impostor.

Test harnesses now register the Run class on the (VM) globalThis like
real bundles do.



* refactor: make getConflict a method — hook.getConflict()

A property getter that triggers registration/suspension reads as passive
state; a method makes the side effect explicit. Update implementation,
types, tests, e2e workflows, docs, and changeset.



* review: guard Run class registration, fix anchors, clarify changeset

- Only register WORKFLOW_RUN_CLASS when the workflow runtime is present
  (WORKFLOW_CREATE_HOOK installed on globalThis), so host imports of the
  workflow-mode module neither mutate the host global nor expose the
  non-step-proxy host Run.
- Drop #run-idempotency link fragments — that section lands in the
  stacked docs PR (#2011), which restores the anchored links.
- Note in docs that getConflict() rejects with HookConflictError for
  legacy hook_conflict events lacking the owner's run ID.
- Changeset now calls out the hasConflict -> getConflict() replacement.



* refactor: resolve the conflicting Run through the serialization class registry

Replace the bespoke WORKFLOW_RUN_CLASS global with the registry the
serialization pipeline already uses to revive Run instances:

- The SWC plugin already auto-registers the workflow bundle's compiled
  Run in globalThis[workflow-class-registry], but under a path-derived
  classId the host cannot know statically. The workflow-mode create-hook
  module now aliases it under a stable id (class//workflow//Run) via a
  new aliasSerializationClass() helper (a plain registry entry —
  registerSerializationClass cannot be reused since the plugin's IIFE
  already defined the non-configurable classId property).

- createConflictingRun() looks the class up with
  getSerializationClass(RUN_CLASS_ID, ctx.globalThis) and constructs
  through its WORKFLOW_DESERIALIZE hook, exactly as the Instance reviver
  would for a serialized Run crossing from a step into the workflow.

- Because the registry is keyed per-global, no environment guard is
  needed: a stray host-side import registers the host Run on the host
  registry, which is the correct class for that context. The
  WORKFLOW_CREATE_HOOK guard, the ??=, and the WORKFLOW_RUN_CLASS symbol
  are all deleted.

Verified: 1156 core unit tests; compiled workbench bundle contains the
stable alias alongside the plugin's path-derived registration with zero
WORKFLOW_RUN_CLASS references; all 5 hookGetConflict e2e tests pass
against a local nextjs-turbopack dev server, including conflict
resolution reading conflict.status through a durable step.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
2026-06-12 11:11:57 -07:00
github-actions[bot] 0fd1ba5e9f docs: move World SDK and getWorld under workflow/runtime, split out workflow/observability (#2375) (#2379)
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-12 10:49:45 -07:00
github-actions[bot] 3a1a88f6f0 Add hook.hasConflict for early hook conflict detection (#2015) (#2372)
* feat: add hook ready promise

* test: cover hook ready continuation scheduling

* feat: replace hook.ready with hook.hasConflict (Promise<boolean>)

- hook.hasConflict resolves true when the token is owned by another
  active hook, false once registration is committed — no throw, so
  workflows can branch on conflicts early. Awaiting it suspends the
  workflow to commit the hook registration (createHook alone does not).
- Chain the already-created fast-path through promiseQueue so
  resolution order matches event-log order (review feedback).
- Skip inline step execution when a suspension has an awaited hook
  creation so the hasConflict continuation can advance independently
  of step execution (review feedback).
- Update unit tests, e2e tests, workbench workflows, and v4/v5 docs.



* docs: fix inconsistent hasConflict bullet in create-webhook reference

State both resolution values explicitly (true = token already owned,
false = registered) instead of a parenthetical that only described the
false case.

* docs: require docs preview links in PR descriptions for docs changes



* docs: restore SWC Plugin heading in AGENTS.md



---------

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
2026-06-11 15:49:57 -07:00
github-actions[bot] 4763e06eb7 [docs] Add "Step executed multiple times" error page (#2310) (#2333)
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-06-11 11:32:30 +02:00
Peter Wielander 73975ada17 [core] Move stream reconnect logic to getReadable level (#1847) 2026-06-11 10:35:34 +02:00
github-actions[bot] 326d93a4ae Backport #2012: Expose conflicting run id on hook conflicts (#2016)
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Peter Wielander <peter.wielander@vercel.com>
2026-06-10 17:06:26 +02:00
github-actions[bot] b385a2d6eb [backport] classify SDK encryption failures as RUNTIME_ERROR (#2145) (#2165)
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-06-02 12:49:01 +02:00
Pranay Prakash 5fd7d9c2a1 Retry replay divergence before failing event logs (#2208) 2026-06-01 23:24:35 +00:00
Nathan Rajlich cab9a5334f docs(stable): update docs/README and docs-checks comment for tarballs move (#2094)
Per-deployment SDK tarballs are now built by the tarballs/ app, not by
docs/. Remove the outdated reference to docs/scripts/pack.ts (which no
longer exists) and point readers at tarballs/README.md.
2026-05-22 11:58:29 -07:00
github-actions[bot] c3f3a756f9 Add workflow versioning docs (#2010) (#2014)
* Add workflow versioning docs

* Link cookbook patterns to versioning docs

* Align v5 start docs with native workflow support

* Address versioning docs review feedback

* Address versioning preview comment

* Address versioning toolbar feedback

* Cross-link versioning docs

* Address latest versioning toolbar feedback

* Rename versioning self-upgrade section

* Address versioning PR review comments

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-18 16:53:15 -07:00
github-actions[bot] a5e82e5661 docs(ai): update durable agents guide to use ToolLoopAgent (#1975) (#1990)
The AI SDK renamed `Experimental_Agent` to `ToolLoopAgent`. Update the
"Building Durable AI Agents" page's API route snippet (v4 and v5) so it
matches the current AI SDK API.

Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 15:31:46 -07:00
github-actions[bot] 76352f0b66 [codex] Fix detached ArrayBuffer proxy DX (#1985) (#1998)
* fix(world-local): explain detached ArrayBuffer proxy failures

* fix(docs): make proxy handler anchor navigable

* fix(docs): open accordions for hash links

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-14 16:06:42 -07:00
github-actions[bot] 14326adcf9 Auto-remove workflow packages from serverExternalPackages (#1481) (#1940)
* Warn when serverExternalPackages hides workflow-enabled packages

Add a build-time warning when packages in serverExternalPackages contain
workflow code ('use step', 'use workflow', or serialization classes).
These packages are completely invisible to the workflow compiler when
externalized, causing silent runtime failures.

The warning detects workflow patterns via two methods:
- Fast path: check package.json dependencies for @workflow/serde
- Thorough path: read the package entry file and run pattern detection

Also adds documentation in the serialization guide about the
externalization footgun for 3rd-party packages.

* Auto-remove workflow packages from serverExternalPackages

When workflow-enabled dependencies are externalized in Next.js, compiler transforms are skipped and runtime failures follow. Detect those packages in withWorkflow, remove them from serverExternalPackages for the current build, and keep a generalized externalPackages warning fallback for non-Next builders.

* Address review feedback: add entry-point limitation comment and missing test case

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-06 07:59:43 +00:00
Peter Wielander bb910f2571 [backport] [workbench] Add TanStack Start workbench (#1875, #1907) (#1914)
* [workbench] Add TanStack Start workbench and tests (#1875)

(cherry picked from commit 8202663857)

* Fix pnpm type issue after tanstack PR (#1907)

(cherry picked from commit a7071bf3d4)
2026-05-04 19:30:39 +00:00
Peter Wielander e428cdb1d5 [vitest] [world-local] Backport: Fix local-world data recovery isolation (#1895) (#1898) 2026-05-04 09:38:34 +00:00
Peter Wielander eb54dd8544 [backport] Split tarball hosting out of docs into its own project (#1893) (#1899) 2026-05-04 12:33:00 +09:00
Peter Wielander 8389bce6c3 [docs] Build packages before packing preview tarballs on stable (#1793) 2026-04-16 17:54:23 -07:00
Peter Wielander 47aa68534f [docs] Restore minimal Next.js placeholder on stable (#1786) 2026-04-16 16:45:24 -07:00
Nathan Rajlich 543216060b Remove docs app from stable branch, keep docs/content/ for npm releases (#1771)
The docs Next.js app is deployed only from main. Remove the app code
(components, layouts, configs, styles) from stable to eliminate
cherry-pick conflicts during backports. Keep docs/content/ which
contains the markdown files that are bundled into npm packages via
prepack scripts for AI agent consumption.
2026-04-16 13:13:09 -07:00
John Lindquist 5b6d0779c0 docs: March docs audit and alignment (#1466)
* docs: clarify Next monorepo setup

Prevent confusion when Next.js apps live below the repository root and workflow code imports sibling workspace packages.

This documents the output tracing root requirement at the point where users configure withWorkflow, so monorepo setups follow the same working patterns as the shipped Next.js integration instead of failing due to unresolved workspace imports.

Ploop-Iter: 1

* ploop: iteration 2 checkpoint

Automated checkpoint commit.

Ploop-Iter: 2

* ploop: iteration 3 checkpoint

Automated checkpoint commit.

Ploop-Iter: 3

* docs: audit recent documentation coverage

Capture recent workflow documentation updates so the public docs and package guidance stay aligned with the implementation and current docs-typecheck behavior.

Ploop-Iter: 1

* docs: align docs-typecheck docs

Document the current docs verification contract so contributors do not assume JavaScript examples are type-checked when only TypeScript snippets are enforced today.

Add regression coverage around the README language and framework integration guidance to keep those docs aligned with the implemented Next.js and docs-typecheck behavior as future changes land.

Ploop-Iter: 2

* docs: add start() troubleshooting guidance

Document the most common causes of the invalid workflow function error so users can resolve start() failures from the API docs and Next.js setup flow without having to infer build-time requirements from runtime behavior.

Keep the new troubleshooting page aligned with the shipped runtime message and add regression coverage so future wording or cross-link changes do not silently break that guidance.

Ploop-Iter: 3

* docs: align NestJS setup docs

Document both supported NestJS module formats and add a regression check so the getting-started guide stays aligned with the package README as the integration evolves.

Ploop-Iter: 1

* docs: tighten NestJS CommonJS guidance

Keep the NestJS getting-started guide consistent across the ESM and CommonJS paths so readers do not mix module settings or import styles mid-setup.

Strengthen the docs regression coverage around the later guide sections so future edits are more likely to preserve the supported CommonJS path documented in the package README.

Ploop-Iter: 2

* docs: align docs with recent workflow guidance

Document the recently added troubleshooting and observability patterns so the public docs stay aligned with the behavior users now encounter in practice.

This keeps the NestJS guide, workflow API reference, and docs regression coverage in sync with the runtime-facing guidance from recent changes.

Ploop-Iter: 3

* docs: audit docs coverage

Why: keep the docs aligned with recent API and runtime behavior changes so examples and reference pages don’t drift from the supported surface.

Ploop-Iter: 1

* test: add docs audit guards

Add regression coverage for doc surfaces that are easy to drift from implementation so docs audits catch mismatches early and keep published guidance aligned with the supported API surface.

Ploop-Iter: 2

* docs: add docs audit guards

Keep new observability and server-testing guidance anchored to machine-readable interfaces so follow-up implementation changes do not silently drift away from the documented agent and automation patterns.

Ploop-Iter: 3

* docs: align observability troubleshooting guidance

Keep the docs consistent so users get the same guidance when debugging hook token collisions and correlating workflow events with platform logs.

This prevents the event-sourcing reference from drifting away from the observability and error docs, and adds guard tests to catch regressions.

Ploop-Iter: 1

* Remove the unreferenced image file img-a-clean-minimal-technical-architecture-d-2026-02-27T14-07-52-1.png from the repo root, workbench/fastify/public/index.html (a Nitro example mistakenly placed in the fastify workbench by a ploop checkpoint), all .claude/worktrees/* submodule references, and all 15 string-presence audit guard tests in packages/docs-typecheck/src/__tests__/ (they only assert keyword presence, not semantic correctness). None of these belong in the docs audit PR.

* Address all PR #1466 review feedback from VaguelySerious, pranaygp, and ijjk:

1. Remove the "Machine-Readable Surfaces" section from docs/content/docs/observability/index.mdx (reviewers say it's unnecessary and already in world docs)
2. Remove all @skip-typecheck annotations from durable-agent.mdx (8) and server-based.mdx (1) — types exist in built packages/ai/dist after pnpm build
3. In durable-agent.mdx, change "machine-readable tool activity" to "tool call details" in the stream() return description
4. In durable-agent.mdx "Aborting Long-Running Streams" section, add a warning callout that abortSignal is not yet supported (blocked by #1301), recommend timeout instead
5. In event-sourcing.mdx, update requestId description: "On Vercel, requestId is the platform request ID when available. Other worlds are not expected to provide a requestId."
6. In get-world.mdx, change "user-friendly names from the machine-readable workflowName field" to "human-readable names from the workflowName field"
7. In start-invalid-workflow-function.mdx, add "// Does NOT work" comment above the bad example line
8. In with-workflow.mdx: reframe outputFileTracingRoot as a workaround (Next.js auto-detects by default per ijjk); change options description from "control local development behavior" to "configure the Next.js integration"; scope the callout to "workflows.local options only affect local development"
9. Drop the withWorkflow() options callout from docs/content/docs/getting-started/next.mdx
10. Remove the Next.js-specific outputFileTracingRoot callout from framework-integrations.mdx
11. Add a Troubleshooting section with the start() invalid-workflow-function error to all 9 non-Next getting-started guides (astro, express, fastify, hono, nestjs, nitro, nuxt, sveltekit, vite), each with framework-appropriate config check in point 2

* docs: absorb unique accuracy fixes from PR #1200

Cherry-picked 6 still-needed fixes from #1200 that aren't covered by
this audit PR or #1516:
- Fix npx workflow description (observability)
- Remove fetch from restricted modules list (errors)
- Fix package name @workflow-worlds/postgres → @workflow/world-postgres (deploying)
- Fix stream wording (foundations/starting-workflows)
- Fix import path simple → simple-streaming (foundations/streaming)
- Add close(), getEncryptionKeyForRun(), writeToStreamMulti() to World interface,
  update create() and streamer signatures (deploying/building-a-world)

* docs: address review feedback on March docs audit

- durable-agent.mdx: "structured tool activity" → "tool call information"
  per VaguelySerious's suggestion
- next.mdx: drop monorepo callout from getting-started per pranaygp
  (too much context too early; info is in withWorkflow API ref)

* docs: fix 2 typecheck failures in encryption and nestjs guides

- encryption.mdx: add skip-typecheck for interface signature block
  (getEncryptionKeyForRun overloads are not runnable code)
- nestjs.mdx: add skip-typecheck for WorkflowModule.forRoot config
  snippet (fragment inside callout, full import shown above)

Verified: pnpm vitest run passes 300/300 in docs-typecheck.
2026-04-07 11:18:42 -07:00
Pranay Prakash 125c38708e [changeset] Exit pre-release mode (to release 4.2 stable) (#1508) 2026-04-06 13:52:46 -07:00
Peter Wielander c8dce52606 [core] [world] Lazy run creation on start (#1537) 2026-04-06 12:25:23 -07:00
Karthik Kalyan ce8a80eb82 [docs] Add vercel world consumer function security documentation (#1543) 2026-04-03 09:57:01 -07:00
Pranay Prakash 047c01bc15 Make start() types unknown when deploymentId is provided (#1367)
* fix: update types and documentation for start function overloads

Ensure types are 'unknown[]' and 'unknown' for 'deploymentId' and update exports and documentation.

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

* fix: use generics in deploymentId overloads to avoid contravariance issue

Addresses PR review feedback: typed workflows like
WorkflowFunction<[string], number> were not assignable to
WorkflowFunction<unknown[], unknown> under strictFunctionTypes.
Changed to generic parameters while keeping Run<unknown> return type.
Also adds type-level tests for overload resolution.

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

* chore: add changeset for start() deploymentId type changes

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

---------

Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 19:52:47 -07:00
Peter Wielander 136c1f4e97 [docs] Tidy world API docs and document new stream helpers (#1581) 2026-04-02 20:08:51 +00:00
Nathan Rajlich 7e33c62736 Rename 'Workflow Development Kit' / 'DevKit' to 'Workflow SDK' (#1595)
* Rename 'Workflow Development Kit' / 'DevKit' to 'Workflow SDK' across docs, code, and config

Follow-up to cdf90d5a38 (#1541)

* Fix missing </h1> closing tag and add article 'the' before 'Workflow SDK' in docs
2026-04-02 19:39:02 +00:00
Nathan Rajlich a3d70353e5 docs: rename 'Complex Example' to 'Instance Methods as Steps' (#1592)
* docs: rename 'Complex Example' to 'Instance Methods as Steps' in serialization guide

Rework the section title and introductory copy to better reflect
the purpose: making classes with Node.js APIs / side effects
workflow-compatible by adding "use step" to instance methods.

* docs: clarify that the static requirement applies to serialization hooks

Make the callout explicitly name WORKFLOW_SERIALIZE and
WORKFLOW_DESERIALIZE so it doesn't read as a blanket restriction
on instance methods, which would contradict the 'Instance Methods
as Steps' section below.
2026-04-02 17:04:03 +00:00
Lucas Ralph e574ad2107 [docs] Split World API docs into sub-pages, update skill.md (#1457)
Signed-off-by: Lucas Ralph <lucas.ralph@vercel.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-04-01 09:39:22 -07:00
Pranay Prakash 9cb1fc9482 docs: add webhook security disclaimer (#1574)
* docs: add webhook security disclaimer

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>

---------

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-03-31 18:28:30 -07:00
Peter Wielander 5ca55af2bd [docs] Link to Vercel World pricing and limits pages (#1559) 2026-03-30 19:52:15 +00:00
Nathan Rajlich 4f646e3d58 Polyfill TC39 Uint8Array base64/hex methods in workflow VM context (#1547)
* Polyfill TC39 `Uint8Array` base64/hex methods in workflow VM context

* Replace `declare global` with local type interfaces to avoid type leakage

* Document Uint8Array base64/hex methods in Workflow Globals page
2026-03-30 19:50:08 +00:00
Harpreet cdf90d5a38 Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall (#1541)
* Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall

- Rename "Workflow DevKit" to "Workflow SDK" across all files (~108 files)
- Rename standalone "WDK" references to "Workflow SDK"
- Remove beta badge from homepage hero
- Add tweet wall component to homepage with 4 builder testimonials

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

* Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall

- Rename "Workflow DevKit" to "Workflow SDK" across all files (~108 files)
- Rename standalone "WDK" references to "Workflow SDK"
- Remove beta badge from homepage hero
- Add tweet wall component to homepage with 4 builder testimonials

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com>

* Address review: fix missed trigger phrase renames and bump skill versions

- Rename "workflow devkit" to "workflow sdk" in trigger phrases for both skill files
- Bump workflow-init SKILL.md version to 1.1
- Bump workflow SKILL.md version to 1.5
- Note: CLAUDE.md is a symlink to AGENTS.md, already renamed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com>

* link correct tweet

---------

Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>
2026-03-29 16:05:39 -07:00
Nathan Rajlich 7db491b89c Add Workflow Globals reference page documenting available workflow VM APIs (#1548) 2026-03-29 22:14:41 +00:00