mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
374dbaaebd
- @workflow/world: snapshots interface is now OPTIONAL on Storage (a World that can't store blobs simply omits it; consumers feature-detect and fall back to full replay) — keeps this a true minor for community worlds. New encodeSnapshotEnvelope/decodeSnapshotEnvelope helpers pack metadata + bytes into ONE self-describing blob; decode validates via the schema (passthrough for forward compat) and returns null for anything torn/corrupt/foreign — never fabricated metadata. - world-local: single envelope file per run replaces the .bin/.json pair — the torn-save window (crash or concurrent load between two renames pairing bytes with another suspension's cursor) is structurally gone. - world-postgres: data column stores the envelope; full metadata round-trips losslessly (new fields need no migration). Columns remain as denormalized observability copies. - world-vercel: envelope is the PUT/GET body, so the full metadata round-trips without any workflow-server change; loads never invent metadata from headers/wall time (undecodable body = clean miss). DELETE treats 404 as success (idempotent like local/postgres). WORLD_SNAPSHOT_DIAG logs gated behind the package's HTTP debug flag.
@workflow/world-local
Filesystem-based workflow backend for local development and testing.
Stores workflow data as JSON files on disk and provides in-memory queuing. Automatically detects development server port for queue transport.
Used by default on next dev and next start.
Programmatic configuration
import { createWorld } from '@workflow/world-local';
const world = createWorld({
dataDir: './custom-workflow-data',
});