Skip to content

Conversation

@adriandlam
Copy link
Contributor

@adriandlam adriandlam commented Dec 18, 2025

add nextjs pages router support

fixes #143

@changeset-bot
Copy link

changeset-bot bot commented Dec 18, 2025

🦋 Changeset detected

Latest commit: d0bdf71

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

This PR includes changesets to release 4 packages
Name Type
@workflow/next Patch
workflow Patch
@workflow/ai Patch
@workflow/world-testing Patch

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
Copy link
Contributor

vercel bot commented Dec 18, 2025

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

Project Deployment Review Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Dec 19, 2025 0:24am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Dec 19, 2025 0:24am
example-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-astro-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-express-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-fastify-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-hono-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-nextjs-pages-router Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-nitro-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-nuxt-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-sveltekit-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workbench-vite-workflow Ready Ready Preview, Comment Dec 19, 2025 0:24am
workflow-docs Ready Ready Preview, Comment Dec 19, 2025 0:24am

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 0.040s (+1.5%) 1.014s (~) 0.974s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.041s (-1.0%) 1.017s (~) 0.976s 10 1.02x
💻 Local Nitro 0.044s (+2.1%) 1.007s (~) 0.963s 10 1.10x
💻 Local Express 0.045s (+3.9%) 1.008s (~) 0.963s 10 1.13x
💻 Local Next.js (Turbopack) 0.053s (+47.8% 🔺) 1.025s (+0.8%) 0.972s 10 1.33x
🌐 MongoDB Next.js (Turbopack) 0.079s (+8.9% 🔺) 1.016s (~) 0.938s 10 1.97x
🌐 Turso Next.js (Turbopack) 0.108s (+8.0% 🔺) 1.013s (~) 0.905s 10 2.71x
🐘 Postgres Next.js (Turbopack) 0.191s (+27.3% 🔺) 1.021s (~) 0.830s 10 4.79x
🐘 Postgres Nitro 0.293s (-13.3% 🟢) 1.013s (~) 0.720s 10 7.34x
🐘 Postgres Express 0.296s (-23.6% 🟢) 1.014s (~) 0.718s 10 7.43x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.509s (+9.2% 🔺) 1.593s (+13.1% 🔺) 1.084s 10 1.00x
▲ Vercel Express 0.633s (+20.3% 🔺) 1.660s (+19.2% 🔺) 1.027s 10 1.24x
▲ Vercel Next.js (Turbopack) 0.779s (+41.8% 🔺) 1.656s (+7.7% 🔺) 0.877s 10 1.53x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 1.088s (-0.6%) 2.009s (~) 0.920s 10 1.00x
💻 Local Next.js (Turbopack) 1.097s (+1.4%) 2.011s (~) 0.914s 10 1.01x
🌐 Redis Next.js (Turbopack) 1.100s (~) 2.013s (~) 0.912s 10 1.01x
💻 Local Nitro 1.109s (~) 2.005s (~) 0.896s 10 1.02x
💻 Local Express 1.114s (~) 2.007s (~) 0.893s 10 1.02x
🌐 MongoDB Next.js (Turbopack) 1.301s (~) 2.014s (~) 0.713s 10 1.20x
🌐 Turso Next.js (Turbopack) 1.304s (~) 2.011s (~) 0.708s 10 1.20x
🐘 Postgres Next.js (Turbopack) 2.089s (-13.5% 🟢) 2.416s (-19.8% 🟢) 0.327s 10 1.92x
🐘 Postgres Express 2.140s (-4.2%) 3.016s (~) 0.876s 10 1.97x
🐘 Postgres Nitro 2.149s (-2.0%) 3.014s (~) 0.865s 10 1.97x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.747s (+5.8% 🔺) 3.734s (+4.5%) 0.987s 10 1.00x
▲ Vercel Express 2.774s (+6.0% 🔺) 3.638s (+3.1%) 0.864s 10 1.01x
▲ Vercel Next.js (Turbopack) 2.802s (+8.2% 🔺) 3.648s (~) 0.846s 10 1.02x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 10.580s (~) 11.010s (~) 0.430s 5 1.00x
💻 Local Next.js (Turbopack) 10.622s (+0.7%) 11.014s (~) 0.392s 5 1.00x
🌐 Redis Next.js (Turbopack) 10.698s (~) 11.020s (~) 0.322s 5 1.01x
💻 Local Nitro 10.783s (~) 11.011s (~) 0.228s 5 1.02x
💻 Local Express 10.794s (~) 11.012s (~) 0.219s 5 1.02x
🌐 MongoDB Next.js (Turbopack) 12.057s (-1.3%) 12.831s (-1.5%) 0.774s 5 1.14x
🌐 Turso Next.js (Turbopack) 12.185s (~) 13.021s (~) 0.836s 5 1.15x
🐘 Postgres Next.js (Turbopack) 14.874s (-3.5%) 15.237s (-5.0%) 0.363s 5 1.41x
🐘 Postgres Express 20.373s (~) 20.832s (-1.0%) 0.459s 5 1.93x
🐘 Postgres Nitro 20.408s (+29.4% 🔺) 21.035s (+26.5% 🔺) 0.626s 5 1.93x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 22.165s (+5.2% 🔺) 22.889s (+5.8% 🔺) 0.724s 5 1.00x
▲ Vercel Next.js (Turbopack) 22.437s (+6.3% 🔺) 23.019s (+5.3% 🔺) 0.582s 5 1.01x
▲ Vercel Nitro 22.662s (+10.1% 🔺) 23.603s (+10.9% 🔺) 0.941s 5 1.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 1.357s (+1.4%) 2.008s (~) 0.650s 15 1.00x
🌐 Redis Next.js (Turbopack) 1.361s (+0.6%) 2.010s (~) 0.649s 15 1.00x
💻 Local Next.js (Turbopack) 1.376s (+1.8%) 2.010s (~) 0.634s 15 1.01x
💻 Local Nitro 1.404s (-1.2%) 2.005s (~) 0.602s 15 1.03x
💻 Local Express 1.415s (+1.3%) 2.006s (~) 0.590s 15 1.04x
🐘 Postgres Next.js (Turbopack) 1.748s (-17.7% 🟢) 2.012s (-13.4% 🟢) 0.264s 15 1.29x
🌐 MongoDB Next.js (Turbopack) 2.132s (-1.6%) 3.015s (~) 0.883s 10 1.57x
🌐 Turso Next.js (Turbopack) 2.218s (~) 3.010s (~) 0.792s 10 1.63x
🐘 Postgres Express 2.348s (-3.2%) 3.013s (~) 0.665s 10 1.73x
🐘 Postgres Nitro 2.399s (+12.5% 🔺) 3.012s (+21.8% 🔺) 0.613s 10 1.77x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.973s (+4.5%) 3.919s (+6.8% 🔺) 0.946s 8 1.00x
▲ Vercel Express 3.022s (+10.2% 🔺) 4.022s (+12.9% 🔺) 1.000s 8 1.02x
▲ Vercel Next.js (Turbopack) 3.364s (+14.3% 🔺) 3.987s (+2.2%) 0.623s 8 1.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 2.174s (-1.9%) 3.057s (-3.3%) 0.883s 10 1.00x
💻 Local Nitro 2.190s (-0.7%) 3.165s (~) 0.975s 10 1.01x
💻 Local Next.js (Turbopack) 2.212s (+9.8% 🔺) 3.110s (+22.0% 🔺) 0.899s 10 1.02x
🌐 Starter Next.js (Turbopack) 2.483s (+1.3%) 3.008s (~) 0.526s 10 1.14x
🌐 Redis Next.js (Turbopack) 2.497s (+0.6%) 3.019s (~) 0.523s 10 1.15x
🐘 Postgres Next.js (Turbopack) 2.577s (-6.1% 🟢) 3.015s (~) 0.439s 10 1.19x
🐘 Postgres Nitro 2.755s (-3.1%) 3.022s (~) 0.267s 10 1.27x
🐘 Postgres Express 3.021s (+2.6%) 3.485s (+3.3%) 0.464s 9 1.39x
🌐 MongoDB Next.js (Turbopack) 4.713s (+2.3%) 5.182s (~) 0.469s 6 2.17x
🌐 Turso Next.js (Turbopack) 4.715s (+1.0%) 5.180s (~) 0.465s 6 2.17x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 4.116s (+17.7% 🔺) 4.869s (+15.0% 🔺) 0.753s 7 1.00x
▲ Vercel Next.js (Turbopack) 4.300s (+23.4% 🔺) 5.218s (+28.2% 🔺) 0.918s 6 1.04x
▲ Vercel Nitro 4.744s (+50.9% 🔺) 5.496s (+48.6% 🔺) 0.753s 6 1.15x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 1.380s (+3.1%) 2.008s (~) 0.628s 15 1.00x
🌐 Redis Next.js (Turbopack) 1.386s (+1.7%) 2.009s (~) 0.623s 15 1.00x
💻 Local Next.js (Turbopack) 1.402s (+2.8%) 2.012s (~) 0.610s 15 1.02x
💻 Local Express 1.413s (-0.6%) 2.006s (~) 0.593s 15 1.02x
💻 Local Nitro 1.424s (~) 2.005s (~) 0.582s 15 1.03x
🐘 Postgres Next.js (Turbopack) 1.712s (~) 2.012s (~) 0.300s 15 1.24x
🐘 Postgres Express 1.809s (-7.9% 🟢) 2.010s (-3.2%) 0.201s 15 1.31x
🐘 Postgres Nitro 1.900s (+13.1% 🔺) 2.011s (~) 0.111s 15 1.38x
🌐 MongoDB Next.js (Turbopack) 2.124s (~) 3.016s (~) 0.892s 10 1.54x
🌐 Turso Next.js (Turbopack) 2.219s (-0.7%) 3.010s (~) 0.791s 10 1.61x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.769s (-0.7%) 3.766s (-0.9%) 0.997s 8 1.00x
▲ Vercel Nitro 2.777s (+6.2% 🔺) 3.711s (+6.1% 🔺) 0.934s 9 1.00x
▲ Vercel Express 3.231s (+28.3% 🔺) 4.084s (+15.7% 🔺) 0.853s 8 1.17x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 2.227s (-4.6%) 3.173s (-2.1%) 0.946s 10 1.00x
💻 Local Next.js (Turbopack) 2.277s (+8.8% 🔺) 3.206s (+7.5% 🔺) 0.929s 10 1.02x
💻 Local Express 2.348s (+2.0%) 3.227s (~) 0.879s 10 1.05x
🌐 Starter Next.js (Turbopack) 2.475s (+0.8%) 3.011s (~) 0.536s 10 1.11x
🌐 Redis Next.js (Turbopack) 2.518s (+1.1%) 3.012s (~) 0.494s 10 1.13x
🐘 Postgres Next.js (Turbopack) 2.639s (+7.2% 🔺) 3.021s (~) 0.382s 10 1.19x
🐘 Postgres Express 2.686s (-7.4% 🟢) 3.019s (~) 0.333s 10 1.21x
🐘 Postgres Nitro 2.702s (-1.2%) 3.013s (~) 0.311s 10 1.21x
🌐 Turso Next.js (Turbopack) 4.654s (-2.1%) 5.180s (~) 0.526s 6 2.09x
🌐 MongoDB Next.js (Turbopack) 4.661s (+0.6%) 5.189s (~) 0.528s 6 2.09x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.330s (+10.0% 🔺) 4.108s (+12.4% 🔺) 0.779s 8 1.00x
▲ Vercel Express 3.442s (+14.0% 🔺) 3.965s (+9.3% 🔺) 0.523s 8 1.03x
▲ Vercel Next.js (Turbopack) 3.449s (+14.1% 🔺) 4.130s (+11.6% 🔺) 0.681s 8 1.04x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 0.125s (-2.1%) 1.006s (~) 0.000s (NaN%) 1.011s (~) 0.886s 10 1.00x
💻 Local Next.js (Turbopack) 0.135s (+23.0% 🔺) 1.003s (~) 0.019s (+16.3% 🔺) 1.029s (~) 0.894s 10 1.08x
🌐 Redis Next.js (Turbopack) 0.143s (~) 1.005s (~) 0.000s (NaN%) 1.013s (~) 0.870s 10 1.15x
💻 Local Nitro 0.173s (-4.5%) 0.993s (~) 0.018s (+13.6% 🔺) 1.025s (~) 0.852s 10 1.38x
💻 Local Express 0.176s (+1.3%) 0.992s (~) 0.015s (-13.1% 🟢) 1.021s (~) 0.845s 10 1.41x
🌐 MongoDB Next.js (Turbopack) 0.485s (-2.2%) 0.963s (+1.2%) 0.000s (NaN%) 1.015s (~) 0.530s 10 3.88x
🌐 Turso Next.js (Turbopack) 0.498s (~) 0.948s (~) 0.000s (NaN%) 1.012s (~) 0.514s 10 3.99x
🐘 Postgres Next.js (Turbopack) 0.826s (-27.8% 🟢) 1.312s (-31.1% 🟢) 0.000s (NaN%) 1.417s (-29.8% 🟢) 0.592s 10 6.61x
🐘 Postgres Express 1.277s (-45.7% 🟢) 1.763s (-34.5% 🟢) 0.000s (-100.0% 🟢) 2.013s (-33.3% 🟢) 0.736s 10 10.22x
🐘 Postgres Nitro 2.313s (+59.6% 🔺) 2.733s (+64.0% 🔺) 0.000s (+Infinity% 🔺) 3.014s (+49.8% 🔺) 0.701s 10 18.52x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.884s (+11.4% 🔺) 3.340s (+8.5% 🔺) 0.595s (+40.2% 🔺) 4.442s (+13.8% 🔺) 1.558s 10 1.00x
▲ Vercel Next.js (Turbopack) 3.082s (+15.9% 🔺) 3.476s (+7.0% 🔺) 0.430s (+83.6% 🔺) 4.407s (+12.5% 🔺) 1.326s 10 1.07x
▲ Vercel Express 3.090s (+24.5% 🔺) 3.499s (+15.6% 🔺) 0.445s (+59.4% 🔺) 4.452s (+19.8% 🔺) 1.362s 10 1.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 5/8
🐘 Postgres Next.js (Turbopack) 8/8
▲ Vercel Nitro 5/8
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 289 23 12 324
✅ 💻 Local Development 289 0 8 297
✅ 📦 Local Production 289 0 8 297
✅ 🐘 Local Postgres 289 0 8 297
✅ 🪟 Windows 27 0 0 27
❌ 🌍 Community Worlds 109 11 0 120
Total 1292 34 36 1362

