@@ -24,6 +24,7 @@ import {
2424 WorkflowIdConflictPolicy ,
2525 compilePriority ,
2626} from '@temporalio/common' ;
27+ import { encodeUserMetadata } from '@temporalio/common/lib/user-metadata' ;
2728import { encodeUnifiedSearchAttributes } from '@temporalio/common/lib/converter/payload-search-attributes' ;
2829import { composeInterceptors } from '@temporalio/common/lib/interceptors' ;
2930import { History } from '@temporalio/common/lib/proto-utils' ;
@@ -32,6 +33,7 @@ import {
3233 decodeArrayFromPayloads ,
3334 decodeFromPayloadsAtIndex ,
3435 decodeOptionalFailureToOptionalError ,
36+ decodeOptionalSinglePayload ,
3537 encodeMapToPayloads ,
3638 encodeToPayloads ,
3739} from '@temporalio/common/lib/internal-non-workflow' ;
@@ -519,7 +521,7 @@ export class WorkflowClient extends BaseClient {
519521
520522 protected async _start < T extends Workflow > (
521523 workflowTypeOrFunc : string | T ,
522- options : WithWorkflowArgs < T , WorkflowOptions > ,
524+ options : WorkflowStartOptions < T > ,
523525 interceptors : WorkflowClientInterceptor [ ]
524526 ) : Promise < WorkflowStartOutput > {
525527 const workflowType = extractWorkflowType ( workflowTypeOrFunc ) ;
@@ -1271,6 +1273,7 @@ export class WorkflowClient extends BaseClient {
12711273 : undefined ,
12721274 cronSchedule : options . cronSchedule ,
12731275 header : { fields : headers } ,
1276+ userMetadata : await encodeUserMetadata ( this . dataConverter , options . staticSummary , options . staticDetails ) ,
12741277 priority : options . priority ? compilePriority ( options . priority ) : undefined ,
12751278 versioningOverride : options . versioningOverride ?? undefined ,
12761279 } ;
@@ -1352,6 +1355,7 @@ export class WorkflowClient extends BaseClient {
13521355 : undefined ,
13531356 cronSchedule : opts . cronSchedule ,
13541357 header : { fields : headers } ,
1358+ userMetadata : await encodeUserMetadata ( this . dataConverter , opts . staticSummary , opts . staticDetails ) ,
13551359 priority : opts . priority ? compilePriority ( opts . priority ) : undefined ,
13561360 versioningOverride : opts . versioningOverride ?? undefined ,
13571361 requestEagerExecution : opts . requestEagerStart ,
@@ -1488,8 +1492,13 @@ export class WorkflowClient extends BaseClient {
14881492 workflowExecution : { workflowId, runId } ,
14891493 } ) ;
14901494 const info = await executionInfoFromRaw ( raw . workflowExecutionInfo ?? { } , this . client . dataConverter , raw ) ;
1495+ const userMetadata = raw . executionConfig ?. userMetadata ;
14911496 return {
14921497 ...info ,
1498+ staticDetails : async ( ) =>
1499+ ( await decodeOptionalSinglePayload ( this . client . dataConverter , userMetadata ?. details ) ) ?? undefined ,
1500+ staticSummary : async ( ) =>
1501+ ( await decodeOptionalSinglePayload ( this . client . dataConverter , userMetadata ?. summary ) ) ?? undefined ,
14931502 raw,
14941503 } ;
14951504 } ,
0 commit comments