Vercel's November 12 blog post describes Workflow SDK 5. Workflow and step inputs and outputs, hook payloads, and stream data are encrypted with AES-256-GCM before they leave the code, using a unique key for each run. With encryption enabled, a Workflow SDK backend, including Vercel, stores ciphertext. Plaintext is decrypted in the deployment or in authorized observability tools. On Vercel, encryption needs no setup and no code changes. Each run's key is derived from a key scoped to the deployment that created it, so a run can decrypt only its own data. Names, timings, and statuses stay visible. A payload can be decrypted in the dashboard or with npx workflow inspect run and --decrypt. Decryption happens in the browser or terminal, follows the same permissions as the project's environment variables, and each request is recorded in the team audit log. A self-hosted World enables encryption by implementing getEncryptionKeyForRun() and returning the same 32-byte key for that run on every call. When code resumes another run's hook, starts a run in another deployment, or writes into a stream forwarded from another run, the payload is encrypted to the target run's public key. Setting experimental_retention to 0 deletes inputs, outputs, and stream contents when a run completes or fails. The run's metadata stays visible. The trace viewer adds span search, zoom, a minimap, and local inspection during development. Run attributes, new in v5, attach searchable plaintext context such as an order id, and should not contain secrets. In Workflow SDK 4, each run's event log, queue, and streams were stored only in iad1. In v5, that state is served from the region where the run started, which by default is the region of the function that calls start(). start() accepts a region option. Existing v4 runs stay in iad1. Steps run where the app is deployed. For projects with Vercel Function failover configured, steps can run in a fallback region while state stays in the run's home region. The post says an invocation can run several steps inline, including parallel steps, before yielding for a wait, a hook, or a timeout, and reports 1.6x to 25x lower latency and overhead across the workloads it measured, comparing v5.2.0 with v4.8.12. In a five-step benchmark, p75 time between steps fell from 618 ms to 109 ms. The post says these changes introduce no major breaking changes. It also lists in-flight cancellation with AbortController, and a Python SDK in beta with the same workflows, steps, sleeps, and hooks.
Source: Vercel blog