Skip to content

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

@karunagoyal

Description

@karunagoyal

The @WorkflowImpl annotation has two attributes for specifying which worker to register a workflow with:
workers - by worker name
taskQueues - by task queue
Currently, only taskQueues supports Spring property placeholders (e.g., ${my.property}), while workers does not. This inconsistency causes issues when sharing workflow modules across multiple services that need different worker names.

Current Behavior
In WorkersTemplate.java:
taskQueues - ✅ Resolves placeholders:
workers - ❌ Does NOT resolve placeholders:

Expected Behavior
Both workers and taskQueues should support Spring property placeholders for consistency:

Use Case
We have a shared workflow module used by multiple Spring Boot services. Each service configures its own worker name in application.yaml. We want to use:
Currently, this fails because the placeholder is not resolved, causing:
Workaround
Using taskQueues with a placeholder works:
However, this is inconsistent with the workers attribute behavior.

Proposed Fix
Add placeholder resolution in configureWorkflowImplementationsByWorkerName(), configureActivityBeansByWorkerName(), and configureNexusServiceBeansByWorkerName() methods in WorkersTemplate.java.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions