new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Temporal · Concepts · all subjects

determinism & safety

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Determinism constraints and Activities

The deterministic constraints of Workflow code require the use of Activities to create side effects and interact with the outside world. Activities perform work outside the Workflow, such as calling an external API. Since the call can fail due to transient issues, you define it as an Activity and configure retry options in your SDK.

Run ID and non-determinism pitfall

You should not rely on the current Run ID in your code to make logical choices because the Run ID is updated during ContinueAsNew, Retry, Cron, and Reset operations, which can lead to non-determinism issues.

Determinism requirement: Workflows must make same decisions with same history

Because a Workflow is re-executed to rebuild its state, it has to make the same decisions when given the same history, which makes a Workflow deterministic. A Workflow should not depend on any values not recorded in the history, as these would be different between runs and could cause the Workflow to take a different path and fail to match the recorded history.

Non-deterministic operations and replay safety issues

Direct calls to Date.now() could return a different value on replay. Random numbers could change between runs. Network calls that were not performed inside an Activity could return something new during replay. If these values changed, the Workflow could take a different path and fail to match the recorded history.

Replay-safe operations provided by Temporal

Temporal provides replay-safe versions of common operations to ensure the Workflow receives the same values during replay as it did originally. Time is read from the Workflow context so it matches the recorded history. Timers are recorded as events and do not wait again during replay. Randomness and similar values can be captured once and reused.

Give your agent this brain