Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
url: "cre/guides/workflow/time-in-workflows",
highlightAsCurrent: ["cre/guides/workflow/time-in-workflows-ts", "cre/guides/workflow/time-in-workflows-go"],
},
{
title: "Using Randomness in Workflows",
url: "cre/guides/workflow/using-randomness",
},
],
},
{
Expand Down Expand Up @@ -420,10 +424,6 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
url: "cre/concepts/non-determinism",
highlightAsCurrent: ["cre/concepts/non-determinism-go", "cre/concepts/non-determinism-ts"],
},
{
title: "Random in CRE",
url: "cre/concepts/random-in-cre",
},
{
title: "TypeScript Runtime Environment",
url: "cre/concepts/typescript-wasm-runtime",
Expand Down
4 changes: 2 additions & 2 deletions src/content/cre/concepts/non-determinism-go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Go's built-in `rand` package generates different random sequences on each node,

**The problem:** Each node generates different random values, breaking consensus.

**The solution:** Use `runtime.Rand()` from the CRE SDK, which provides consensus-safe random number generation. All nodes generate the same sequence of random values, enabling consensus. See [Random in CRE](/cre/concepts/random-in-cre) for details.
**The solution:** Use `runtime.Rand()` from the CRE SDK, which provides consensus-safe random number generation. All nodes generate the same sequence of random values, enabling consensus. See [Using Randomness in Workflows](/cre/guides/workflow/using-randomness) for details.

## 6. Working with LLMs

Expand Down Expand Up @@ -114,5 +114,5 @@ Large Language Models (LLMs) generate different responses for the same prompt, e
## Related concepts

- **[Time in CRE](/cre/guides/workflow/time-in-workflows-go)**: Learn about DON Time and why `runtime.Now()` is required
- **[Random in CRE](/cre/concepts/random-in-cre)**: Understand consensus-safe random number generation
- **[Using Randomness in Workflows](/cre/guides/workflow/using-randomness)**: Understand consensus-safe random number generation
- **[Consensus Computing](/cre/concepts/consensus-computing)**: Deep dive into how nodes reach agreement
2 changes: 1 addition & 1 deletion src/content/cre/getting-started/before-you-build-go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If your workflow needs random values (e.g., selecting a winner or generating non

{/* prettier-ignore */}
<Aside type="tip" title="Learn more">
See [Random in CRE](/cre/concepts/random-in-cre) for usage examples and best practices.
See [Using Randomness in Workflows](/cre/guides/workflow/using-randomness) for usage examples and best practices.
</Aside>

{/* prettier-ignore */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ max := big.NewInt(1000)
randomValue := new(big.Int).Rand(rnd, max)
```

**Note**: For a complete understanding of how randomness works in CRE, including the difference between DON mode and Node mode randomness, see [Random in CRE](/cre/concepts/random-in-cre).
**Note**: For a complete understanding of how randomness works in CRE, including the difference between DON mode and Node mode randomness, see [Using Randomness in Workflows](/cre/guides/workflow/using-randomness).

### Constructing input structs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
section: cre
title: "Random in CRE"
title: "Using Randomness in Workflows"
sdkLang: "go"
date: Last Modified
metadata:
description: "Generate random numbers safely in CRE: use runtime.Rand() to ensure all nodes get the same values and maintain consensus."
datePublished: "2025-11-04"
lastModified: "2025-11-04"
lastModified: "2026-02-05"
---

import { Aside } from "@components"
Expand Down
Loading
Loading