Skip to content

feat(sdk): add random and uuid4 in workflow context#1412

Open
chris-olszewski wants to merge 3 commits into
mainfrom
olszewski/feat_random_utils
Open

feat(sdk): add random and uuid4 in workflow context#1412
chris-olszewski wants to merge 3 commits into
mainfrom
olszewski/feat_random_utils

Conversation

@chris-olszewski

Copy link
Copy Markdown
Member

What was changed

  • Add WorkflowContext::random and uuid4 for use in workflows
  • Add WorkflowRandomValue as our trait to allow generating different number types. Used to avoid exposing underlying rand trait.
  • Remove WorkflowContext::random_seed()
  • Make specifying child workflow optional, if omitted or empty use uuid4 to generate one

Why?

SDK parity

Checklist

  1. Closes [Feature Request] Provide random utilities #1385

  2. How was this tested:
    Various unit tests

  3. Any docs updates needed?
    N/A

@chris-olszewski
chris-olszewski marked this pull request as ready for review July 17, 2026 13:43
@chris-olszewski
chris-olszewski requested a review from a team as a code owner July 17, 2026 13:43
(),
ChildWorkflowOptions {
workflow_id: "abandoned-child".to_owned(),
workflow_id: Some("abandoned-child".to_owned()),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me kinda sad. We probably need to convert ChildWorkflowOptions into a builder?

<T as private::Sealed>::sample(random)
}

fn uuid4(&self) -> String {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not have a dep already that can do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Provide random utilities

2 participants