Vercel Functions 支持 30 分钟运行:把长 AI 任务放进 serverless 前要先决定什么

Tech

Vercel 在 2026 年 6 月 15 日宣布,Pro 和 Enterprise 团队的 Node.js 与 Python Functions 最长可运行 30 分钟。超过 800 秒的 duration 仍为 beta,并要求 Fluid Compute。这对长时间 LLM streaming、OCR、抽取、媒体处理和有边界的自动化很有价值。

Vercel Functions 支持 30 分钟运行:把长 AI 任务放进 serverless 前要先决定什么
关键判断没有变:如果用户正在等待结果,长 Function 加 streaming 可能合适。如果任务需要失败后恢复、分步骤重试或长时间 sleep,应使用 Workflow 或 Queue。如果需要文件、浏览器会话、测试运行器或 agent workspace,Sandbox 更合适。

发生了什么

Vercel 在 2026 年 6 月 15 日宣布,Pro 和 Enterprise 团队的 Node.js 与 Python Functions 最长可运行 30 分钟。超过 800 秒的 duration 仍为 beta,并要求 Fluid Compute。这对长时间 LLM streaming、OCR、抽取、媒体处理和有边界的自动化很有价值。

关键判断没有变:如果用户正在等待结果,长 Function 加 streaming 可能合适。如果任务需要失败后恢复、分步骤重试或长时间 sleep,应使用 Workflow 或 Queue。如果需要文件、浏览器会话、测试运行器或 agent workspace,Sandbox 更合适。

实践判断

RuntimeBest fitWatch out
FunctionUser waits, streaming matters, bounded inputNeeds explicit maxDuration, cancellation, logs
Workflow / QueueRetry, checkpoint, durable stepsRequires idempotency and state design
SandboxBrowser, filesystem, tests, agent workspaceNeeds permission and cleanup rules
检查清单

Verify plan, runtime, beta availability and Fluid Compute settings.

Keep provider and database timeouts below the function maximum.

Add progress logs, correlation ids, cancellation and cost alerts.

Use idempotency keys before moving mutations into longer requests.

风险

上线前请确认 plan、runtime、beta 可用性、maxDuration、外部 API timeout、数据库 timeout、进度日志、取消机制、rate limit 和费用告警。更长的 timeout 不是 durable state machine。

Community discussions around Vercel timeouts show that developers have long been balancing streaming, queues and separate workers for LLM and long API work. Treat those discussions as product signal, while relying on the official Vercel changelog and docs for the actual limits.

来源