Reading a memo using TypeScript

Hello.
I successfully called upsertMemo in an Activity, but WorkflowExecutionInfo.memo is still empty when I look for it in a list of all worfklow executions obtained via TemporalClient.workflowService.listWorkflowExecutions.

This is my worker code:

    const fieldValue = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    upsertMemo({'fieldName': fieldValue});
    console.log(`Memo set to ${JSON.stringify(workflowInfo().memo)}`);

Output:

Memo set to {"fieldName":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

This is my consumer code:

  const client: Client = await this.temporalService.getClient();
  const workflowExecutions = await client.workflowService.listWorkflowExecutions({
      query: "WorkflowType = 'workflowName'", 
      namespace: 'default',            
  });
  const ids = [];
  for await (const execution of workflowExecutions.executions) {
      console.log(`Found workflow ${execution.execution?.workflowId}`);
      const memo = execution.memo;
      console.log(`Memo = ${JSON.stringify(memo)} (${memo})`);
  }

Output:

Found workflow 2c81a11a-512a-4e56-88b8-00ea5762f81d
Memo = {} ([object Object])

What’s going on here in your opinion?
Thank you for your help.

I successfully called upsertMemo in an Activity

workflow.UpsertMemo is workflow api, can you give a bit more info on how you are calling this inside your activity code?

Inside workflow code you should be able to do something like

workflow.upsertMemo({
    ...
  });

and get handle on your workflow memo with
workflow.workflowInfo().memo

in your event history you should also see the associated event when your memo is upserved with type
"eventType": "EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED",

This is my consumer code:

This looks ok and if memo was correctly upserted in workflow code it should return its latest value you set.