← Back
Vercel
Vercel Workflow 4.1 Beta introduces event-sourced architecture with self-healing capabilities
Vercel · releasefeatureplatform · vercel.com ↗

Event-Sourced State Management

Workflow 4.1 replaces mutable database records with an append-only event log. Instead of storing "this run is completed," the system now records the sequence of events—run_created, run_started, run_completed—and reconstructs state by replaying those events in order. Each event captures a timestamp and context, making the event log the single source of truth for workflow execution.

Three Key Benefits

Self-healing runs: The new architecture automatically detects and recovers from infrastructure failures. If a queue message is lost or a race condition occurs, replaying the workflow route identifies missing state and re-enqueues necessary messages. Previously, operators had to manually intervene; now recovery is automatic.

Complete audit trail: Every state transition is captured in the immutable event log, enabling you to replay the exact sequence of events that led to any state. This dramatically improves debugging of distributed workflows by providing full visibility into what happened and when.

Guaranteed consistency: Events are append-only, so partial failures during writes cannot leave entities in an inconsistent state. The event log provides a reliable foundation that eliminates race conditions common in traditional mutable-record systems.

Additional Improvements

Beyond the architectural shift, Workflow 4.1 adds:

  • Improved throughput: The queue system now processes thousands of steps per second, with parallel execution when dependencies allow
  • Provider-executed tools: @workflow/ai supports tools like Google Search and WebSearch that run on the model provider's infrastructure
  • NestJS support: New @workflow/nest package for seamless integration with NestJS applications and dependency injection
  • Explicit Resource Management: SWC plugin now supports TC39 resource management proposals for automatic cleanup within step and workflow functions
  • Custom serialization: Client mode supports custom class serialization via classes object in manifest.json

Refer to the Event Sourcing documentation for detailed state machine diagrams and the complete event model.