Skip to content

Resolve property placeholders in Spring Boot worker names - #3143

Open
SamuelAdigos wants to merge 1 commit into
temporalio:mainfrom
SamuelAdigos:feat/2747-resolve-worker-name-placeholders
Open

SamuelAdigos wants to merge 1 commit into
temporalio:mainfrom
SamuelAdigos:feat/2747-resolve-worker-name-placeholders

Conversation

@SamuelAdigos

Copy link
Copy Markdown

What was changed

The workers attribute of @WorkflowImpl, @ActivityImpl and @NexusServiceImpl now resolves Spring property placeholders such as ${my.worker.name}, the same way taskQueues already does.

  • WorkersTemplate: worker names from the annotations go through environment.resolvePlaceholders before the worker lookup.
  • Documented placeholder support on the workers attribute of the three annotations.
  • Added a CHANGELOG.md entry under Added.

Why?

Only taskQueues resolved placeholders, so workers = "${...}" looked up a worker literally named ${...} and startup failed with BeanDefinitionValidationException. This makes it impossible to share a workflow module between services that configure different worker names.

Checklist

  1. Closes @WorkflowImpl(workers = "...") should support Spring property placeholders like taskQueues does #2747

  2. How was this tested:
    Following the existing taskQueues resolver test, the byworkername test implementations now use workers = "${default-worker.name:mainWorker}", so the existing worker-name tests cover the default value. The new AutoDiscoveryByWorkerNameResolverTest activates a profile that sets the property to another worker and runs a workflow with an activity and a Nexus operation, plus a dynamic workflow. Without the change both tests fail at startup with Worker with name ${default-worker.name:mainWorker} is not found in the config; with it they pass. :temporal-spring-boot-autoconfigure:test passes on Spring Boot 2.7, 3 and 4 and in the dev-server lane on Java 11.

  3. Any docs updates needed?
    No. The Javadoc of the annotations is updated.

The workers attribute of @WorkflowImpl, @ActivityImpl and
@NexusServiceImpl was used verbatim, while taskQueues already went
through the Spring environment's placeholder resolution. A worker name
such as ${my.worker.name} was therefore looked up literally and startup
failed with BeanDefinitionValidationException, which prevented sharing
a workflow module between services with different worker names.

Resolve placeholders in worker names before the worker lookup, the same
way task queues are resolved, and document it on the annotations.

Fixes temporalio#2747.
@SamuelAdigos
SamuelAdigos requested a review from a team as a code owner October 12, 2026 03:22

This branch has not been deployed

No deployments
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.

@WorkflowImpl(workers = "...") should support Spring property placeholders like taskQueues does

1 participant