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 · all subjects

determinism

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

Catch ActivityFailure to distinguish permanent failures from non-determinism errors

In the recoverableStep catch block, check if the error is an instanceof ActivityFailure. Re-throw non-ActivityFailure exceptions immediately (Workflow-side bugs, non-determinism errors) so Temporal fails the Workflow Task and retries it at the framework level rather than silently parking the Workflow in PENDING_FIX. Additionally, check isCancellation(e) and re-throw if true, since cancellation arrives wrapped as an ActivityFailure and must propagate so the framework can unwind the Workflow cleanly. Only Activity errors that do not match these conditions enter the pause-and-resume loop.

Workflow determinism requirements

Workflow code must be deterministic because Temporal uses history replay to reconstruct state after Worker restarts. Key rules: Use workflow.now() instead of datetime.now() for timestamps. Use workflow.uuid4() instead of uuid.uuid4() for generating unique identifiers. Use workflow.random() instead of Python's random module. Never perform I/O (network calls, file reads, database queries) directly in Workflow code—delegate to Activities. Use workflow.logger instead of print() for replay-safe logging. If the code generates different commands on replay, the SDK raises a NondeterminismError.

Python SDK determinism checks: datetime, uuid, random

The Python SDK enforces determinism by requiring: workflow.now() for all timestamps (not datetime.now() or time.time()). workflow.uuid4() for generating unique identifiers (not uuid.uuid4()). workflow.random() for random values (not random.random() or random.choice()). Using non-deterministic calls triggers a NondeterminismError on replay, causing the Workflow to fail.

Nondeterminism Error in Workflow Task

The Workflow Task failed due to a nondeterminism error, which occurs when Workflow code is not deterministic.

Give your agent this brain