Orchestrate Durable Agents in App Code, No Infra Needed

Mark functions with 'use workflow' and 'use step' in TypeScript/Python for automatic retries, persistence, observability, encryption, and streaming across 100M+ runs without queues or orchestrators.

Embed Orchestration in Application Code for Reliability

Write long-running workflows as regular functions using simple directives: "use workflow" on the top-level function and "use step" on sub-functions. This isolates units of work, providing automatic retries, durable state via event log, and handoff to the next step without manual queue management. For example, a site creation workflow fetches a user profile, generates a plan via LLM, and provisions the site—each step persists inputs/outputs, survives crashes, and resumes seamlessly.

The model runs identically locally (in-memory queue) and in production (Vercel Queues or Postgres), eliminating separate orchestration codebases. Pay only for active compute on Fluid Compute; no idle background processes. Since beta, it processed 100M runs, 500M steps for 1,500+ customers, with 200K weekly npm downloads.

Trade-off: Steps are atomic, so design for idempotency to handle retries safely. This cuts prototype-to-production gap by keeping logic in one place, unlike splitting across workers and status tables.

Eliminate Infra Overhead with Built-in Primitives

Workflows uses an event log as single source of truth for all steps (inputs, outputs, streams, sleeps, errors), Fluid Compute for isolated execution, and queues for continuation. No dedicated orchestrator means zero-config scaling, E2E encryption (inputs/outputs unreadable outside your deployment), and observability dashboard/CLI for traces.

For infinite loops like Guillermo's chess game (models play indefinitely), model recursion across runs: end-of-game step starts a new run pegged to the deployment version, ensuring stability during upgrades. Crashes retry automatically without app failure.

Python beta mirrors this: @wf.workflow and @wf.step decorators yield the same guarantees, expanding to AI/backends.

Limits support multimodal agents: 50MB/step payload, 2GB/run total.

Power Agentic Workloads with Durable Primitives

Integrate with AI SDK for DurableAgent and WorkflowAgent (v7): agents maintain state/tools across interruptions, process tool calls iteratively with step retries. getWritable() creates resumable streams—clients disconnect/reconnect via run ID, workflow continues server-side (no Redis needed).

Suspend cheaply: sleep for delays (minutes to months, e.g., drip campaigns); hooks for external events/human-in-loop (e.g., approvals). Coding agents use the CLI (npx workflow inspect <run_id>) or installable skill for scaffolding/debugging, as code is plain TypeScript/Python.

Secure-by-default encryption with audit trail; portable via 'Worlds' adapters (Vercel managed, self-hosted Postgres, community MongoDB/Redis/etc.).

Customers validate: Mux pipelines video/AI inference; Durable runs 100s of parallel agents for sites in <30s (6 engineers, no infra hires); Flora orchestrates 50+ image models with rollbacks/streaming.

Future: Performance Without Model Changes

Workflows 5 adds native locks for concurrency, global infra, snapshot runtime (cuts replay overhead), tighter Next.js bundling. Install workflow@beta to test; Python SDK beta now available.

Summarized by x-ai/grok-4.1-fast via openrouter

8862 input / 2112 output tokens in 19103ms

© 2026 Edge