diff --git a/temporal-sdk/src/main/java/io/temporal/internal/common/InternalUtils.java b/temporal-sdk/src/main/java/io/temporal/internal/common/InternalUtils.java index a14e0e7cf..e37d65f58 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/common/InternalUtils.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/common/InternalUtils.java @@ -74,6 +74,10 @@ public static WorkflowStub createNexusBoundStub( throw new IllegalArgumentException("Options are expected to be set on the stub"); } WorkflowOptions options = stub.getOptions().get(); + if (options.getWorkflowId() == null) { + throw new IllegalArgumentException( + "WorkflowId is expected to be set on WorkflowOptions when used with Nexus"); + } WorkflowOptions.Builder nexusWorkflowOptions = WorkflowOptions.newBuilder(options) .setRequestId(request.getRequestId())