Skip to main content

Interface: UnsafeRandomSource

workflow.UnsafeRandomSource

A nondeterministic random source: every draw is fresh entropy, not derived from the Workflow seed and not replay-stable. Only safe in read-only Query handlers and update validators; using it on the main Workflow path causes non-determinism errors.

This API may be removed or changed in the future.

Methods​

fillRandom​

▸ fillRandom(bytes): Uint8Array

Fills bytes with fresh nondeterministic values.

Parameters​

NameType
bytesUint8Array

Returns​

Uint8Array


random​

▸ random(): number

A fresh nondeterministic float in [0, 1), like an un-sandboxed Math.random().

Returns​

number


uuid4​

▸ uuid4(): string

A fresh nondeterministic UUIDv4.

Returns​

string