Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3
, '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

Add World.close() for clean resource cleanup in CLI and short-lived processes - #1081

Merged
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface
Feb 17, 2026
Merged

Add World.close() for clean resource cleanup in CLI and short-lived processes#1081
TooTallNate merged 1 commit into
mainfrom
02-16-add_world_close_interface

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
Member

Added a close() method to the World interface and implemented it across world implementations to ensure clean process exits without relying on process.exit().

What changed?

  • Added an optional close() method to the World interface for releasing resources
  • Implemented close() in world-local to close the undici HTTP agent
  • Implemented close() in world-postgres to stop PgBoss and close the postgres connection pool
  • Enhanced the CLI's BaseCommand to call World.close() after commands complete
  • Refactored the HTTP agent in world-local from a module-level singleton to an instance-scoped resource
  • Added an E2E test for the CLI cancel command to verify the clean exit path

How to test?

  1. Run CLI commands and verify they exit cleanly without hanging
  2. Test the new E2E test for the cancel command
  3. Verify that long-running processes using the workflow library can exit cleanly after calling World.close()

Why make this change?

Previously, processes using the workflow library could hang after completing their work because resources like HTTP agents, database connections, and queue listeners remained active. This change ensures that all resources are properly released when a process is done with the workflow world, allowing for clean exits without having to force termination with process.exit().

@changeset-bot

changeset-botBot commented Feb 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e058570

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

This PR includes changesets to release 18 packages
NameType
@workflow/cliPatch
@workflow/worldPatch
@workflow/world-localPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/corePatch
@workflow/web-sharedPatch
@workflow/world-vercelPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production534038572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds110469165
✅ 📋 Other135021156
Total2496462752817

❌ Failed Tests

🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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 retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4804
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
✅ nextjs-turbopack5101
✅ nextjs-webpack5101
✅ nitro4804
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4813
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

@TooTallNateGraphite App

TooTallNate commented Feb 16, 2026

Copy link
Copy Markdown
MemberAuthor

@TooTallNate
TooTallNate marked this pull request as ready for review February 16, 2026 17:14
@TooTallNate
TooTallNate requested review from a team and Copilot and removed request for CopilotFebruary 16, 2026 17:14
CopilotAI review requested due to automatic review settings February 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from 3f8a43f to 5ac8bfaCompareFebruary 16, 2026 17:16
@TooTallNate
TooTallNateforce-pushed the 02-16-add_world_close_interface branch from c2e6b13 to 8787447CompareFebruary 16, 2026 18:08
@TooTallNateTooTallNate changed the title Add World.close() for clean resource cleanup in CLI and short-lived processesAdd World.close() for clean resource cleanup in CLI and short-lived processesFeb 16, 2026
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/cli
export * from '@workflow/core/runtime';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems unrelated?

Comment threadworkbench/example/workflows/99_e2e.ts Outdated
Comment threadpackages/world-postgres/src/index.ts Outdated
@github-actions

