<!-- PkgPulse AI-readable guide source -->
<!-- Canonical: https://www.pkgpulse.com/guides/workflow-vs-temporal-nextjs -->
<!-- Raw Markdown: https://www.pkgpulse.com/guides/workflow-vs-temporal-nextjs/raw.md -->
<!-- Source path: content/guides/workflow-vs-temporal-nextjs.mdx -->

---
title: "Vercel Workflow vs Temporal for Durable Next.js Jobs"
description: "Compare Vercel Workflow and Temporal for a durable Next.js job. See how each handles waits, approval, retries, run inspection, and production deployment."
date: "2026-12-04"
author: "PkgPulse Team"
tags: ["durable execution", "job orchestration"]
tileSubjects:
  - slug: vercel-workflow
    name: Vercel Workflow
  - slug: temporal-workflows
    name: Temporal
---

<!-- content-block--verdict -->

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](https://workflow-sdk.dev/docs/getting-started/next), [Temporal TypeScript client](https://docs.temporal.io/develop/typescript/client/temporal-client), [Temporal Worker deployments](https://docs.temporal.io/production-deployment/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](https://github.com/vercel/workflow/releases/tag/workflow%405.9.0), [Temporal SDK release](https://github.com/temporalio/sdk-typescript/releases/tag/v1.27.0), [Temporal local test environment](https://typescript.temporal.io/api/classes/testing.TestWorkflowEnvironment#createLocal).

### 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](https://workflow-sdk.dev/docs/api-reference/workflow-api/start), [Workflow hook resumption API](https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook).

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](https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata), [RetryableError reference](https://workflow-sdk.dev/docs/api-reference/workflow/retryable-error).

```ts
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](https://docs.temporal.io/develop/typescript/workflows/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](https://docs.temporal.io/encyclopedia/retry-policies).

```ts
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](https://workflow-sdk.dev/docs/api-reference/workflow-api/get-run), [World SDK](https://workflow-sdk.dev/docs/api-reference/workflow-runtime/world).

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](https://typescript.temporal.io/api/interfaces/client.WorkflowHandle).

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](https://workflow-sdk.dev/docs/deploying), [Vercel Workflows](https://vercel.com/docs/workflows), [World adapters](https://workflow-sdk.dev/worlds).

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](https://docs.temporal.io/production-deployment), [Temporal Workflow replay](https://docs.temporal.io/workflows).

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](/guides/nextjs-developer-ecosystem-guide-2026) when the same app also needs decisions about authentication, data access, and deployment.
- Compare [Temporal with Restate and Windmill](/guides/temporal-vs-restate-vs-windmill-durable-workflow-2026) when the shortlist includes a different execution model.
- See [Inngest, Trigger.dev, and QStash for serverless jobs](/guides/inngest-vs-triggerdev-vs-qstash-serverless-durable-2026) when the workload is closer to scheduled delivery or event-driven processing.
- See the [Next.js package profile](/packages/next) for package and dependency context.

<!-- pipeline:source rank9-fixture -->
<!-- pipeline:source rank9-next-release -->
<!-- pipeline:source rank9-node-release -->
<!-- pipeline:source rank9-workflow-registry -->
<!-- pipeline:source rank9-workflow-release -->
<!-- pipeline:source rank9-workflow-next -->
<!-- pipeline:source rank9-workflow-start -->
<!-- pipeline:source rank9-workflow-hook -->
<!-- pipeline:source rank9-workflow-metadata -->
<!-- pipeline:source rank9-workflow-retry -->
<!-- pipeline:source rank9-workflow-run -->
<!-- pipeline:source rank9-workflow-world -->
<!-- pipeline:source rank9-workflow-local -->
<!-- pipeline:source rank9-workflow-deploy -->
<!-- pipeline:source rank9-workflow-managed -->
<!-- pipeline:source rank9-workflow-worlds -->
<!-- pipeline:source rank9-temporal-registry -->
<!-- pipeline:source rank9-temporal-release -->
<!-- pipeline:source rank9-temporal-cli -->
<!-- pipeline:source rank9-temporal-local -->
<!-- pipeline:source rank9-temporal-client -->
<!-- pipeline:source rank9-temporal-messages -->
<!-- pipeline:source rank9-temporal-retries -->
<!-- pipeline:source rank9-temporal-handle -->
<!-- pipeline:source rank9-temporal-deploy -->
<!-- pipeline:source rank9-temporal-workers -->
<!-- pipeline:source rank9-temporal-replay -->
<!-- pipeline:claim choose-execution-owner -->
<!-- pipeline:claim fixture-pins -->
<!-- pipeline:claim fixture-report-sequence -->
<!-- pipeline:claim workflow-app-approval -->
<!-- pipeline:claim workflow-step-budget -->
<!-- pipeline:claim temporal-queue-signal -->
<!-- pipeline:claim temporal-activity-budget -->
<!-- pipeline:claim workflow-restart-observed -->
<!-- pipeline:claim temporal-restart-observed -->
<!-- pipeline:claim workflow-hosting -->
<!-- pipeline:claim temporal-hosting -->
