random

abstract fun random(): RestateRandom

Create a RestateRandom instance inherently predictable, seeded on the dev.restate.sdk.common.InvocationId, which is not secret.

This instance is useful to generate identifiers, idempotency keys, and for uniform sampling from a set of options. If a cryptographically secure value is needed, please generate that externally using runBlock.

You MUST NOT use this Random instance inside a runBlock.

Return

the Random instance.