@@ -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' ;
@@ -509,7 +511,7 @@ export class WorkflowClient extends BaseClient {
509511
510512 protected async _start < T extends Workflow > (
511513 workflowTypeOrFunc : string | T ,
512- options : WithWorkflowArgs < T , WorkflowOptions > ,
514+ options : WorkflowStartOptions < T > ,
513515 interceptors : WorkflowClientInterceptor [ ]
514516 ) : Promise < string > {
515517 const workflowType = extractWorkflowType ( workflowTypeOrFunc ) ;
@@ -1220,6 +1222,7 @@ export class WorkflowClient extends BaseClient {
12201222 : undefined ,
12211223 cronSchedule : options . cronSchedule ,
12221224 header : { fields : headers } ,
1225+ userMetadata : await encodeUserMetadata ( this . dataConverter , options . staticSummary , options . staticDetails ) ,
12231226 priority : options . priority ? compilePriority ( options . priority ) : undefined ,
12241227 versioningOverride : options . versioningOverride ?? undefined ,
12251228 } ;
@@ -1262,7 +1265,6 @@ export class WorkflowClient extends BaseClient {
12621265 protected async createStartWorkflowRequest ( input : WorkflowStartInput ) : Promise < StartWorkflowExecutionRequest > {
12631266 const { options : opts , workflowType, headers } = input ;
12641267 const { identity, namespace } = this . options ;
1265-
12661268 return {
12671269 namespace,
12681270 identity,
@@ -1290,6 +1292,7 @@ export class WorkflowClient extends BaseClient {
12901292 : undefined ,
12911293 cronSchedule : opts . cronSchedule ,
12921294 header : { fields : headers } ,
1295+ userMetadata : await encodeUserMetadata ( this . dataConverter , opts . staticSummary , opts . staticDetails ) ,
12931296 priority : opts . priority ? compilePriority ( opts . priority ) : undefined ,
12941297 versioningOverride : opts . versioningOverride ?? undefined ,
12951298 } ;
@@ -1425,8 +1428,13 @@ export class WorkflowClient extends BaseClient {
14251428 workflowExecution : { workflowId, runId } ,
14261429 } ) ;
14271430 const info = await executionInfoFromRaw ( raw . workflowExecutionInfo ?? { } , this . client . dataConverter , raw ) ;
1431+ const userMetadata = raw . executionConfig ?. userMetadata ;
14281432 return {
14291433 ...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 ,
14301438 raw,
14311439 } ;
14321440 } ,
0 commit comments