') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); refactor: use `this` value serialization for builtin step functions by TooTallNate · Pull Request #1413 · vercel/workflow · GitHub
Skip to content

refactor: use this value serialization for builtin step functions - #1413

Merged
TooTallNate merged 2 commits into
mainfrom
refactor/builtins-use-this-value
Mar 17, 2026
Merged

refactor: use this value serialization for builtin step functions#1413
TooTallNate merged 2 commits into
mainfrom
refactor/builtins-use-this-value

Conversation

@TooTallNate

Copy link
Copy Markdown
Member

Summary

  • Refactor builtin step functions (__builtin_response_json, __builtin_response_text, __builtin_response_array_buffer) to use this instead of an explicit res parameter, leveraging the useStep() proxy's this value serialization support
  • Assign useStep() proxies directly onto Request.prototype and Response.prototype instead of wrapping them in class methods that forward this as an argument
  • Remove unused duplicate packages/core/src/builtins.ts (the canonical copy lives in packages/workflow/src/internal/builtins.ts)

Refactor builtin step functions (__builtin_response_json, _text,
_array_buffer) to use `this` instead of an explicit parameter,
leveraging the useStep() proxy's this value serialization support.
- Assign useStep() proxies directly onto Request.prototype and
Response.prototype instead of wrapping them in class methods
- Update builtin function signatures to use `this: Request | Response`
- Remove unused duplicate builtins file from @workflow/core
(the canonical copy lives in workflow/src/internal/builtins.ts)
@TooTallNate
TooTallNate requested a review from a team as a code ownerMarch 16, 2026 23:51
CopilotAI review requested due to automatic review settings March 16, 2026 23:51
@vercel

vercelBot commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Mar 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5ac88af

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

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
workflowPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/world-testingPatch
@workflow/aiPatch
@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

@github-actions

