temporalio / temporalio/sdk-java

Allow setting *additional* memo values in ContinueAsNewOptions

Open
#1,621 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.