Frameworks

Next.js

Mount Workbench in a Next.js App Router app with @getworkbench/next catch-all route handlers.

Install

Shell
npm i @getworkbench/next bullmq

Mount

Create a catch-all route handler:

TypeScript
// app/jobs/[[...workbench]]/route.ts
import { Queue } from "bullmq";
import { workbench } from "@getworkbench/next";

const emailQueue = new Queue("email", {
  connection: { url: process.env.REDIS_URL! },
});

export const { GET, POST, PUT, PATCH, DELETE } = workbench({
  queues: [emailQueue],
  basePath: "/jobs",
});

basePath required — must match your route path.

Next.js doesn't host BullMQ workers — run them in a sibling process. See SSR and workers.

Resources