temporalio / temporalio/sdk-java
Allow setting *additional* memo values in ContinueAsNewOptions
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
Is your feature request related to a problem? Please describe.
We have an abstraction for starting workflows that sets some standard memo values. I have a new use case where I'd like to continue-as-new a workflow execution (started using the above mentioned abstraction) but when doing so, set a few additional memo values that the next run would read. Today, ContinueAsNewOptions allows setting the entire memo map (using ContinueAsNewOptions.newBuilder().setMemo()). Thus, in order to add new memo values to the next run while preserving existing values, we need to extract all the values (which requires knowing the entire key set) and then merging those with the new values. There is currently no API to either list all keys present in the memo, or to fetch the entire memo structure.
Describe the solution you'd like
Ideally, ContinueAsNewOptions.Builder should provide an addMemo(key, value) method which overrides the value in the current execution's memo if present, or else, adds it to the next workflow execution.
Describe alternatives you've considered
Alternative approaches:
1/ add the memo values to the next workflow's arguments (leaky abstraction)
2/ maintain a list of all known memo keys and use that to extract the entire memo when building ContinueAsNewOptions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ContinueAsNewOptions.Builder and the existing setMemo() API, then inspect how the current execution's memo is accessed and how continue-as-new options are tested. Done means an addMemo(key, value) API can preserve existing memo values while overriding or adding the specified key for the next workflow run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100