@@ -24,6 +24,7 @@ import {
24
24
WorkflowIdConflictPolicy ,
25
25
compilePriority ,
26
26
} from '@temporalio/common' ;
27
+ import { encodeUserMetadata } from '@temporalio/common/lib/user-metadata' ;
27
28
import { encodeUnifiedSearchAttributes } from '@temporalio/common/lib/converter/payload-search-attributes' ;
28
29
import { composeInterceptors } from '@temporalio/common/lib/interceptors' ;
29
30
import { History } from '@temporalio/common/lib/proto-utils' ;
@@ -32,6 +33,7 @@ import {
32
33
decodeArrayFromPayloads ,
33
34
decodeFromPayloadsAtIndex ,
34
35
decodeOptionalFailureToOptionalError ,
36
+ decodeOptionalSinglePayload ,
35
37
encodeMapToPayloads ,
36
38
encodeToPayloads ,
37
39
} from '@temporalio/common/lib/internal-non-workflow' ;
@@ -509,7 +511,7 @@ export class WorkflowClient extends BaseClient {
509
511
510
512
protected async _start < T extends Workflow > (
511
513
workflowTypeOrFunc : string | T ,
512
- options : WithWorkflowArgs < T , WorkflowOptions > ,
514
+ options : WorkflowStartOptions < T > ,
513
515
interceptors : WorkflowClientInterceptor [ ]
514
516
) : Promise < string > {
515
517
const workflowType = extractWorkflowType ( workflowTypeOrFunc ) ;
@@ -1220,6 +1222,7 @@ export class WorkflowClient extends BaseClient {
1220
1222
: undefined ,
1221
1223
cronSchedule : options . cronSchedule ,
1222
1224
header : { fields : headers } ,
1225
+ userMetadata : await encodeUserMetadata ( this . dataConverter , options . staticSummary , options . staticDetails ) ,
1223
1226
priority : options . priority ? compilePriority ( options . priority ) : undefined ,
1224
1227
versioningOverride : options . versioningOverride ?? undefined ,
1225
1228
} ;
@@ -1262,7 +1265,6 @@ export class WorkflowClient extends BaseClient {
1262
1265
protected async createStartWorkflowRequest ( input : WorkflowStartInput ) : Promise < StartWorkflowExecutionRequest > {
1263
1266
const { options : opts , workflowType, headers } = input ;
1264
1267
const { identity, namespace } = this . options ;
1265
-
1266
1268
return {
1267
1269
namespace,
1268
1270
identity,
@@ -1290,6 +1292,7 @@ export class WorkflowClient extends BaseClient {
1290
1292
: undefined ,
1291
1293
cronSchedule : opts . cronSchedule ,
1292
1294
header : { fields : headers } ,
1295
+ userMetadata : await encodeUserMetadata ( this . dataConverter , opts . staticSummary , opts . staticDetails ) ,
1293
1296
priority : opts . priority ? compilePriority ( opts . priority ) : undefined ,
1294
1297
versioningOverride : opts . versioningOverride ?? undefined ,
1295
1298
} ;
@@ -1425,8 +1428,13 @@ export class WorkflowClient extends BaseClient {
1425
1428
workflowExecution : { workflowId, runId } ,
1426
1429
} ) ;
1427
1430
const info = await executionInfoFromRaw ( raw . workflowExecutionInfo ?? { } , this . client . dataConverter , raw ) ;
1431
+ const userMetadata = raw . executionConfig ?. userMetadata ;
1428
1432
return {
1429
1433
...info ,
1434
+ staticDetails : async ( ) =>
1435
+ ( await decodeOptionalSinglePayload ( this . client . dataConverter , userMetadata ?. details ) ) ?? undefined ,
1436
+ staticSummary : async ( ) =>
1437
+ ( await decodeOptionalSinglePayload ( this . client . dataConverter , userMetadata ?. summary ) ) ?? undefined ,
1430
1438
raw,
1431
1439
} ;
1432
1440
} ,
0 commit comments