0

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})`);
}
O

Output:

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

I expected to get {"fieldName":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} again.

What’s going on here in your opinion?

Thank you for your help.

1 Answer 1

0

External visibility store does not receive memo updates from upsert's. You will only see the updated memo from within your workflow, and workflowExecutions.executions will only see the initial state of the memo. The best comes to mind is search attributes. https://docs.temporal.io/visibility https://docs.temporal.io/develop/typescript/observability#visibility

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.