github-actionsBot commented Feb 17, 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
💻 Local🥇 Nitro0.033s (-1.8%)1.005s (~)0.973s101.00x
💻 LocalExpress0.034s (+1.8%)1.006s (~)0.972s101.03x
💻 LocalNext.js (Turbopack)0.039s (-1.5%)1.005s (~)0.966s101.20x
🌐 RedisNext.js (Turbopack)0.045s (~)1.005s (~)0.959s101.40x
🐘 PostgresNitro0.091s (-73.0% 🟢)1.010s (~)0.919s102.80x
🌐 MongoDBNext.js (Turbopack)0.111s (-4.9%)1.007s (~)0.896s103.39x
🐘 PostgresExpress0.132s (-5.2% 🟢)1.010s (~)0.878s104.04x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.540s (-19.6% 🟢)1.692s (-16.6% 🟢)1.152s101.00x
▲ VercelExpress0.648s (+7.0% 🔺)2.223s (+22.7% 🔺)1.575s101.20x
▲ VercelNitro0.664s (+12.6% 🔺)2.132s (+6.6% 🔺)1.468s101.23x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.098s (~)2.006s (~)0.907s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
💻 LocalNitro1.110s (~)2.006s (~)0.896s101.01x
💻 LocalExpress1.111s (+0.7%)2.006s (~)0.895s101.01x
🌐 MongoDBNext.js (Turbopack)1.300s (~)2.007s (~)0.708s101.18x
🐘 PostgresExpress2.410s (~)3.014s (~)0.604s102.19x
🐘 PostgresNitro2.412s (+0.8%)2.915s (-3.4%)0.503s102.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.217s (-7.4% 🟢)2.932s (-10.8% 🟢)0.716s101.00x
▲ VercelNitro2.277s (-1.3%)3.247s (-1.8%)0.970s101.03x
▲ VercelExpress2.405s (+6.1% 🔺)3.501s (+8.5% 🔺)1.095s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)10.706s (~)11.023s (~)0.317s31.00x
💻 LocalNext.js (Turbopack)10.718s (~)11.022s (~)0.304s31.00x
💻 LocalNitro10.840s (~)11.023s (~)0.182s31.01x
💻 LocalExpress10.861s (~)11.022s (~)0.161s31.01x
🌐 MongoDBNext.js (Turbopack)12.257s (~)13.020s (~)0.763s31.14x
🐘 PostgresNitro15.402s (-23.9% 🟢)16.047s (-23.8% 🟢)0.646s21.44x
🐘 PostgresExpress20.375s (~)21.060s (~)0.686s21.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro17.780s (+2.7%)18.838s (+1.2%)1.058s21.00x
▲ VercelExpress17.800s (~)19.055s (+3.0%)1.255s21.00x
▲ VercelNext.js (Turbopack)20.064s (+8.1% 🔺)20.626s (~)0.562s21.13x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.941s (~)27.050s (~)0.109s31.00x
💻 LocalNext.js (Turbopack)27.220s (~)28.053s (~)0.833s31.01x
💻 LocalNitro27.534s (~)28.052s (~)0.518s31.02x
💻 LocalExpress27.600s (~)28.054s (~)0.454s31.02x
🌐 MongoDBNext.js (Turbopack)30.453s (~)31.039s (~)0.586s21.13x
🐘 PostgresNitro37.733s (-25.3% 🟢)38.094s (-25.5% 🟢)0.361s21.40x
🐘 PostgresExpress50.387s (~)51.132s (~)0.745s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express42.825s (+1.0%)44.292s (+2.0%)1.467s21.00x
▲ VercelNitro43.098s (-1.3%)44.546s (-1.0%)1.448s21.01x
▲ VercelNext.js (Turbopack)43.797s (-2.8%)44.863s (-3.1%)1.066s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.345s (~)55.097s (~)0.752s21.00x
💻 LocalNext.js (Turbopack)56.993s (+0.6%)57.105s (~)0.112s21.05x
💻 LocalNitro57.431s (~)58.106s (~)0.676s21.06x
💻 LocalExpress57.689s (+0.7%)58.107s (~)0.418s21.06x
🌐 MongoDBNext.js (Turbopack)60.734s (~)61.059s (~)0.325s21.12x
🐘 PostgresNitro75.423s (-24.7% 🟢)76.190s (-24.0% 🟢)0.767s21.39x
🐘 PostgresExpress100.276s (~)101.245s (~)0.969s11.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro87.887s (~)88.757s (-0.6%)0.870s21.00x
▲ VercelExpress89.753s (+2.1%)91.502s (+3.5%)1.749s11.02x
▲ VercelNext.js (Turbopack)90.417s (+0.8%)91.030s (~)0.613s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.250s (+1.5%)2.006s (~)0.756s151.00x
💻 LocalNitro1.419s (+0.6%)2.005s (~)0.586s151.14x
💻 LocalNext.js (Turbopack)1.420s (-0.6%)2.005s (~)0.585s151.14x
💻 LocalExpress1.444s (+1.7%)2.005s (~)0.562s151.16x
🐘 PostgresNitro1.902s (-12.2% 🟢)2.079s (-31.0% 🟢)0.177s151.52x
🌐 MongoDBNext.js (Turbopack)2.167s (+2.0%)3.007s (~)0.839s101.73x
🐘 PostgresExpress2.279s (-0.9%)3.014s (~)0.736s101.82x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.579s (+12.7% 🔺)3.570s (+10.4% 🔺)0.992s91.00x
▲ VercelNext.js (Turbopack)2.599s (+7.0% 🔺)3.347s (-0.5%)0.749s91.01x
▲ VercelNitro2.631s (+3.4%)3.488s (-10.1% 🟢)0.857s91.02x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.464s (-2.3%)3.007s (~)0.543s101.00x
🌐 RedisNext.js (Turbopack)2.491s (~)3.008s (~)0.516s101.01x
💻 LocalExpress2.652s (~)3.008s (~)0.356s101.08x
💻 LocalNitro2.671s (+1.6%)3.007s (~)0.336s101.08x
🌐 MongoDBNext.js (Turbopack)4.724s (-1.2%)5.175s (~)0.451s61.92x
🐘 PostgresNitro7.979s (+1.4%)8.281s (-3.0%)0.302s43.24x
🐘 PostgresExpress8.853s (+12.1% 🔺)9.287s (+12.2% 🔺)0.434s43.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.667s (-15.5% 🟢)3.547s (-10.4% 🟢)0.880s91.00x
▲ VercelNext.js (Turbopack)2.977s (-3.6%)3.830s (-10.6% 🟢)0.853s81.12x
▲ VercelExpress3.519s (+13.8% 🔺)4.581s (+16.8% 🔺)1.062s71.32x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.079s (~)4.725s (~)0.645s71.00x
💻 LocalExpress7.650s (~)8.018s (~)0.368s41.88x
💻 LocalNitro7.689s (-1.5%)8.018s (~)0.329s41.88x
💻 LocalNext.js (Turbopack)7.855s (+7.0% 🔺)8.520s (+6.3% 🔺)0.665s41.93x
🌐 MongoDBNext.js (Turbopack)9.822s (~)10.345s (~)0.523s32.41x
🐘 PostgresExpress46.021s (-7.2% 🟢)46.145s (-8.0% 🟢)0.124s111.28x
🐘 PostgresNitro48.474s (-2.5%)49.124s (-2.0%)0.650s111.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.106s (-1.0%)3.966s (-13.2% 🟢)0.860s81.00x
▲ VercelNitro3.472s (+9.5% 🔺)4.633s (+6.6% 🔺)1.161s71.12x
▲ VercelNext.js (Turbopack)3.664s (+8.4% 🔺)4.686s (+2.1%)1.022s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.235s (~)2.006s (~)0.771s151.00x
💻 LocalNext.js (Turbopack)1.431s (~)2.006s (~)0.575s151.16x
💻 LocalNitro1.437s (+1.2%)2.006s (~)0.569s151.16x
💻 LocalExpress1.456s (+1.6%)2.005s (~)0.549s151.18x
🐘 PostgresNitro2.071s (+11.9% 🔺)2.833s (+40.8% 🔺)0.762s111.68x
🌐 MongoDBNext.js (Turbopack)2.154s (-2.6%)3.008s (~)0.854s101.74x
🐘 PostgresExpress2.240s (+12.0% 🔺)2.835s (+9.1% 🔺)0.596s111.81x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.240s (-6.7% 🟢)2.955s (-15.9% 🟢)0.715s111.00x
▲ VercelNitro2.302s (+3.3%)3.381s (-1.5%)1.079s91.03x
▲ VercelExpress2.357s (+6.0% 🔺)3.357s (+2.7%)1.001s91.05x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.485s (~)3.008s (~)0.523s101.00x
💻 LocalNext.js (Turbopack)2.680s (+3.0%)3.009s (~)0.328s101.08x
💻 LocalNitro2.736s (+0.6%)3.008s (~)0.272s101.10x
💻 LocalExpress2.889s (+4.3%)3.111s (+3.4%)0.222s101.16x
🌐 MongoDBNext.js (Turbopack)4.718s (~)5.177s (~)0.459s61.90x
🐘 PostgresNitro10.126s (+14.9% 🔺)10.704s (+15.3% 🔺)0.578s34.07x
🐘 PostgresExpress11.630s (-5.6% 🟢)12.040s (-7.7% 🟢)0.410s34.68x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.448s (-2.7%)3.535s (~)1.087s91.00x
▲ VercelExpress2.518s (-10.9% 🟢)3.535s (-6.0% 🟢)1.017s91.03x
▲ VercelNext.js (Turbopack)2.582s (+2.6%)3.484s (+4.4%)0.902s91.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.087s (+1.4%)4.724s (+3.1%)0.637s71.00x
💻 LocalNitro8.335s (~)9.021s (~)0.686s42.04x
💻 LocalNext.js (Turbopack)8.341s (+13.7% 🔺)9.016s (+16.1% 🔺)0.676s42.04x
💻 LocalExpress8.732s (+3.7%)9.022s (~)0.290s42.14x
🌐 MongoDBNext.js (Turbopack)9.795s (~)10.348s (~)0.553s32.40x
🐘 PostgresNitro49.258s (+5.0% 🔺)50.118s (+6.3% 🔺)0.860s112.05x
🐘 PostgresExpress51.907s (-1.3%)52.125s (-1.9%)0.218s112.70x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.748s (-2.4%)3.545s (-1.9%)0.796s91.00x
▲ VercelNext.js (Turbopack)3.069s (-19.1% 🟢)3.891s (-23.3% 🟢)0.822s81.12x
▲ VercelNitro3.959s (+21.6% 🔺)4.889s (+20.2% 🔺)0.930s71.44x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)0.146s (+0.6%)1.000s (~)0.001s (-8.3% 🟢)1.007s (~)0.861s101.00x
💻 LocalNext.js (Turbopack)0.146s (+3.6%)1.001s (~)0.012s (+13.3% 🔺)1.017s (~)0.871s101.00x
💻 LocalNitro0.174s (-1.5%)1.002s (~)0.011s (-7.3% 🟢)1.017s (~)0.843s101.19x
💻 LocalExpress0.186s (+9.6% 🔺)1.002s (~)0.012s (+7.3% 🔺)1.017s (~)0.831s101.27x
🌐 MongoDBNext.js (Turbopack)0.481s (-0.6%)0.967s (+0.6%)0.002s (+7.1% 🔺)1.008s (~)0.527s103.30x
🐘 PostgresNitro1.357s (-39.9% 🟢)1.730s (-37.8% 🟢)0.001s (~)2.014s (-33.2% 🟢)0.657s109.30x
🐘 PostgresExpress2.359s (-1.4%)2.684s (+1.3%)0.001s (+7.7% 🔺)3.016s (~)0.657s1016.17x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.908s (-16.3% 🟢)2.642s (-2.9%)0.342s (+86.5% 🔺)3.591s (-6.1% 🟢)1.683s101.00x
▲ VercelNext.js (Turbopack)2.065s (+2.9%)2.548s (-3.1%)0.231s (+1.6%)3.251s (-5.8% 🟢)1.187s101.08x
▲ VercelNitro2.361s (+16.7% 🔺)2.623s (+2.0%)0.321s (+48.2% 🔺)3.715s (+11.0% 🔺)1.354s101.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro10/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local9/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local8/12
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
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

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

@TooTallNate@VaguelySerious@karthikscale3