Skip to content

docs: require system environment variables when deploying to Vercel - #4166

Merged
TooTallNate merged 2 commits into
mainfrom
docs-system-env-vars
Sep 16, 2026
Merged

TooTallNate merged 2 commits into
mainfrom
docs-system-env-vars

Conversation

@TooTallNate

@TooTallNate TooTallNate commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Why

A customer's Vercel deployment silently ran on the Local World and every run failed. The cause was that their project had Enable access to System Environment Variables turned off, so Vercel never set VERCEL_DEPLOYMENT_ID — the single signal Workflow uses to recognize a deployment (resolveWorkflowTargetWorld in packages/utils/src/world-target.ts).

Nothing in the docs said that setting was a prerequisite, and nothing in the deployment points at it either:

  • The build branches on VERCEL_DEPLOYMENT_ID too (packages/next/src/index.ts, packages/astro/src/plugin.ts, packages/sveltekit/src/index.ts), so it emits local output instead of the queue-triggered flow handler.
  • At runtime the Local World is selected and its first write hits the read-only filesystem.
  • The warnIfRunningInVercelDeployment warning that would name the mistake keys off the same missing variable, so it never fires.
  • WORKFLOW_TARGET_WORLD=vercel is not a workaround: the Vercel World needs the deployment ID itself and fails with missingDeploymentIdMessage.

What changed

Docs only — no code, no changeset (pnpm changeset status --since=main reports none needed).

  • worlds/{v4,v5}/vercel.mdx — new ## System environment variables section: what the variable is for, the four dashboard steps to enable it, and the consequence of leaving it off. v5 also gets a ### Diagnosing a missing deployment ID subsection covering the symptoms (EROFS on the Local World data directory, no runs in the dashboard, no warning) and why WORKFLOW_TARGET_WORLD=vercel does not help. The v4 text is trimmed to behavior that exists on 4.x, which has no UnwritableDataDirError or in-deployment warning.
  • docs/{v4,v5}/deploying.mdx — a prerequisite callout in "Deploying to Vercel", next to the existing Fluid compute callout, linking to the new section.
  • docs/v5/configuration/worlds.mdx — noted under WORKFLOW_TARGET_WORLD, right after the WORKFLOW_TARGET_WORLD=local case, since it is the other way a deployment ends up on the Local World (and the one that produces no warning). Also qualified the "platform-provided values" paragraph.

docs/content/docs/v4/ has no configuration/ section, so the v4 pages link to /worlds/vercel#system-environment-variables rather than the configuration reference.

Verification

pnpm --filter docs lint:links (docs/scripts/lint.ts) passes: 0 errored file, 0 errors.

Docs Preview

Page v4 (current) v5 (pre-release)
Deploying /docs/deploying#deploying-to-vercel /v5/docs/deploying#deploying-to-vercel
Vercel World /worlds/vercel#system-environment-variables /v5/worlds/vercel#system-environment-variables
Worlds configuration — /v5/docs/configuration/worlds#workflow_target_world

Unrelated, but worth a maintainer's eye: AGENTS.md documents the preview mapping as "v5 at /docs/..., v4 at /v4/docs/...". The app routes it the other way round today — lib/geistdocs/source.ts has current: 'v4' with v5 behind the /v5 prefix — so that paragraph sends agents to 404s. Left alone here to keep this PR docs-content-only.

🤖 Generated with Claude Code

@TooTallNate
TooTallNate requested a review from a team as a code owner September 14, 2026 20:24
Copilot AI lite review requested due to automatic review settings September 14, 2026 20:24
@changeset-bot

changeset-bot Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 158b0fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@VaguelySerious VaguelySerious left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this also throw when detecting that we're running in vercel world?

@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Moderate documentation accuracy issues and the required preview URLs remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This docs-only PR documents the Vercel system-environment-variable prerequisite for correctly selecting the Vercel World.

Changes:

  • Adds v4/v5 setup and troubleshooting guidance for VERCEL_DEPLOYMENT_ID.
  • Adds Vercel deployment prerequisite callouts.
  • Documents missing-variable behavior in world configuration.
File summaries
File Reviewed change
docs/content/worlds/v5/vercel.mdx Adds setup guidance and diagnostics.
docs/content/worlds/v4/vercel.mdx Adds v4-compatible prerequisite guidance.
docs/content/docs/v5/deploying.mdx Adds deployment prerequisite callout.
docs/content/docs/v5/configuration/worlds.mdx Documents missing deployment-ID behavior.
docs/content/docs/v4/deploying.mdx Adds v4 deployment prerequisite callout.
Review details

Suppressed comments (5)

