feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

feat(web): add self-hosted mode for world configuration - #747

Merged
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config
Jan 9, 2026
Merged

feat(web): add self-hosted mode for world configuration#747
pranaygp merged 7 commits into
mainfrom
feat/self-hosted-world-config

Conversation

@pranaygp

@pranaygppranaygp commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds self-hosted mode for the web observability UI where world configuration is locked via server environment variables
  • When WORKFLOW_TARGET_WORLD is set on the server, query params and UI settings cannot override the configuration
  • Shows a lock icon and "Self-Hosted Mode" banner in the settings UI when configuration is locked

Changes

  • @workflow/web-shared: Add getHardcodedConfig server action and modify getWorldFromEnv to respect hardcoded mode
  • @workflow/web: Add WorldConfigContext to provide config state app-wide, update settings sidebar and connection status components

Use Case

This enables deploying the observability UI as a standalone service connected to a specific world backend (e.g., PostgreSQL) without allowing runtime configuration changes:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres" \
WORKFLOW_POSTGRES_URL="postgres://..." \
pnpm --filter @workflow/web dev

Testing

Tested locally with postgres world - the UI now shows "Connected to: PostgreSQL" with a lock icon, and the settings sidebar shows the configuration as locked.

Screenshot 2026-01-08 at 12 18 43 AM

CopilotAI review requested due to automatic review settings January 8, 2026 08:21
@vercel

vercelBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jan 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e826daa

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

