Guide
Vercel Workflow vs Temporal for Durable Next.js Jobs


Compare Vercel Workflow and Temporal for a durable Next.js job. See how each handles waits, approval, retries, run inspection, and production deployment.
Contents
Contents
Start with Vercel Workflow when a durable job belongs to your Next.js app and you want its workflow code to ship with that app. Choose Temporal when a separate Worker should own execution and deployment, or keep it if your team already runs the service and Workers. Both carried the same report job through a timer, an approval, and a publisher retry in a local Next.js test.
Quick decision
| Check | Vercel Workflow | Temporal |
|---|---|---|
| Start from Next.js | start() takes the compiled workflow function and returns a run ID. | The Node.js client starts a Workflow by type and task queue. Keep its Workflow ID and Run ID. |
| Wait for approval | Await a hook. The server-side approval handler resumes it by token. | Register a Signal handler and wait on a condition. The client sends a Signal to the Workflow. |
| Retry the publisher | Configure retries on a "use step" function. | Configure a Retry Policy and timeout on the Activity. |
| Inspect a stalled run | Read the run status and check the wait, hook, and step events. | Describe the execution and read the timer, Signal, and Activity entries in its Event History. |
| Own production execution | Use Vercel's managed backend or operate a compatible World for storage and dispatch. | Use Temporal Cloud or run a Temporal Service, and deploy Workers for your code. |
With Vercel Workflow, Next.js compiles the workflow and step functions and exposes the runtime entry points. The World supplies the runtime's storage and queue. In the Temporal setup here, Next.js sends a start request to the Temporal Service, and a Node.js Worker polling the task queue runs the Workflow and its Activity. Workflow's Next.js integration, Temporal TypeScript client, Temporal Worker deployments.
Local report fixture
The job starts on a Next.js POST. The handler returns HTTP 202 and the execution identifiers so the caller can check status later. The workflow waits for a 500 ms cooldown, then waits for approval. A stub publisher throws on the first attempt and returns the report ID on the retry. The timer, approval delivery, retry scheduling, and run inspection all used the real local runtimes. The publisher simulated the outcome of an external service without calling one.
The fixture ran with Next.js 16.5.0 on Node.js 26.13.0, workflow@5.9.0 on Local World, and Temporal TypeScript SDK 1.27.0 with the local development server from Temporal CLI 1.10.1. Temporal's TestWorkflowEnvironment.createLocal() ran a full local server with wall-clock timers. Workflow release, Temporal SDK release, Temporal local test environment.
Vercel Workflow in the app
Wrap the Next.js config with withWorkflow from workflow/next. The launch route calls start(vercelReport, [reportId]) from workflow/api and returns run.runId. The approval route calls resumeHook with the report's hook token. In this fixture the hook opens after the cooldown, so the caller checks that the hook exists before sending approval. If approval can arrive earlier, check that your World supports atomic start hooks. On a compatible World, pass the hook token to start() to create the hook with the run and buffer the approval until the workflow opens it. Workflow start API, Workflow hook resumption API.
This excerpt is the workflow file from the local test. The step gets its attempt number from the runtime. maxRetries = 1 gives it one retry after the initial attempt. Workflow step metadata, RetryableError reference.
import { createHook, getStepMetadata, RetryableError, sleep } from 'workflow';
async function publishReport(reportId: string) {
"use step";
const { attempt } = getStepMetadata();
if (attempt === 1) {
throw new RetryableError('Fixture: publisher unavailable', { retryAfter: '250ms' });
}
return { reportId, attempt };
}
publishReport.maxRetries = 1;
export async function vercelReport(reportId: string) {
"use workflow";
await sleep('500ms');
using approval = createHook<boolean>({ token: `approve:${reportId}` });
if (!(await approval)) return { reportId, rejected: true };
return publishReport(reportId);
}
Temporal with a separate Worker
Use @temporalio/client in the Node.js route. The fixture starts temporalReport by name on the report-fixture task queue. The Worker registers that Workflow and the publisher Activity on the same queue. The approval route uses the client handle to send the approve Signal. That call acknowledges delivery to the service, while the Worker applies the Signal when it processes the Workflow Task. Register the Signal handler before the timer so it can capture an approval during the cooldown. The handler below stores the latest decision it receives. If conflicting decisions arrive during the cooldown, a later Signal can overwrite an earlier approval before the workflow checks it. Temporal Workflow message passing.
This excerpt is the Temporal Workflow file. Its Activity stub reads the attempt from activityInfo() in the Worker and throws on the initial call. maximumAttempts: 2 includes the initial call. startToCloseTimeout bounds each Activity attempt. Temporal Retry Policies.
import { condition, defineSignal, proxyActivities, setHandler, sleep } from '@temporalio/workflow';
interface Activities {
publishReport(reportId: string): Promise<{ reportId: string; attempt: number }>;
}
const { publishReport } = proxyActivities<Activities>({
startToCloseTimeout: '5 seconds',
retry: { initialInterval: '250ms', maximumAttempts: 2 },
});
const approve = defineSignal<[boolean]>('approve');
export async function temporalReport(reportId: string) {
let approved: boolean | undefined;
setHandler(approve, decision => { approved = decision; });
await sleep('500ms');
await condition(() => approved !== undefined);
if (!approved) return { reportId, rejected: true };
return publishReport(reportId);
}
What the local restart showed
On Vercel Workflow, the Local World event log showed wait_created, wait_completed, and hook_created before any publisher step. We stopped Next.js and restarted it with the same Local World data directory. getRun(runId) still reported running. After approval, the same run logged hook_received, step_retrying, and step_completed, and its result reported attempt 2. The restart took place after the timer fired, while the hook was open. Run inspection API, World SDK.
On Temporal, describe() reported RUNNING and fetchHistory() showed the timer had fired. We stopped the Worker, kept the development server and Next.js running, and sent approval through Next.js. The server recorded the Signal while no Worker was polling. A replacement Worker completed the same execution. The Activity's started event recorded attempt 2, and the Worker log captured the initial failure. The service stayed up for the entire test. Temporal Workflow handle API.
Those records give support staff a way to tell an approval wait from an execution problem. Look for a completed timer and an open hook in Workflow, or a fired timer with no approval Signal in Temporal. If the approval has arrived and execution stalls, check whether the step was dispatched or whether a Worker is polling the configured task queue. Store the engine's IDs alongside the report record so an operator can inspect the exact run from a support ticket.
What production needs
On Vercel, enable access to System Environment Variables so the SDK can detect the deployment and use the managed World. Vercel documents that its service stores run state and uses Vercel Queues to dispatch work. For self-hosting, the documented Postgres World uses PostgreSQL for storage and Graphile Worker for job processing. Both production paths are covered by the deployment docs. The fixture ran on Local World. Workflow deployment guide, Vercel Workflows, World adapters.
For Temporal, configure a service endpoint and namespace for the Next.js client and the Worker. Temporal Cloud can operate the service. The team still deploys the code that executes Workflows and Activities, connects it to the service, and keeps it compatible with in-flight Event Histories. For self-hosting, the team also operates the service and its persistent backing stores. The local test used an in-memory service and left Cloud connectivity, service failover, and Worker upgrades untested. Temporal production deployments, Temporal Workflow replay.
In either implementation, look up the report record and check that the caller can approve it before resuming the job. Give the real publisher a stable idempotency key tied to the report version so a retry after a lost response can return the existing publish result. For a release check, leave a report waiting across an app or Worker rollout, approve it, and verify that the publish result is recorded once.
Related guides
- Read the Next.js dependency ecosystem guide when the same app also needs decisions about authentication, data access, and deployment.
- Compare Temporal with Restate and Windmill when the shortlist includes a different execution model.
- See Inngest, Trigger.dev, and QStash for serverless jobs when the workload is closer to scheduled delivery or event-driven processing.
- See the Next.js package profile for package and dependency context.