docs/content/docs/v4/deploying.mdx:61

  • The callout repeats the same blanket claim, but WORKFLOW_LOCAL_DATA_DIR=/tmp is a supported writable exception on Vercel (packages/world-local/src/build-target-mismatch.ts:82-83). Please qualify the failure to the default/non-writable data directory and note that /tmp is ephemeral rather than durable.
  falls back to the Local World and every run fails on the read-only
  filesystem. See
  [System environment variables](/worlds/vercel#system-environment-variables).

docs/content/docs/v5/deploying.mdx:62

  • The PR description's Docs Preview table still contains relative route fragments and says the links will be filled in later. Before approval, replace them with direct workflow-docs preview URLs from the vercel[bot] comment for the changed v4/v5 pages, as required for docs changes.
  [System environment variables](/worlds/vercel#system-environment-variables).

docs/content/docs/v5/deploying.mdx:62

  • The callout repeats the same blanket claim, but WORKFLOW_LOCAL_DATA_DIR=/tmp is a supported writable exception on Vercel (packages/world-local/src/build-target-mismatch.ts:82-83). Please qualify the failure to the default/non-writable data directory and note that /tmp is ephemeral rather than durable.
  falls back to the Local World and every run fails on the read-only
  filesystem. See
  [System environment variables](/worlds/vercel#system-environment-variables).

docs/content/worlds/v4/vercel.mdx:52

  • This is too absolute: WORKFLOW_LOCAL_DATA_DIR can point at /tmp, and the Local World explicitly treats /tmp as writable on Vercel (packages/world-local/src/build-target-mismatch.ts:82-83). With that configuration the first write is not guaranteed to fail, although the state is ephemeral, so qualify this to the default/non-writable data directory.
  workflow state on the filesystem. A deployment's filesystem is read-only, so
  every run fails before its first step, and no runs appear in the Vercel
  dashboard because none were ever created in the Vercel World.

docs/content/worlds/v5/vercel.mdx:56

  • The v5 runtime now throws UnwritableDataDirError, whose message explicitly identifies the local filesystem World, Vercel's read-only filesystem, and the Vercel-World fix (packages/world-local/src/build-target-mismatch.ts:25-33). Saying that nothing announces the wrong World is therefore misleading; distinguish the missing startup warning from the diagnostic write error.
Nothing in the deployment announces the wrong World, so the failure is easy to mistake for a bug in the SDK:
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/content/worlds/v4/vercel.mdx Outdated
Comment on lines +49 to +50
output and the runtime selects the [Local World](/worlds/local), which stores
workflow state on the filesystem. A deployment's filesystem is read-only, so

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AI: Agreed. Updated the v4 warning in 158b0fb to say that the runtime selects Local World unless WORKFLOW_TARGET_WORLD is set, and scoped the filesystem failure to that default selection. This keeps it consistent with the note below about explicitly selecting Vercel World still requiring VERCEL_DEPLOYMENT_ID.

Comment thread docs/content/worlds/v5/vercel.mdx Outdated
Comment on lines +49 to +50
output and the runtime selects the [Local World](/worlds/local), which stores
workflow state on the filesystem. A deployment's filesystem is read-only, so

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AI: Agreed. Updated the v5 warning in 158b0fb to qualify Local World selection and its filesystem failure as the default when no WORKFLOW_TARGET_WORLD override is set. Also applied that qualifier to the diagnostic symptoms, so they do not imply that an explicit Vercel World override selects Local World. Lint and MDX compilation passed; the link checker could not run because the installed Bun executable failed to launch.

vercel Bot and others added 2 commits September 16, 2026 20:25
Workflow recognizes a Vercel deployment by VERCEL_DEPLOYMENT_ID, which
Vercel only exposes when "Enable access to System Environment Variables"
is selected in the project's Environment Variables settings. A project
that cleared that checkbox looks like a non-Vercel environment to the
SDK: the build emits local output and the runtime selects the Local
World, whose writes then fail on the deployment's read-only filesystem.
Nothing announces the wrong World, because the "local world inside a
Vercel deployment" warning keys off the same missing variable.

Document the setting as a deployment prerequisite on both deploying
pages and both Vercel World pages, add a diagnosis section covering the
symptoms and why WORKFLOW_TARGET_WORLD=vercel is not a workaround, and
note it alongside World selection in the v5 configuration reference.

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

Co-Authored-By: Nathan Rajlich <71256+TooTallNate@users.noreply.github.com>
Co-Authored-By: Nathan Rajlich <71256+TooTallNate@users.noreply.github.com>
@TooTallNate
TooTallNate merged commit 59a7c5b into main Sep 16, 2026
67 checks passed
@TooTallNate
TooTallNate deleted the docs-system-env-vars branch September 16, 2026 21:17
github-actions Bot added a commit that referenced this pull request Sep 16, 2026
…4166)

* docs: require system environment variables when deploying to Vercel

Workflow recognizes a Vercel deployment by VERCEL_DEPLOYMENT_ID, which
Vercel only exposes when "Enable access to System Environment Variables"
is selected in the project's Environment Variables settings. A project
that cleared that checkbox looks like a non-Vercel environment to the
SDK: the build emits local output and the runtime selects the Local
World, whose writes then fail on the deployment's read-only filesystem.
Nothing announces the wrong World, because the "local world inside a
Vercel deployment" warning keys off the same missing variable.

Document the setting as a deployment prerequisite on both deploying
pages and both Vercel World pages, add a diagnosis section covering the
symptoms and why WORKFLOW_TARGET_WORLD=vercel is not a workaround, and
note it alongside World selection in the v5 configuration reference.

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

Co-Authored-By: Nathan Rajlich <71256+TooTallNate@users.noreply.github.com>

* docs: qualify default World selection warnings

Co-Authored-By: Nathan Rajlich <71256+TooTallNate@users.noreply.github.com>

---------

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

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #4214. Merge conflicts were resolved by AI — please review carefully. (backport job run)

This branch was successfully deployed

18 active deployments
Preview – workflow-swc-playground — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workflow-docs — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – example-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workflow-tarballs — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-astro-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-hono-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-vite-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-express-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workflow-web — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Preview – workbench-python-workflow — 158b0fb5 Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants