@@ -22,6 +22,7 @@ import {
2222 decodeRetryState ,
2323 encodeWorkflowIdConflictPolicy ,
2424 WorkflowIdConflictPolicy ,
25+ JsonPayloadConverter ,
2526} from '@temporalio/common' ;
2627import { encodeUnifiedSearchAttributes } from '@temporalio/common/lib/converter/payload-search-attributes' ;
2728import { composeInterceptors } from '@temporalio/common/lib/interceptors' ;
@@ -510,7 +511,7 @@ export class WorkflowClient extends BaseClient {
510511
511512 protected async _start < T extends Workflow > (
512513 workflowTypeOrFunc : string | T ,
513- options : WithWorkflowArgs < T , WorkflowOptions > ,
514+ options : WorkflowStartOptions < T > ,
514515 interceptors : WorkflowClientInterceptor [ ]
515516 ) : Promise < string > {
516517 const workflowType = extractWorkflowType ( workflowTypeOrFunc ) ;
@@ -1196,6 +1197,7 @@ export class WorkflowClient extends BaseClient {
11961197 protected async _signalWithStartWorkflowHandler ( input : WorkflowSignalWithStartInput ) : Promise < string > {
11971198 const { identity } = this . options ;
11981199 const { options, workflowType, signalName, signalArgs, headers } = input ;
1200+ const jsonConverter = new JsonPayloadConverter ( ) ;
11991201 const req : temporal . api . workflowservice . v1 . ISignalWithStartWorkflowExecutionRequest = {
12001202 namespace : this . options . namespace ,
12011203 identity,
@@ -1225,6 +1227,10 @@ export class WorkflowClient extends BaseClient {
12251227 : undefined ,
12261228 cronSchedule : options . cronSchedule ,
12271229 header : { fields : headers } ,
1230+ userMetadata : {
1231+ summary : jsonConverter . toPayload ( options ?. staticSummary ) ,
1232+ details : jsonConverter . toPayload ( options ?. staticDetails )
1233+ }
12281234 } ;
12291235 try {
12301236 return ( await this . workflowService . signalWithStartWorkflowExecution ( req ) ) . runId ;
@@ -1265,7 +1271,7 @@ export class WorkflowClient extends BaseClient {
12651271 protected async createStartWorkflowRequest ( input : WorkflowStartInput ) : Promise < StartWorkflowExecutionRequest > {
12661272 const { options : opts , workflowType, headers } = input ;
12671273 const { identity, namespace } = this . options ;
1268-
1274+ const jsonConverter = new JsonPayloadConverter ( )
12691275 return {
12701276 namespace,
12711277 identity,
@@ -1293,6 +1299,10 @@ export class WorkflowClient extends BaseClient {
12931299 : undefined ,
12941300 cronSchedule : opts . cronSchedule ,
12951301 header : { fields : headers } ,
1302+ userMetadata : {
1303+ summary : jsonConverter . toPayload ( opts ?. staticSummary ) ,
1304+ details : jsonConverter . toPayload ( opts ?. staticDetails )
1305+ }
12961306 } ;
12971307 }
12981308
@@ -1426,8 +1436,12 @@ export class WorkflowClient extends BaseClient {
14261436 workflowExecution : { workflowId, runId } ,
14271437 } ) ;
14281438 const info = await executionInfoFromRaw ( raw . workflowExecutionInfo ?? { } , this . client . dataConverter , raw ) ;
1439+ const jsonConverter = new JsonPayloadConverter ( )
1440+ const userMetadata = raw . executionConfig ?. userMetadata
14291441 return {
14301442 ...info ,
1443+ staticDetails : userMetadata ?. details ? jsonConverter . fromPayload ( userMetadata . details ) : undefined ,
1444+ staticSummary : userMetadata ?. summary ? jsonConverter . fromPayload ( userMetadata . summary ) : undefined ,
14311445 raw,
14321446 } ;
14331447 } ,
0 commit comments