Skip to content

Expose memo on WorkflowStartOptions#1323

Open
GregBowyer wants to merge 1 commit into
temporalio:mainfrom
ticketmaster:add-memos
Open

Expose memo on WorkflowStartOptions#1323
GregBowyer wants to merge 1 commit into
temporalio:mainfrom
ticketmaster:add-memos

Conversation

@GregBowyer

Copy link
Copy Markdown
Contributor

What was changed

Adds a public memo: Option<HashMap<String, Payload>> field to the bon::Builder-generated builder for WorkflowStartOptions, and wires it through both the StartWorkflowExecutionRequest and SignalWithStartWorkflowExecutionRequest construction paths in client::start_workflow.

Memos are returned by list_workflows and describe_workflow_execution, so this lets callers stash small caller-supplied metadata on a workflow without round-tripping through a query. The values must already be serialized Payloads -- the builder does not encode for you.

Includes three unit tests covering builder default, builder set, and clone round-trip.

Why?

So end users of the high level rust SDK can use memos ;)

Checklist

  1. How was this tested:
    Basic unit tests and inhouse software

  2. Any docs updates needed?
    Not sure probably

Adds a public `memo: Option<HashMap<String, Payload>>` field to the
bon::Builder-generated builder for WorkflowStartOptions, and wires it
through both the StartWorkflowExecutionRequest and
SignalWithStartWorkflowExecutionRequest construction paths in
client::start_workflow.

Memos are returned by list_workflows and describe_workflow_execution, so
this lets callers stash small caller-supplied metadata on a workflow
without round-tripping through a query. The values must already be
serialized Payloads -- the builder does not encode for you.

Includes three unit tests covering builder default, builder set, and
clone round-trip.
@GregBowyer GregBowyer requested a review from a team as a code owner June 10, 2026 01:51
/// caller-supplied metadata on a workflow without round-tripping through a query.
/// Each value must already be a serialized `Payload`; the builder does not encode
/// values for you.
pub memo: Option<HashMap<String, Payload>>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure you're just following the pattern with search_attributes here, but, this field (and search_attributes) I think both need helpers on the builder that accept T: TemporalSerializable types, to make the actual serialization easy for users.

Then inside this struct we can store Box<dyn TemporalSerializable>s instead of Payloads and convert them later when these options are passed to the client call.

If you'd rather not do all that we can take over the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants