Deterministic workflows, replay and activity arguments

Hello, the following code produces a different input parameter for the activity while replaying the workflow. I expected this code to produce a non-deterministic error. Why am I wrong?

public class ReplayTest {
  public static final TestWorkflowExtension testWorkflowExtension =
          .setActivityImplementations(new ReplayActivitiesImpl())

  void replay_non_deterministic(WorkflowClient client, ReplayWorkflow wf) {

    var execution = WorkflowStub.fromTyped(wf).start();

    try {
      var history = client.fetchHistory(execution.getWorkflowId());
      fail("Should throw exception");
    } catch (Exception e) {


  public interface ReplayWorkflow {
    String start();

  public interface ReplayActivities {
    String echo(String string);

  public static class ReplayActivitiesImpl implements ReplayActivities{
    public String echo(String string) {
      return string;

  public static class ReplayWorkflowImpl implements ReplayWorkflow {
    ReplayActivities activities = Workflow.newActivityStub(

    public String start() {
      var uuid = UUID.randomUUID().toString();
      System.out.println("BEFORE " + uuid);
      var result = activities.echo(uuid);
      System.out.println("AFTER " + result);
      return ts;



Change in activity / child workflow inputs are not compared during replay, during replay the originally recorded inputs in event history are just used, the activity is not invoked again.

Thanks for the clarification. I understand that the consequences of using randomUUID() (“bad” workflow code) in the example above could never be discovered by a Replay-Test, unless this value would determine the activity’s execution. So, if I changed the example’s workflow method like below the test could fail:

    public String start() {
      var random = new Random();
      var i = random.nextInt(101);
      if(i >= 50) {
        System.out.println("Activity executed (i = %s)".formatted(i));
      } else {
        System.out.println("Activity NOT executed (i = %s)".formatted(i));
      return "success";