github-actionsBot commented Mar 16, 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.035s (-14.2% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.041s (-0.7%)1.005s (~)0.964s101.18x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.35x
🌐 RedisNext.js (Turbopack)0.053s1.005s0.952s101.53x
🐘 PostgresExpress0.059s (-35.8% 🟢)1.011s (~)0.951s101.69x
🐘 PostgresNext.js (Turbopack)0.060s1.011s0.951s101.71x
🐘 PostgresNitro0.060s (-10.3% 🟢)1.011s (~)0.951s101.71x
🌐 MongoDBNext.js (Turbopack)0.117s1.008s0.891s103.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.539s (-28.5% 🟢)2.852s (+5.6% 🔺)2.314s101.00x
▲ VercelExpress0.685s (+21.5% 🔺)3.307s (+20.5% 🔺)2.623s101.27x
▲ VercelNitro0.805s (+41.5% 🔺)3.135s (+19.2% 🔺)2.331s101.49x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.090s (-3.3%)2.006s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.116s2.006s0.890s101.02x
💻 LocalExpress1.127s (~)2.006s (~)0.879s101.03x
🌐 RedisNext.js (Turbopack)1.130s2.007s0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.135s2.013s0.879s101.04x
🐘 PostgresNitro1.141s (-1.9%)2.013s (~)0.872s101.05x
🐘 PostgresExpress1.148s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.336s2.009s0.673s101.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.988s (-2.6%)3.880s (-5.6% 🟢)1.892s101.00x
▲ VercelExpress2.029s (-7.4% 🟢)4.191s (-1.8%)2.161s101.02x
▲ VercelNext.js (Turbopack)2.150s (-2.7%)4.023s (+3.9%)1.874s101.08x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.604s (-2.6%)11.021s (~)0.417s31.00x
🌐 RedisNext.js (Turbopack)10.758s11.023s0.266s31.01x
💻 LocalNext.js (Turbopack)10.780s11.022s0.241s31.02x
🐘 PostgresNext.js (Turbopack)10.851s11.040s0.189s31.02x
💻 LocalExpress10.900s (~)11.022s (~)0.122s31.03x
🐘 PostgresExpress10.924s (~)11.042s (~)0.119s31.03x
🐘 PostgresNitro10.968s (+0.8%)11.377s (+3.0%)0.410s31.03x
🌐 MongoDBNext.js (Turbopack)12.292s13.019s0.727s31.16x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.139s (-7.9% 🟢)17.991s (-10.6% 🟢)1.852s21.00x
▲ VercelNitro16.701s (~)18.280s (+1.1%)1.579s21.03x
▲ VercelNext.js (Turbopack)17.395s (+1.2%)18.539s (-3.4%)1.145s21.08x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.648s (-3.0%)27.052s (-3.6%)0.403s31.00x
🌐 RedisNext.js (Turbopack)26.826s27.052s0.226s31.01x
🐘 PostgresNext.js (Turbopack)27.079s27.730s0.651s31.02x
💻 LocalNext.js (Turbopack)27.122s28.053s0.932s31.02x
🐘 PostgresExpress27.123s (-0.7%)28.064s (~)0.941s31.02x
🐘 PostgresNitro27.196s (~)28.066s (~)0.869s31.02x
💻 LocalExpress27.468s (~)28.053s (~)0.584s31.03x
🌐 MongoDBNext.js (Turbopack)30.427s31.033s0.606s21.14x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro42.849s (-2.3%)44.773s (-1.8%)1.923s21.00x
▲ VercelExpress44.597s (+3.9%)46.240s (+4.4%)1.642s21.04x
▲ VercelNext.js (Turbopack)45.094s (+3.3%)46.526s (+2.4%)1.432s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.481s54.097s0.616s21.00x
🐘 PostgresExpress54.132s (~)54.603s (-0.9%)0.471s21.01x
🐘 PostgresNitro54.240s (~)55.105s (~)0.865s21.01x
🐘 PostgresNext.js (Turbopack)54.307s54.602s0.294s21.02x
💻 LocalNitro54.771s (-3.3%)55.099s (-3.5%)0.328s21.02x
💻 LocalNext.js (Turbopack)55.893s56.101s0.208s21.05x
💻 LocalExpress56.610s (~)57.102s (~)0.492s21.06x
🌐 MongoDBNext.js (Turbopack)60.656s61.059s0.404s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express92.767s (-2.2%)94.472s (-2.2%)1.705s11.00x
▲ VercelNext.js (Turbopack)94.677s (~)96.463s (-2.8%)1.786s11.02x
▲ VercelNitro95.760s (+2.6%)101.859s (+6.1% 🔺)6.099s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.357s2.007s0.650s151.00x
🐘 PostgresNitro1.402s (~)2.011s (~)0.609s151.03x
🐘 PostgresExpress1.405s (~)2.011s (~)0.606s151.04x
💻 LocalNitro1.453s (-3.1%)2.005s (~)0.553s151.07x
🐘 PostgresNext.js (Turbopack)1.456s2.011s0.555s151.07x
💻 LocalExpress1.480s (-3.7%)2.006s (~)0.525s151.09x
💻 LocalNext.js (Turbopack)1.509s2.005s0.496s151.11x
🌐 MongoDBNext.js (Turbopack)2.160s3.008s0.849s101.59x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.178s (-16.3% 🟢)3.869s (-12.5% 🟢)1.690s81.00x
▲ VercelExpress2.228s (-10.8% 🟢)4.361s (+15.2% 🔺)2.133s71.02x
▲ VercelNext.js (Turbopack)3.094s (+8.5% 🔺)4.943s (+7.9% 🔺)1.849s71.42x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.523s (+0.8%)3.013s (~)0.489s101.00x
🌐 RedisNext.js (Turbopack)2.594s3.009s0.415s101.03x
🐘 PostgresNitro2.615s (+3.4%)3.014s (~)0.398s101.04x
💻 LocalNitro2.624s (-8.1% 🟢)3.108s (+3.3%)0.484s101.04x
🐘 PostgresNext.js (Turbopack)2.638s3.013s0.375s101.05x
💻 LocalNext.js (Turbopack)2.657s3.007s0.350s101.05x
💻 LocalExpress2.828s (-6.3% 🟢)3.109s (-17.3% 🟢)0.280s101.12x
🌐 MongoDBNext.js (Turbopack)4.638s5.176s0.538s61.84x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.500s (-5.2% 🟢)5.240s (+32.9% 🔺)2.740s61.00x
▲ VercelNitro2.618s (+3.6%)4.444s (-2.6%)1.825s81.05x
▲ VercelExpress2.627s (-4.6%)3.970s (-1.1%)1.343s81.05x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro4.000s (+1.2%)4.587s (+3.2%)0.587s71.00x
🐘 PostgresExpress4.047s (~)4.588s (~)0.541s71.01x
🌐 RedisNext.js (Turbopack)4.263s5.011s0.748s61.07x
🐘 PostgresNext.js (Turbopack)4.393s5.018s0.625s61.10x
💻 LocalNitro6.684s (-16.6% 🟢)7.015s (-20.0% 🟢)0.331s51.67x
💻 LocalNext.js (Turbopack)7.569s8.017s0.448s41.89x
💻 LocalExpress8.195s (-4.9%)9.021s (~)0.826s42.05x
🌐 MongoDBNext.js (Turbopack)10.070s10.350s0.280s32.52x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.993s (+8.1% 🔺)4.754s (+23.3% 🔺)1.760s71.00x
▲ VercelNitro3.557s (+22.8% 🔺)5.087s (+14.3% 🔺)1.530s61.19x
▲ VercelNext.js (Turbopack)3.675s (+18.1% 🔺)5.144s (-4.6%)1.469s61.23x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.258s2.007s0.749s151.00x
🐘 PostgresNitro1.401s (-2.0%)2.011s (~)0.610s151.11x
🐘 PostgresExpress1.409s (~)2.011s (~)0.602s151.12x
🐘 PostgresNext.js (Turbopack)1.410s2.010s0.600s151.12x
💻 LocalNitro1.471s (-2.9%)2.004s (~)0.533s151.17x
💻 LocalExpress1.502s (-3.3%)2.006s (~)0.503s151.19x
💻 LocalNext.js (Turbopack)1.517s2.072s0.555s151.21x
🌐 MongoDBNext.js (Turbopack)2.198s3.008s0.810s101.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.235s (+1.8%)4.106s (~)1.872s81.00x
▲ VercelNext.js (Turbopack)2.302s (+9.6% 🔺)4.182s (+17.8% 🔺)1.880s81.03x
▲ VercelExpress2.332s (+13.1% 🔺)4.103s (+11.9% 🔺)1.771s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.561s (-0.5%)3.012s (~)0.451s101.00x
🌐 RedisNext.js (Turbopack)2.600s3.008s0.409s101.02x
💻 LocalNitro2.607s (-12.7% 🟢)3.008s (-18.2% 🟢)0.401s101.02x
🐘 PostgresExpress2.663s (+6.4% 🔺)3.114s (+3.4%)0.451s101.04x
🐘 PostgresNext.js (Turbopack)2.676s3.013s0.337s101.04x
💻 LocalNext.js (Turbopack)2.778s3.208s0.430s101.08x
💻 LocalExpress2.904s (~)3.344s (~)0.440s91.13x
🌐 MongoDBNext.js (Turbopack)4.620s5.177s0.557s61.80x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.294s (-4.9%)3.865s (-4.6%)1.571s91.00x
▲ VercelNext.js (Turbopack)2.965s (+18.4% 🔺)4.805s (+15.4% 🔺)1.840s71.29x
▲ VercelNitro3.111s (+10.5% 🔺)5.309s (+12.3% 🔺)2.198s61.36x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.977s (-0.6%)4.590s (+3.2%)0.613s71.00x
🐘 PostgresExpress4.096s (+4.1%)4.735s (+3.1%)0.638s71.03x
🌐 RedisNext.js (Turbopack)4.180s5.012s0.831s61.05x
🐘 PostgresNext.js (Turbopack)4.514s5.015s0.501s61.14x
💻 LocalNitro7.440s (-13.4% 🟢)8.016s (-11.2% 🟢)0.576s41.87x
💻 LocalNext.js (Turbopack)8.428s9.016s0.588s42.12x
💻 LocalExpress8.671s (~)9.022s (~)0.351s42.18x
🌐 MongoDBNext.js (Turbopack)9.796s10.349s0.554s32.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.952s (+3.8%)4.203s (-7.2% 🟢)1.251s81.00x
▲ VercelNitro3.369s (+23.1% 🔺)5.007s (+27.7% 🔺)1.637s61.14x
▲ VercelNext.js (Turbopack)3.626s (-7.8% 🟢)5.599s (-2.9%)1.973s61.23x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.132s (-32.1% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.162s1.002s0.011s1.017s0.855s101.23x
🌐 RedisNext.js (Turbopack)0.176s1.000s0.001s1.008s0.831s101.34x
💻 LocalExpress0.196s (-4.2%)1.003s (~)0.011s (-8.9% 🟢)1.017s (~)0.821s101.49x
🐘 PostgresExpress0.214s (+1.1%)0.996s (~)0.001s (-6.7% 🟢)1.014s (~)0.799s101.62x
🐘 PostgresNitro0.218s (+4.0%)0.997s (~)0.001s (-6.7% 🟢)1.014s (~)0.796s101.65x
🐘 PostgresNext.js (Turbopack)0.218s1.002s0.002s1.013s0.795s101.65x
🌐 MongoDBNext.js (Turbopack)0.515s0.936s0.001s1.009s0.494s103.90x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.574s (-5.8% 🟢)2.398s (-18.5% 🟢)0.005s (-17.5% 🟢)2.953s (-15.5% 🟢)1.378s101.00x
▲ VercelNitro1.633s (-9.5% 🟢)2.530s (-18.2% 🟢)0.005s (-9.6% 🟢)3.173s (-14.3% 🟢)1.540s101.04x
▲ VercelExpress1.734s (~)2.871s (+4.3%)0.006s (+23.1% 🔺)3.470s (+3.5%)1.736s101.10x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNitro5/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local5/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

@github-actions

github-actionsBot commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production560067627
✅ 💻 Local Development600084684
✅ 📦 Local Production600084684
✅ 🐘 Local Postgres600084684
✅ 🪟 Windows540357
❌ 🌍 Community Worlds1165515186
✅ 📋 Other144027171
Total2674553643093

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • 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 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
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • 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
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro5007
✅ example5007
✅ express5007
✅ fastify5007
✅ hono5007
✅ nextjs-turbopack5502
✅ nextjs-webpack5502
✅ nitro5007
✅ nuxt5007
✅ sveltekit5007
✅ vite5007
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4809
✅ express-stable4809
✅ fastify-stable4809
✅ hono-stable4809
✅ nextjs-turbopack-canary5403
✅ nextjs-turbopack-stable5403
✅ nextjs-webpack-canary5403
✅ nextjs-webpack-stable5403
✅ nitro-stable4809
✅ nuxt-stable4809
✅ sveltekit-stable4809
✅ vite-stable4809
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4809
✅ express-stable4809
✅ fastify-stable4809
✅ hono-stable4809
✅ nextjs-turbopack-canary5403
✅ nextjs-turbopack-stable5403
✅ nextjs-webpack-canary5403
✅ nextjs-webpack-stable5403
✅ nitro-stable4809
✅ nuxt-stable4809
✅ sveltekit-stable4809
✅ vite-stable4809
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4809
✅ express-stable4809
✅ fastify-stable4809
✅ hono-stable4809
✅ nextjs-turbopack-canary5403
✅ nextjs-turbopack-stable5403
✅ nextjs-webpack-canary5403
✅ nextjs-webpack-stable5403
✅ nitro-stable4809
✅ nuxt-stable4809
✅ sveltekit-stable4809
✅ vite-stable4809
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack5403
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4809
✅ e2e-local-postgres-nest-stable4809
✅ e2e-local-prod-nest-stable4809

📋 View full workflow run

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors the internal built-in step functions used by the workflow VM to rely on serialized this values (method-style invocation) instead of explicitly passing Request/Response as parameters, and removes an unused duplicate builtins entrypoint from @workflow/core.

Changes:

  • Update __builtin_response_* steps to use this: Request | Response and call this.{arrayBuffer,json,text}().
  • Switch VM Request/Response implementations to attach arrayBuffer/json/text via useStep on the prototypes (so this is captured/serialized).
  • Remove the unused @workflow/core./builtins export and source file.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
packages/workflow/src/internal/builtins.tsBuiltin step functions now use the serialized this value instead of an explicit parameter.
packages/core/src/workflow.tsVM Request/Response now wire body-reading methods directly from useStep, enabling this serialization.
packages/core/src/builtins.tsRemoves duplicate/unused builtin step definitions from core.
packages/core/package.jsonRemoves ./builtins export mapping from @workflow/core.
.changeset/hungry-spoons-attack.mdPublishes patch release notes for the refactor/removal.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment threadpackages/core/src/workflow.ts Outdated
Comment on lines +467 to +471
Request.prototype.arrayBuffer = useStep<[], ArrayBuffer>(
'__builtin_response_array_buffer'
);
Request.prototype.json = useStep<[], any>('__builtin_response_json');
Request.prototype.text = useStep<[], string>('__builtin_response_text');
Comment threadpackages/core/src/workflow.ts Outdated
Comment on lines +577 to +581
Response.prototype.arrayBuffer = useStep<[], ArrayBuffer>(
'__builtin_response_array_buffer'
);
Response.prototype.json = useStep<[], any>('__builtin_response_json');
Response.prototype.text = useStep<[], string>('__builtin_response_text');

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGMTM if tests are passing :)

@TooTallNate
TooTallNate enabled auto-merge (squash) March 17, 2026 00:25
@TooTallNate
TooTallNate merged commit dcb0761 into mainMar 17, 2026
166 of 168 checks passed
@TooTallNate
TooTallNate deleted the refactor/builtins-use-this-value branch March 17, 2026 00:33
@ghostghost mentioned this pull request Mar 17, 2026
pranaygp added a commit that referenced this pull request Mar 17, 2026
The rebase onto main didn't fully adopt PR #1413's refactor of response
builtins to use `this` instead of explicit parameters. The old pattern
(resJson(this) wrappers) passed `this` as an argument, but the step
functions now expect `this` to be set via method call context.
Switch to Object.defineProperties on Request/Response prototypes,
matching main's approach. Also document WORKFLOW_PUBLIC_MANIFEST=1
for local e2e testing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pranaygp added a commit that referenced this pull request Mar 17, 2026
The rebase onto main didn't fully adopt PR #1413's refactor of response
builtins to use `this` instead of explicit parameters. The old pattern
(resJson(this) wrappers) passed `this` as an argument, but the step
functions now expect `this` to be set via method call context.
Switch to Object.defineProperties on Request/Response prototypes,
matching main's approach. Also document WORKFLOW_PUBLIC_MANIFEST=1
for local e2e testing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pranaygp added a commit that referenced this pull request Mar 18, 2026
The rebase onto main didn't fully adopt PR #1413's refactor of response
builtins to use `this` instead of explicit parameters. The old pattern
(resJson(this) wrappers) passed `this` as an argument, but the step
functions now expect `this` to be set via method call context.
Switch to Object.defineProperties on Request/Response prototypes,
matching main's approach. Also document WORKFLOW_PUBLIC_MANIFEST=1
for local e2e testing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pranaygp added a commit that referenced this pull request Mar 19, 2026
The rebase onto main didn't fully adopt PR #1413's refactor of response
builtins to use `this` instead of explicit parameters. The old pattern
(resJson(this) wrappers) passed `this` as an argument, but the step
functions now expect `this` to be set via method call context.
Switch to Object.defineProperties on Request/Response prototypes,
matching main's approach. Also document WORKFLOW_PUBLIC_MANIFEST=1
for local e2e testing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pranaygp added a commit that referenced this pull request Mar 20, 2026
* Add support for calling `start()` directly inside workflow functions
Enable `start()` to work in workflow context by routing through an
internal step (`__workflow_start`), reusing existing step infrastructure
with no new event types or server changes needed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address PR review feedback
- Use typeof check instead of truthiness for WORKFLOW_START symbol
- Validate start() options in workflow context (reject unsupported options like world)
- Set maxRetries=0 on __workflow_start step to prevent orphaned child runs
- Add unit tests for createStart factory (6 tests)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Make Run serializable in workflow context with step-backed methods
- Add Run serialization via __serializable marker + custom Run reducer/reviver
in the serialization module (avoids SWC plugin injecting class-serialization imports)
- Create WorkflowRun class factory (packages/core/src/workflow/run.ts) with
step-backed methods: cancel(), status, returnValue, workflowName, createdAt,
startedAt, completedAt, exists
- Register 8 built-in steps (__run_cancel, __run_status, etc.) in step-handler
- Update __workflow_start to return full Run object (serialized → WorkflowRun in VM)
- Update createStart to pass through step result directly
- Update docs to reflect full Run support in workflow context
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix start() in workflow VM by delegating from api-workflow stub
The workflow VM loads api-workflow.ts (via the "workflow" export condition)
which stubs all runtime functions. The start stub needs to check for the
injected WORKFLOW_START symbol and delegate to it, otherwise start() throws
"doesn't allow this runtime usage" in the workflow context.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address PR review: fix stale WORKFLOW_SERIALIZE comments and register Run in host registry
- Update comments in step-handler.ts and start.ts to reference the actual
serialization mechanism (Run reducer with __serializable marker) instead
of the stale WORKFLOW_SERIALIZE reference
- Register Run class in the host's class registry from step-handler.ts so
the Run reviver can deserialize Run/WorkflowRun instances in step context
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add docs for recursive/repeating workflows and deploymentId: "latest"
- Document using start() for self-chaining workflows to avoid large event logs
- Add examples for batch processing and cron-like repeating patterns
- Document deploymentId: "latest" option with type safety warning
- Update skill file with same patterns
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Return full Run object from startFromWorkflow e2e workflow
Update the e2e workflow to return the childRun object directly instead of
just childRun.runId, exercising Run serialization across the workflow boundary.
Update e2e test assertions to match.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add recursive fibonacci e2e test for start() in workflow
Demonstrates recursive workflow composition: fibonacciWorkflow starts
new instances of itself via start() + Promise.all to compute fib(6)=8,
fanning out across independent workflow runs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Move Run method steps to builtins with "use step" directives
Refactor: instead of manually registering Run method steps via
registerStepFunction in step-handler.ts, define them as proper "use step"
functions in builtins.ts with __builtin_ prefix. This leverages the
existing SWC plugin infrastructure — functions starting with "__builtin"
get stable bare-name step IDs.
- Add __builtin_run_{cancel,status,return_value,...} to both builtins files
- Use dynamic import() for getRun inside step bodies to avoid pulling
Node.js modules into the workflow bundle
- Remove manual registerStepFunction calls from step-handler.ts
- Update WorkflowRun step references to __builtin_run_* names
- Fix step name display in web observability: fall back to raw name
instead of "?" for built-in steps that don't follow step//module//fn format
- Add fibonacciWorkflow default args for nextjs-turbopack workbench UI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Render Run objects as clickable links in web observability UI
- Add RunRef type and Run reviver to observabilityRevivers so serialized
Run objects are hydrated as RunRef instead of showing raw Uint8Array
- Add RunRefInline component (purple badge with run ID) that navigates
to the target run on click, matching the StreamRef pattern
- Thread onRunClick callback through the component chain:
WorkflowTraceViewer → EntityDetailPanel → AttributePanel → DataInspector
- Wire up navigation in the web app's run-detail-view
- Add startFromWorkflow default args for workbench UI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Throw error instead of silent fallback when Run class not in registry
Address PR review: the Run reviver now throws if the class isn't found
in the registry, instead of silently returning a plain { runId } object
that would break the assumption of getting a valid Run instance.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix e2e failures: allow retries on Run getter steps, fix docs code samples
- Remove maxRetries=0 from read-only Run getter steps (status, returnValue,
workflowName, etc.) — these are safe to retry and need retries when the
child workflow hasn't completed within the step timeout. Only cancel
keeps maxRetries=0.
- Fix docs code samples: use correct import path (workflow/api not workflow),
add declare statements for helper functions used in examples.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use standard step//module//function naming for built-in steps
Update the SWC plugin's __builtin_ special case to generate proper
step//@workflow/core//{name} IDs instead of bare function names. This
makes parseStepName work correctly for built-in steps, showing:
- StepName: "Run#returnValue" (not "__builtin_run_return_value")
- ModuleSpecifier: "@workflow/core" (not the raw function name)
Convention: __builtin_Run_cancel → step//@workflow/core//Run#cancel
(uppercase prefix + underscore → instance method # notation)
- Move __workflow_start to builtins.ts as __builtin_start
- Rename __builtin_run_* to __builtin_Run_* for proper # notation
- Update WorkflowRun step refs to use full step// IDs
- Remove manual registerStepFunction from step-handler.ts
- Update SWC spec.md with new naming examples
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove SWC __builtin special case, use standard step naming for builtins
Remove the SWC plugin's __builtin_ special case so built-in steps get
standard step//{module}@{version}//{fn} IDs like any other step. This
makes parseStepName work correctly, showing proper StepName and
ModuleSpecifier in observability.
The VM reconstructs the same IDs via builtinStepId() which uses the
@workflow/core version to build: step//workflow/internal/builtins@{v}//{fn}
- Remove __builtin special case from SWC plugin (revert to original)
- Add builtinStepId() helper shared by workflow.ts, start.ts, run.ts
- Rename Run steps: __builtin_Run_cancel → Run_cancel, etc.
- Rename start step: __builtin_start → start
- Move start step from manual registerStepFunction to builtins.ts
- Keep __builtin_response_* names unchanged (pre-existing)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use static class methods for Run steps to get Run.method naming
Refactor Run method steps from standalone functions (Run_cancel) to
static methods on a Run class, so the SWC plugin generates step IDs
with the standard static method convention: Run.cancel, Run.returnValue,
Run.status, etc.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address PR review: tests, docs warnings, skill fix
- Add TODO on Run.returnValue about polling blocking (replace with system
hooks once AbortSignal/AbortController PR lands)
- Add docs callout warning about returnValue holding workers alive
- Fix SKILL.md contradiction that said start() can't be used in workflows
- Enhance suspension test to assert step arguments are forwarded
- Add WorkflowRun unit tests: serializable marker, runId, registry, delegation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix response builtins: adopt this-serialization from PR #1413
The rebase onto main didn't fully adopt PR #1413's refactor of response
builtins to use `this` instead of explicit parameters. The old pattern
(resJson(this) wrappers) passed `this` as an argument, but the step
functions now expect `this` to be set via method call context.
Switch to Object.defineProperties on Request/Response prototypes,
matching main's approach. Also document WORKFLOW_PUBLIC_MANIFEST=1
for local e2e testing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address docs review: returnValue polling is temporary, link to start() API ref
- Update returnValue warning to note this is a temporary implementation
that will be replaced with internal hooks
- Replace inline deploymentId: "latest" docs with link to the existing
start() API reference which already covers it comprehensively
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix e2e tests: replace collectedRunIds with trackRun API
PR #1426 replaced the manual collectedRunIds array with a trackRun()
helper. The start() wrapper already auto-tracks, so just remove the
manual push calls and add trackRun for the child run.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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@pranaygp@VaguelySerious