temporalio / temporalio/sdk-java
Java SDK does not have option to register workflow name statically
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.
I'm always frustrated when trying to register a Java workflow with a static name. The current option using annotations does not work for our use case. We define proto enums and share them across different apps so they can trigger workflows across apps. For instance, we have:
public interface MyWorkflow {
@WorkflowMethod(name = "MyStaticWorkflowName")
void execute();
}
We need a way to set a default workflow implementation type name during registration.
Describe the solution you'd like
A method to register a workflow with a static name during registration using something like:
WorkflowImplementationOptions options = WorkflowImplementationOptions.newBuilder()
.setDefaultWorkflowImplementationTypeName(Workflows.WORKFLOWS_SEND_SUBMISSION.name())
.build();
worker.registerWorkflowImplementationTypes(options, SendSubmissionWorkflowImpl.class);
This would allow us to define workflows that can be triggered across different apps with a shared static name.
Describe alternatives you've considered
Currently, the alternative is to use the short name of the workflow interface by default. However, this does not meet our needs as we cannot share interfaces across apps written in different languages (Golang, Python). Using annotations alone is insufficient for our scenario.
Additional context
Our apps in Golang and Python cannot share Java interfaces, hence the need for a static name registration method. We currently share these names through protobuf-defined enums which can be built for all apps and envs.
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 WorkflowImplementationOptions and the worker.registerWorkflowImplementationTypes entry point shown in the issue, then trace how workflow implementation type names are selected during registration. Done means a registration can supply a static default name for the implementation and the behavior is covered by appropriate SDK tests, including compatibility with annotation-based names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 43/100