❌ Failed Tests

▲ Vercel Production (23 failed)

nextjs-pages (23 failed):

  • addTenWorkflow
  • addTenWorkflow
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
🌍 Community Worlds (11 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 26 0 1
✅ example 26 0 1
✅ express 26 0 1
✅ fastify 26 0 1
✅ hono 26 0 1
❌ nextjs-pages 3 23 1
✅ nextjs-turbopack 26 0 1
✅ nextjs-webpack 26 0 1
✅ nitro 26 0 1
✅ nuxt 26 0 1
✅ sveltekit 26 0 1
✅ vite 26 0 1
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 26 0 1
✅ express-stable 26 0 1
✅ fastify-stable 26 0 1
✅ hono-stable 26 0 1
✅ nextjs-pages-router-stable 27 0 0
✅ nextjs-turbopack-stable 27 0 0
✅ nextjs-webpack-stable 27 0 0
✅ nitro-stable 26 0 1
✅ nuxt-stable 26 0 1
✅ sveltekit-stable 26 0 1
✅ vite-stable 26 0 1
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 26 0 1
✅ express-stable 26 0 1
✅ fastify-stable 26 0 1
✅ hono-stable 26 0 1
✅ nextjs-pages-router-stable 27 0 0
✅ nextjs-turbopack-stable 27 0 0
✅ nextjs-webpack-stable 27 0 0
✅ nitro-stable 26 0 1
✅ nuxt-stable 26 0 1
✅ sveltekit-stable 26 0 1
✅ vite-stable 26 0 1
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 26 0 1
✅ express-stable 26 0 1
✅ fastify-stable 26 0 1
✅ hono-stable 26 0 1
✅ nextjs-pages-router-stable 27 0 0
✅ nextjs-turbopack-stable 27 0 0
✅ nextjs-webpack-stable 27 0 0
✅ nitro-stable 26 0 1
✅ nuxt-stable 26 0 1
✅ sveltekit-stable 26 0 1
✅ vite-stable 26 0 1
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
❌ mongodb 26 1 0
✅ redis-dev 3 0 0
❌ redis 26 1 0
✅ starter-dev 3 0 0
❌ starter 19 8 0
✅ turso-dev 3 0 0
❌ turso 26 1 0

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@socket-security
Copy link

socket-security bot commented Dec 18, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​react@​19.2.11001008497100
Addednpm/​react-dom@​19.2.11001009298100

View full report

@adriandlam adriandlam force-pushed the feat/support-next-pages-router branch from a524531 to d03acf3 Compare December 18, 2025 22:39
const pagesRouterWrapper = `// biome-ignore-all lint: generated file
/* eslint-disable */
${PAGES_ADAPTER_CODE}
${stepsBundle.replace(/export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\};?/g, 'const POST = stepEntrypoint;')}
Copy link
Contributor

Choose a reason for hiding this comment

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

The regex pattern used to replace the steps bundle export statement is incomplete and will produce invalid JavaScript syntax. The pattern doesn't account for the from 'workflow/runtime' part of the re-export statement.

View Details
📝 Patch Details
diff --git a/packages/astro/src/builder.ts b/packages/astro/src/builder.ts
index 5237247..09dc400 100644
--- a/packages/astro/src/builder.ts
+++ b/packages/astro/src/builder.ts
@@ -91,7 +91,7 @@ export class LocalBuilder extends BaseBuilder {
 
     // Normalize request, needed for preserving request through astro
     stepsRouteContent = stepsRouteContent.replace(
-      /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}\s*;?$/m,
+      /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}(?:\s+from\s+['"][^'"]*['"])?\s*;?$/m,
       `${NORMALIZE_REQUEST_CODE}
 export const POST = async ({request}) => {
   const normalRequest = await normalizeRequest(request);
diff --git a/packages/next/src/builder.ts b/packages/next/src/builder.ts
index 85b7a90..174509e 100644
--- a/packages/next/src/builder.ts
+++ b/packages/next/src/builder.ts
@@ -760,7 +760,7 @@ async function sendPagesResponse(res, webResponse) {
       const pagesRouterWrapper = `// biome-ignore-all lint: generated file
 /* eslint-disable */
 ${PAGES_ADAPTER_CODE}
-${stepsBundle.replace(/export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\};?/g, 'const POST = stepEntrypoint;')}
+${stepsBundle.replace(/export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}(?:\s+from\s+['"][^'"]*['"])?\s*;?/g, 'const POST = stepEntrypoint;')}
 
 export default async function handler(req, res) {
   const webRequest = await convertPagesRequest(req);
diff --git a/packages/sveltekit/src/builder.ts b/packages/sveltekit/src/builder.ts
index 531c754..681e600 100644
--- a/packages/sveltekit/src/builder.ts
+++ b/packages/sveltekit/src/builder.ts
@@ -90,7 +90,7 @@ export class SvelteKitBuilder extends BaseBuilder {
 
     // Replace the default export with SvelteKit-compatible handler
     stepsRouteContent = stepsRouteContent.replace(
-      /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}\s*;?$/m,
+      /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}(?:\s+from\s+['"][^'"]*['"])?\s*;?$/m,
       `${NORMALIZE_REQUEST_CODE}
 export const POST = async ({request}) => {
   const normalRequest = await normalizeRequest(request);

Analysis

Incomplete regex pattern for re-export statement replacement causes invalid JavaScript syntax

What fails: The regex patterns used in pages/astro/sveltekit builders to replace export { stepEntrypoint as POST } statements do not match statements containing the from 'module' clause, resulting in malformed code like const POST = stepEntrypoint; from 'workflow/runtime';

How to reproduce:

  1. Build a Next.js/Astro/SvelteKit project with a workflow step
  2. The base builder's createStepsBundle() method generates an entry with: export { stepEntrypoint as POST } from 'workflow/runtime';
  3. When this gets bundled and the Pages Router/Astro/SvelteKit handlers attempt to replace the export statement using the incomplete regex pattern, the from 'workflow/runtime' clause is left behind
  4. Result: Invalid JavaScript syntax that will fail to parse

Example failure:

Input:

export { stepEntrypoint as POST } from 'workflow/runtime';

Old regex /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\};?/g produces:

const POST = stepEntrypoint; from 'workflow/runtime';

This is invalid JavaScript and will cause a syntax error.

Root cause: The regex patterns in three files do not account for the optional from 'module' clause that esbuild preserves in re-export statements:

  • packages/next/src/builder.ts line 763
  • packages/astro/src/builder.ts line 94
  • packages/sveltekit/src/builder.ts line 93

Solution: Updated regex patterns to optionally match and remove the from 'module' clause:

  • Changed: /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\};?/g (Next.js)
  • Changed: /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}\s*;?$/m (Astro/SvelteKit)
  • To: /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}(?:\s+from\s+['"][^'"]*['"])?\s*;?/g (Next.js)
  • To: /export\s*\{\s*stepEntrypoint\s+as\s+POST\s*\}(?:\s+from\s+['"][^'"]*['"])?\s*;?$/m (Astro/SvelteKit)

The new pattern uses a non-capturing group (?:...) with an optional modifier ? to match the from 'module' clause, handling both single and double quotes.

@adriandlam
Copy link
Contributor Author

update: we just need this PR merged: vercel/vercel which adds support for the experimentalTriggers config, then E2E Vercel Prod Tests should pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflows not bundled on page router

2 participants