Work goes on after the response.
waitUntil and Next.js after() keep running for up to 15 minutes after the last request: saving a summary, calling a webhook, finishing a tool call. If work reaches the limit, the application’s logs say so.
// app/api/report/route.ts
import { after } from "next/server";
export async function POST(req: Request) {
const chat = await req.json();
after(() => summarize(chat));
return Response.json({ queued: true });
}