This PR includes changesets to release 7 packages
NameType
@workflow/webPatch
@workflow/web-sharedPatch
@workflow/cliPatch
workflowPatch
@workflow/world-testingPatch
@workflow/aiPatch
@workflow/docs-typecheckPatch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.037s (+3.9%)1.014s (~)0.977s101.00x
💻 LocalNext.js (Turbopack)0.038s (+0.8%)1.014s (~)0.976s101.01x
🌐 RedisNext.js (Turbopack)0.041s (-3.1%)1.017s (~)0.976s101.09x
💻 LocalNitro0.042s (-1.6%)1.007s (~)0.965s101.12x
💻 LocalExpress0.044s (+5.5% 🔺)1.007s (~)0.963s101.18x
🌐 TursoNext.js (Turbopack)0.108s (+5.7% 🔺)1.014s (~)0.906s102.90x
🌐 MongoDBNext.js (Turbopack)0.134s (+49.4% 🔺)1.015s (~)0.881s103.58x
🐘 PostgresExpress0.298s (-5.5% 🟢)1.018s (~)0.719s107.98x
🐘 PostgresNitro0.307s (+26.8% 🔺)1.012s (-2.4%)0.705s108.20x
🐘 PostgresNext.js (Turbopack)0.417s (+115.8% 🔺)1.019s (~)0.601s1011.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.759s (-32.1% 🟢)1.717s (-13.7% 🟢)0.958s101.00x
▲ VercelExpress0.831s (+10.4% 🔺)1.821s (+17.5% 🔺)0.990s101.09x
▲ VercelNext.js (Turbopack)0.886s (+15.8% 🔺)1.968s (+19.4% 🔺)1.082s101.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.097s (+0.5%)2.010s (~)0.913s101.00x
🌐 RedisNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.00x
💻 LocalNext.js (Turbopack)1.103s (+1.2%)2.011s (~)0.908s101.01x
💻 LocalNitro1.114s (+0.5%)2.007s (~)0.893s101.02x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.307s (~)2.015s (~)0.708s101.19x
🌐 TursoNext.js (Turbopack)1.318s (+1.0%)2.012s (~)0.694s101.20x
🐘 PostgresNext.js (Turbopack)1.902s (~)2.215s (+10.0% 🔺)0.313s101.73x
🐘 PostgresExpress2.119s (-2.0%)3.016s (~)0.897s101.93x
🐘 PostgresNitro2.174s (-5.7% 🟢)3.013s (~)0.839s101.98x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.026s (+9.5% 🔺)3.849s (+5.1% 🔺)0.823s101.00x
▲ VercelNitro3.103s (+13.0% 🔺)3.757s (+5.4% 🔺)0.654s101.03x
▲ VercelExpress3.153s (+5.4% 🔺)4.037s (+6.0% 🔺)0.885s101.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.599s (~)11.011s (~)0.413s51.00x
💻 LocalNext.js (Turbopack)10.644s (~)11.015s (~)0.372s51.00x
🌐 RedisNext.js (Turbopack)10.653s (~)11.015s (~)0.362s51.01x
💻 LocalNitro10.788s (~)11.012s (~)0.224s51.02x
💻 LocalExpress10.789s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.227s (~)13.028s (~)0.802s51.15x
🌐 MongoDBNext.js (Turbopack)12.261s (~)13.028s (~)0.767s51.16x
🐘 PostgresNext.js (Turbopack)15.140s (-0.7%)16.032s (~)0.892s51.43x
🐘 PostgresNitro20.426s (+11.4% 🔺)21.030s (+10.5% 🔺)0.604s51.93x
🐘 PostgresExpress20.458s (~)21.035s (~)0.577s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.536s (+5.8% 🔺)24.333s (+4.7%)0.798s51.00x
▲ VercelExpress23.933s (+4.4%)24.916s (+5.6% 🔺)0.983s51.02x
▲ VercelNitro23.936s (+5.5% 🔺)24.703s (+5.9% 🔺)0.767s51.02x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.338s (~)2.008s (~)0.671s151.00x
🌐 RedisNext.js (Turbopack)1.353s (-0.8%)2.010s (~)0.657s151.01x
💻 LocalNext.js (Turbopack)1.377s (+1.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.411s (~)2.006s (~)0.594s151.06x
💻 LocalNitro1.414s (+1.1%)2.006s (~)0.592s151.06x
🐘 PostgresNext.js (Turbopack)1.849s (-1.3%)2.013s (-3.2%)0.164s151.38x
🌐 MongoDBNext.js (Turbopack)2.163s (~)3.017s (~)0.854s101.62x
🌐 TursoNext.js (Turbopack)2.222s (~)3.013s (~)0.791s101.66x
🐘 PostgresExpress2.330s (-2.3%)3.015s (~)0.685s101.74x
🐘 PostgresNitro2.429s (+29.2% 🔺)3.011s (+44.9% 🔺)0.582s101.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.047s (~)3.779s (-2.8%)0.731s91.00x
▲ VercelNitro3.260s (+18.0% 🔺)4.197s (~)0.937s81.07x
▲ VercelExpress3.379s (-5.6% 🟢)4.249s (-6.6% 🟢)0.869s81.11x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.147s (+6.3% 🔺)3.124s (+11.8% 🔺)0.978s101.00x
💻 LocalNitro2.198s (+2.4%)3.150s (+1.2%)0.952s101.02x
💻 LocalExpress2.238s (~)3.183s (~)0.945s101.04x
🐘 PostgresNext.js (Turbopack)2.432s (-2.9%)3.027s (~)0.594s101.13x
🌐 StarterNext.js (Turbopack)2.456s (~)3.009s (~)0.553s101.14x
🌐 RedisNext.js (Turbopack)2.495s (-0.9%)3.012s (~)0.516s101.16x
🐘 PostgresNitro2.857s (+1.1%)3.118s (+3.5%)0.261s101.33x
🐘 PostgresExpress3.125s (+0.5%)3.904s (+3.5%)0.779s81.46x
🌐 TursoNext.js (Turbopack)4.703s (+0.7%)5.184s (~)0.481s62.19x
🌐 MongoDBNext.js (Turbopack)4.720s (~)5.183s (~)0.463s62.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.203s (+3.2%)5.184s (+9.8% 🔺)0.981s61.00x
▲ VercelNitro4.373s (+4.8%)5.178s (+6.2% 🔺)0.805s61.04x
▲ VercelNext.js (Turbopack)5.100s (+37.8% 🔺)5.830s (+32.1% 🔺)0.730s61.21x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.337s (-1.4%)2.007s (~)0.670s151.00x
🌐 RedisNext.js (Turbopack)1.372s (-0.7%)2.010s (~)0.638s151.03x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.06x
💻 LocalNitro1.422s (+1.7%)2.006s (~)0.584s151.06x
💻 LocalNext.js (Turbopack)1.432s (+1.7%)2.015s (~)0.583s151.07x
🐘 PostgresNext.js (Turbopack)1.706s (-1.0%)2.013s (~)0.307s151.28x
🐘 PostgresExpress1.811s (-12.3% 🟢)2.015s (-13.2% 🟢)0.204s151.35x
🐘 PostgresNitro2.069s (+21.1% 🔺)2.396s (+19.1% 🔺)0.327s131.55x
🌐 MongoDBNext.js (Turbopack)2.120s (~)3.011s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.221s (~)3.015s (~)0.794s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.990s (+4.5%)3.800s (+2.6%)0.811s81.00x
▲ VercelNitro3.033s (+10.8% 🔺)3.809s (+6.3% 🔺)0.777s81.01x
▲ VercelNext.js (Turbopack)5.504s (+92.4% 🔺)6.210s (+63.3% 🔺)0.706s51.84x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.090s (-1.3%)2.906s (-4.1%)0.816s111.00x
💻 LocalExpress2.220s (~)3.184s (~)0.965s101.06x
💻 LocalNitro2.293s (+3.9%)3.236s (+1.5%)0.943s101.10x
🐘 PostgresNext.js (Turbopack)2.336s (-8.3% 🟢)3.016s (~)0.680s101.12x
🌐 StarterNext.js (Turbopack)2.450s (~)3.008s (~)0.558s101.17x
🌐 RedisNext.js (Turbopack)2.475s (-1.3%)3.011s (~)0.535s101.18x
🐘 PostgresExpress2.771s (+14.5% 🔺)3.031s (+0.6%)0.260s101.33x
🐘 PostgresNitro2.877s (~)3.011s (~)0.133s101.38x
🌐 MongoDBNext.js (Turbopack)4.684s (+0.8%)5.182s (~)0.498s62.24x
🌐 TursoNext.js (Turbopack)4.766s (+2.6%)5.183s (~)0.417s62.28x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.392s (-1.1%)4.005s (-1.6%)0.613s81.00x
▲ VercelNitro3.401s (+1.8%)3.973s (+1.8%)0.572s81.00x
▲ VercelExpress3.483s (+7.6% 🔺)3.995s (+3.0%)0.512s81.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.126s (+3.9%)1.006s (~)0.000s (~)1.012s (~)0.886s101.00x
💻 LocalNext.js (Turbopack)0.136s (+4.6%)1.003s (~)0.018s (+24.2% 🔺)1.029s (~)0.893s101.08x
🌐 RedisNext.js (Turbopack)0.149s (-4.7%)1.005s (~)0.000s (NaN%)1.013s (~)0.864s101.19x
💻 LocalExpress0.175s (-2.3%)0.992s (~)0.015s (-7.5% 🟢)1.021s (~)0.846s101.40x
💻 LocalNitro0.177s (+2.5%)0.992s (~)0.016s (+1.9%)1.022s (~)0.845s101.41x
🌐 MongoDBNext.js (Turbopack)0.472s (-6.6% 🟢)0.980s (+3.9%)0.000s (NaN%)1.014s (~)0.543s103.75x
🌐 TursoNext.js (Turbopack)0.486s (+5.6% 🔺)0.966s (-2.3%)0.000s (+Infinity% 🔺)1.014s (~)0.528s103.87x
🐘 PostgresNext.js (Turbopack)1.048s (-7.7% 🟢)1.196s (-39.1% 🟢)0.003s (+Infinity% 🔺)1.421s (-29.5% 🟢)0.373s108.34x
🐘 PostgresExpress2.251s (-2.7%)2.792s (+2.2%)0.000s (NaN%)3.015s (~)0.764s1017.92x
🐘 PostgresNitro2.349s (+66.0% 🔺)2.693s (+64.8% 🔺)0.000s (NaN%)3.014s (+49.7% 🔺)0.666s1018.70x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.836s (+3.8%)3.222s (~)0.567s (+56.7% 🔺)4.258s (+5.8% 🔺)1.423s101.00x
▲ VercelNitro2.901s (+6.1% 🔺)3.228s (+4.5%)0.575s (+22.5% 🔺)4.271s (+7.6% 🔺)1.370s101.02x
▲ VercelExpress3.023s (+9.4% 🔺)3.348s (+6.5% 🔺)0.577s (+33.7% 🔺)4.518s (+12.3% 🔺)1.495s101.07x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)7/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNext.js (Turbopack)5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production363011374
❌ 💻 Local Development33028340
✅ 📦 Local Production33208340
✅ 🐘 Local Postgres33208340
❌ 🪟 Windows331034
❌ 🌍 Community Worlds131170148
Total152120351576

