[KongchangAI]
· 2 min read· 1,025 words

Vercel AI SDK Workflow 2.0.59: Introducing Non-Streaming Generate Capability

Vercel AI SDK Workflow 2.0.59: Introducing Non-Streaming Generate Capability

Vercel AI SDK Workflow 2.0.59 adds non-streaming durable generate() and decouples tool approval from streaming.

`@ai-sdk/workflow@2.0.59` is a feature-dense patch release. The core change is adding a non-streaming durable `generate()` method to `WorkflowAgent`, filling the gap where only streaming execution was previously supported and enabling native support for background Agent scenarios like batch processing and scheduled tasks. Tool approval requests are also decoupled from streaming logic, allowing human-in-the-loop approval resumption in non-streaming and connectionless environments. This release further documents and validates workflow resumption semantics — deadlines, retry boundaries, hook cancellation, and result serialization — and fixes issues like discarded length-truncated assistant responses and lost provider metadata. Overall, this update significantly reduces the complexity of building both interactive streaming Agents and reliable background batch-processing Agents with AI SDK.

Vercel AI SDK's Workflow module has released patch version 2.0.59 (@ai-sdk/workflow@2.0.59). Despite being a patch update, it includes a significant capability addition for the WorkflowAgent — support for non-streaming durable generation. This update is worth paying attention to for developers building multi-step Agents with the AI SDK.

@ai-sdk/workflow@2.0.59 release page

Core Update: Durable Non-Streaming generate()

The most important change in this release is the addition of a generate() method to WorkflowAgent (commit 0ca1ab9). Previously, Workflow was primarily designed around streaming scenarios. The newly added generate() provides a durable execution path that doesn't rely on streaming output.

Key design details include:

  • Shared tool loop: Reuses the underlying core logic for handling tool calls, avoiding a fork between streaming and non-streaming implementations.
  • Default 20-step limit: Sets a reasonable default execution boundary for multi-step tool calls, preventing Agents from entering infinite loops.
  • Typed output: Continues the AI SDK's consistent type-safe design, allowing generated results to be statically inferred.
  • Reused core result construction: Reuses core result and content construction logic through internal exports, while keeping existing Workflow streaming behavior unaffected.

In short, developers can now call generate() to get a complete result directly in scenarios where token-by-token streaming isn't needed — such as background batch processing, scheduled tasks, or non-interactive Agent tasks — without having to handle a stream.

Durable execution is an important concept in AI workflows: the execution state of a workflow can be serialized and saved, allowing it to resume from a checkpoint after interruption or failure rather than restarting from scratch. This is fundamentally different from ordinary stateless function calls — durable execution can survive process restarts, server crashes, or long waiting periods (such as waiting for human approval). Vercel AI SDK's Workflow module is built on the Durable Execution concept, so the "durable" in the generate() method doesn't just mean "synchronously returning a complete result" — it also means the execution process can be tracked, suspended, and resumed by an orchestration engine. By contrast, token-by-token output in streaming mode is inherently ephemeral and difficult to persist, which is exactly why non-streaming generate() is indispensable for batch processing and background Agent scenarios.

Decoupling Tool Approval from Streaming

Another noteworthy set of changes revolves around the tool approval mechanism. Commit 57dadb5 decouples the creation of tool approval requests from streaming logic, enabling WorkflowAgent.generate as well as streams without a writable to resume already-approved calls.

This means the approval process is no longer bound to whether streaming output exists — even non-streaming execution can fully support the human-in-the-loop pattern where tool calls require human or external approval. The release also preserves provider-level approval requests and forwards approval responses as-is, without locally executing provider tools, ensuring consistency in approval semantics.

However, the team notes that transport-independent approval creation is still future work — the current version is just the first step toward decoupling.

Tool approval is the core mechanism of the Human-in-the-Loop pattern: when an Agent is about to call a sensitive or high-risk tool, execution pauses and waits for a human or external system to confirm before continuing. This pattern is especially important in highly automated Agent systems — for example, requiring approval before executing database writes, sending notifications, or calling paid APIs. Previously, tool approval was deeply coupled to streaming output, meaning approval could only be triggered and resumed with an active stream connection, limiting its use in batch processing and async scenarios. By decoupling approval creation from streaming logic, approval requests can be independently stored and resumed in environments without WebSocket or SSE connections, laying the groundwork for more robust asynchronous approval workflows.

Defining Workflow Resumption Boundaries

Commit a471b4c documents and validates several runtime behaviors of WorkflowAgent, covering:

  • Generation deadlines
  • Retry boundaries
  • Hook cancellation
  • Serialization of selected results during workflow resumption

These conventions are critical for building reliable durable workflows. The difficulty with durable workflows often lies in "how to correctly resume after an interruption" — clearly defining deadlines, retries, and serialization behavior reduces state inconsistency issues across resumption cycles.

Deadlines and retry boundaries are two key concepts in distributed task scheduling. A deadline specifies the maximum time a generation task is allowed to run; once exceeded, the system can mark it as failed or trigger an alert, preventing zombie tasks from permanently holding resources. Retry boundaries define the scope and maximum number of automatic retries after failure, as well as which error types are retryable (e.g., network timeouts) and which are not (e.g., authentication failures). These two conventions are especially important in durable workflows: without clear retry boundaries, a partially successful multi-step Agent task might re-execute already-completed steps upon resumption, causing side effects. Standardized serialization behavior ensures intermediate state remains consistent across process boundaries — a prerequisite for correct resumption.

Stability Fixes

Beyond feature additions, this patch also fixes several issues that affect conversation consistency:

  • 69ea843: Preserves length-truncated assistant responses, ensuring they remain in the conversation messages and aren't accidentally discarded.
  • c89c76c: Retains provider metadata on assistant text messages, preventing information loss between upstream and downstream.
  • 6accb1c: Refactors WorkflowAgent's call preparation, model call results, and execution teardown logic to pave the way for non-streaming generation, while keeping streaming behavior unchanged.

These fixes may seem minor, but for Agents with long conversations and multi-turn tool calls, message integrity and metadata retention directly affect the accuracy of subsequent reasoning.

Dependency Updates

As a package within a monorepo, this release also synchronizes upgrades to several underlying dependencies:

  • ai@7.0.128
  • @ai-sdk/provider@4.0.22
  • @ai-sdk/provider-utils@5.0.54

Projects using the Workflow module should pay attention to version alignment among these related dependencies when upgrading. It's recommended to align all versions together to avoid potential compatibility issues.

Summary

Looking at the updates, @ai-sdk/workflow@2.0.59 is not a major version leap, but it fills an important gap in Workflow's non-streaming story: the generate() method + tool approval decoupled from streaming + well-defined resumption semantics. For teams looking to build Agents with AI SDK that can both stream interactively and reliably batch-process in the background, this update lowers the implementation barrier. Interested developers can check the complete changelog and commit hashes on the Vercel AI repository's release page.

#Vercel AI SDK#WorkflowAgent#non-streaming generate#durable execution#tool approval#AI workflow#Human-in-the-Loop#batch processing Agent
Share:

Related articles