@@ -36,7 +36,8 @@ public record StartWorkflowOptions(
3636 @ Nullable String queueName ,
3737 @ Nullable String deduplicationId ,
3838 @ Nullable Integer priority ,
39- @ Nullable String queuePartitionKey ) {
39+ @ Nullable String queuePartitionKey ,
40+ @ Nullable String appVersion ) {
4041
4142 public StartWorkflowOptions {
4243 if (timeout instanceof Timeout .Explicit explicit ) {
@@ -64,17 +65,17 @@ public record StartWorkflowOptions(
6465
6566 /** Construct with default options */
6667 public StartWorkflowOptions () {
67- this (null , null , null , null , null , null , null );
68+ this (null , null , null , null , null , null , null , null );
6869 }
6970
7071 /** Construct with a specified workflow ID */
7172 public StartWorkflowOptions (String workflowId ) {
72- this (workflowId , null , null , null , null , null , null );
73+ this (workflowId , null , null , null , null , null , null , null );
7374 }
7475
7576 /** Construct with a specified queue */
7677 public StartWorkflowOptions (@ NonNull Queue queue ) {
77- this (null , null , null , queue .name (), null , null , null );
78+ this (null , null , null , queue .name (), null , null , null , null );
7879 }
7980
8081 /** Produces a new StartWorkflowOptions that overrides the ID assigned to the started workflow */
@@ -86,7 +87,8 @@ public StartWorkflowOptions(@NonNull Queue queue) {
8687 this .queueName ,
8788 this .deduplicationId ,
8889 this .priority ,
89- this .queuePartitionKey );
90+ this .queuePartitionKey ,
91+ this .appVersion );
9092 }
9193
9294 /** Produces a new StartWorkflowOptions that overrides timeout value for the started workflow */
@@ -98,7 +100,8 @@ public StartWorkflowOptions(@NonNull Queue queue) {
98100 this .queueName ,
99101 this .deduplicationId ,
100102 this .priority ,
101- this .queuePartitionKey );
103+ this .queuePartitionKey ,
104+ this .appVersion );
102105 }
103106
104107 /** Produces a new StartWorkflowOptions that overrides timeout value for the started workflow */
@@ -125,7 +128,8 @@ public StartWorkflowOptions(@NonNull Queue queue) {
125128 this .queueName ,
126129 this .deduplicationId ,
127130 this .priority ,
128- this .queuePartitionKey );
131+ this .queuePartitionKey ,
132+ this .appVersion );
129133 }
130134
131135 /** Produces a new StartWorkflowOptions that assigns the started workflow to a queue */
@@ -137,7 +141,8 @@ public StartWorkflowOptions(@NonNull Queue queue) {
137141 queue ,
138142 this .deduplicationId ,
139143 this .priority ,
140- this .queuePartitionKey );
144+ this .queuePartitionKey ,
145+ this .appVersion );
141146 }
142147
143148 /** Produces a new StartWorkflowOptions that assigns the started workflow to a queue */
@@ -157,7 +162,8 @@ public StartWorkflowOptions(@NonNull Queue queue) {
157162 this .queueName ,
158163 deduplicationId ,
159164 this .priority ,
160- this .queuePartitionKey );
165+ this .queuePartitionKey ,
166+ this .appVersion );
161167 }
162168
163169 /**
@@ -172,7 +178,8 @@ public StartWorkflowOptions(@NonNull Queue queue) {
172178 this .queueName ,
173179 this .deduplicationId ,
174180 priority ,
175- this .queuePartitionKey );
181+ this .queuePartitionKey ,
182+ this .appVersion );
176183 }
177184
178185 /** Produces a new StartWorkflowOptions that assigns a queue partition key */
@@ -184,7 +191,21 @@ public StartWorkflowOptions(@NonNull Queue queue) {
184191 this .queueName ,
185192 this .deduplicationId ,
186193 this .priority ,
187- queuePartitionKey );
194+ queuePartitionKey ,
195+ this .appVersion );
196+ }
197+
198+ /** Produces a new StartWorkflowOptions that assigns an app version */
199+ public @ NonNull StartWorkflowOptions withAppVersion (@ Nullable String appVersion ) {
200+ return new StartWorkflowOptions (
201+ this .workflowId ,
202+ this .timeout ,
203+ this .deadline ,
204+ this .queueName ,
205+ this .deduplicationId ,
206+ this .priority ,
207+ this .queuePartitionKey ,
208+ appVersion );
188209 }
189210
190211 /** Get the assigned workflow ID, replacing empty with null */
0 commit comments