❌ Failed Tests

💻 Local Development (2 failed)

sveltekit-stable (2 failed):

  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (17 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3301
✅ example3301
✅ express3301
✅ fastify3301
✅ hono3301
✅ nextjs-turbopack3301
✅ nextjs-webpack3301
✅ nitro3301
✅ nuxt3301
✅ sveltekit3301
✅ vite3301
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
❌ sveltekit-stable3121
✅ vite-stable3301
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3301
✅ express-stable3301
✅ fastify-stable3301
✅ hono-stable3301
✅ nextjs-turbopack-stable3400
✅ nextjs-webpack-stable3400
✅ nitro-stable3301
✅ nuxt-stable3301
✅ sveltekit-stable3301
✅ vite-stable3301
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack3310
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3310
✅ redis-dev300
❌ redis3310
✅ starter-dev300
❌ starter20140
✅ turso-dev300
❌ turso3310

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: failure

Check the workflow run for details.

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
@pranaygp
pranaygpforce-pushed the feat/self-hosted-world-config branch from 0c6cb81 to e1636a0CompareJanuary 8, 2026 08:25
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

should we just get rid of the "dynamic" mode and disallow people configuring the workflow at runtime. Make it so the world is setup and created based purely on server side env vars? the CLI controls env vars and can configure it accordingly anyway

CopilotAI 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.

Pull request overview

This PR adds a self-hosted mode feature to the web observability UI, allowing deployment with a locked world configuration controlled by server environment variables. When WORKFLOW_TARGET_WORLD is set on the server, the UI prevents users from changing the backend configuration through query parameters or the settings UI.

Key changes:

  • Implements a React context (WorldConfigContext) to manage configuration state application-wide
  • Adds server-side detection of hardcoded mode and provides configuration to the client
  • Updates UI components to display lock indicators and disable controls when in self-hosted mode

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
packages/web/src/lib/world-config-context.tsxNew context provider that manages world configuration state, supporting both dynamic (query param-based) and hardcoded (environment variable-based) modes
packages/web/src/components/settings-sidebar.tsxUpdated to show "Self-Hosted Mode" banner, disable all form inputs, and hide the Apply button when configuration is locked
packages/web/src/components/display-utils/connection-status.tsxEnhanced to display lock icon and postgres connection details, with special handling for hardcoded mode
packages/web/src/app/run/[runId]/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/page.tsxMigrated from using useQueryParamConfig to useWorldConfig hook for configuration access
packages/web/src/app/layout.tsxAdded server-side call to fetch hardcoded config and pass it to client components
packages/web/src/app/layout-client.tsxAdded WorldConfigProvider wrapper to provide configuration context to the app
packages/web-shared/src/api/workflow-server-actions.tsAdded getHardcodedConfig function and modified getWorldFromEnv to enforce hardcoded mode when WORKFLOW_TARGET_WORLD is set
changeset/self-hosted-world-config.mdDocuments the new feature with usage examples and supported environment variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +21
* Configuration mode for the web UI.
* - 'dynamic': Config comes from query params and can be changed via UI
* - 'hardcoded': Config is set via server env vars and cannot be changed
*/
export type ConfigMode = 'dynamic' | 'hardcoded';

/**

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The ConfigMode type is exported but never used anywhere in the codebase. Consider removing this unused export to reduce code complexity, or add a comment explaining if it's intended for future use or external consumers.

Suggested change
*ConfigurationmodeforthewebUI.
*-'dynamic': ConfigcomesfromqueryparamsandcanbechangedviaUI
*-'hardcoded': Config is setviaserverenvvarsandcannotbechanged
*/
exporttypeConfigMode='dynamic'|'hardcoded';
/**

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
: backend === 'postgres'
? 'database'
: undefined;

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The substring for postgres backend is hardcoded to the literal string 'database', which will display as "Connected to: PostgreSQL (database)" regardless of the actual database name. This is not informative. Consider either extracting the actual database name from the postgres URL (similar to how it's done in getConnectionInfo), or setting it to undefined to not show a substring at all.

Suggested change
: backend==='postgres'
? 'database'
: undefined;
: undefined;

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +161
function getHardcodedEnvMap(): EnvMap {
return {
WORKFLOW_TARGET_WORLD: process.env.WORKFLOW_TARGET_WORLD,
WORKFLOW_VERCEL_ENV: process.env.WORKFLOW_VERCEL_ENV,
WORKFLOW_VERCEL_AUTH_TOKEN: process.env.WORKFLOW_VERCEL_AUTH_TOKEN,
WORKFLOW_VERCEL_PROJECT: process.env.WORKFLOW_VERCEL_PROJECT,
WORKFLOW_VERCEL_TEAM: process.env.WORKFLOW_VERCEL_TEAM,
PORT: process.env.PORT,
WORKFLOW_MANIFEST_PATH: process.env.WORKFLOW_MANIFEST_PATH,
WORKFLOW_LOCAL_DATA_DIR: process.env.WORKFLOW_LOCAL_DATA_DIR,
WORKFLOW_POSTGRES_URL: process.env.WORKFLOW_POSTGRES_URL,
};

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The envMap construction logic is duplicated between getHardcodedConfig (lines 78-88) and getHardcodedEnvMap (lines 151-161). Consider extracting this into a shared helper function to reduce duplication and improve maintainability. If these need to diverge in the future, the duplication could lead to inconsistencies.

Copilot uses AI. Check for mistakes.
'use client';

import { TooltipProvider } from '@radix-ui/react-tooltip';
import type { EnvMap } from '@workflow/web-shared/server';

CopilotAIJan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The EnvMap type import is unused in this file. Since HardcodedConfig is imported from the world-config-context module which already includes the EnvMap type in its definition, this import is redundant here.

Suggested change
import type { EnvMap } from '@workflow/web-shared/server';

Copilot uses AI. Check for mistakes.
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
@pranaygp

Copy link
Copy Markdown
ContributorAuthor

@VaguelySerious while doing your manual tests, it looks like CLI is actually doing both - using "hard coded mode" AND setting the query params.

I'm gonna update this PR to just get rid of the query params thing and simplify down to just enforcing env variables anyway :)

I think that's an improvement and makes things simpler, especially as we move towards mounting o11y natively in the user app

I'll ensure all your manual tests scenarios work

@pranaygp
pranaygp marked this pull request as draft January 9, 2026 01:42
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
Comment on lines +261 to +275
* Get or create a World instance based on configuration.
*
* Configuration priority:
* 1. If server-side environment variables are set (WORKFLOW_TARGET_WORLD, etc.),
* those are used and the envMap parameter is ignored. This is the standard
* mode used by the @workflow/web package.
*
* 2. If no server-side env vars are set but envMap is provided, the envMap
* values are used. This mode is reserved for future use cases where
* dynamic world configuration at runtime may be needed (e.g., a multi-tenant
* observability dashboard).
*
* 3. If neither is set, createWorld() falls back to its default behavior
* (vercel if VERCEL_DEPLOYMENT_ID is set, otherwise local).
*

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@VaguelySerious fyi I left the dynamic mode stuff in "web-shared" but stopped using it in the web package (for the reasons mentioned in this comment)

figured you could do whatever you like in future PRs for fully getting rid of it, or making it match the config RFC in worlds directly, etc. ITG

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

ok made changes and tested all the patterns. was able to run locally and connect to railway easily too and it even looks a bit better:

I removed dynamic query params from cli and web package so everything is propagated via env vars, but left dynamic mode in web-shared

will need docs for this but will ITG

imageimage

Sign up for freeto 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

@pranaygp@awaseem@VaguelySerious