close

hydrateData

Hydrate a single serialized value from workflow storage into a plain JavaScript value.

Hydrates (deserializes) a single value that was stored by the workflow runtime. This is the lower-level building block behind hydrateResourceIO() — use it when you have a raw serialized value rather than a whole resource, such as a single field from an event payload.

import { hydrateData, observabilityRevivers } from "workflow/observability"; 
declare const serialized: unknown; // @setup

const value = hydrateData(serialized, observabilityRevivers); 

API Signature

Parameters

ParameterTypeDescription
valueunknownThe serialized value from workflow storage
reviversReviversReviver functions for deserialization. Use observabilityRevivers for standard use.

Returns

The hydrated plain JavaScript value. The input is handled by shape:

  • Format-prefixed binary data (Uint8Array) is decoded and parsed from the devalue format
  • Encrypted data is returned as-is (a raw Uint8Array) — see Encrypted Data
  • Already-plain values (numbers, strings, null) are returned unchanged

On this page

GitHubEdit this page on GitHub