Vercel Functions 支援 30 分鐘執行:把長 AI 任務放進 serverless 前要先決定什麼
Vercel 在 2026 年 6 月 15 日宣布,Pro 與 Enterprise 團隊的 Node.js 與 Python Functions 最長可執行 30 分鐘。超過 800 秒的 duration 仍屬 beta,並需要 Fluid Compute。這對長時間 LLM streaming、OCR、抽取、媒體處理與有邊界的自動化很有用。
發生了什麼
Vercel 在 2026 年 6 月 15 日宣布,Pro 與 Enterprise 團隊的 Node.js 與 Python Functions 最長可執行 30 分鐘。超過 800 秒的 duration 仍屬 beta,並需要 Fluid Compute。這對長時間 LLM streaming、OCR、抽取、媒體處理與有邊界的自動化很有用。
核心判斷沒有變:如果使用者正在等待結果,長 Function 搭配 streaming 可能適合。如果任務需要失敗後恢復、分步 retry 或長時間 sleep,應使用 Workflow 或 Queue。如果需要檔案、瀏覽器 session、測試 runner 或 agent workspace,Sandbox 較合適。
實務判斷
| Runtime | Best fit | Watch out |
|---|---|---|
| Function | User waits, streaming matters, bounded input | Needs explicit maxDuration, cancellation, logs |
| Workflow / Queue | Retry, checkpoint, durable steps | Requires idempotency and state design |
| Sandbox | Browser, filesystem, tests, agent workspace | Needs 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.
來源
- Vercel Changelog: Functions can now run up to 30 minutes
- Vercel Docs: Configuring Maximum Duration
- Vercel Docs: Fluid Compute
- Vercel Docs: Functions usage and pricing
- Vercel Changelog: Workflow SDK supports TanStack Start
- Vercel Changelog: Sandbox can run up to 24 hours
- Reddit: long-running task questions on Vercel
- Reddit: Vercel runtime limit discussion for LLM apps