# How to Direct Signals to Specific Workflow Execution?

**URL:** <https://community.temporal.io/t/how-to-direct-signals-to-specific-workflow-execution/9121>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [August 9, 2023, 2:57am UTC](https://community.temporal.io/t/how-to-direct-signals-to-specific-workflow-execution/9121 "2023-08-09T02:57:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MedGr](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@MedGr](https://community.temporal.io/u/MedGr)\
**Post date:** [August 9, 2023, 2:57am UTC](https://community.temporal.io/t/how-to-direct-signals-to-specific-workflow-execution/9121/1 "2023-08-09T02:57:35Z")

</div>

Given that I initiated a workflow execution with workflowId 111, and later I started another workflow execution with workflowId 222 (workflow 111 is still running). Now, when I attempt to send a signal to workflow 111, the signal gets sent to the latest workflow execution, which is workflow 222. How can I address this issue? In other words, how can I specify the workflow ID to which I intend to send a signal?  
I am using Temporal with Spring Boot.

**Update:** I have discovered a potential solution to this issue. Here is the code:

```auto
DemoWorkflow workflow = workflowClient.newWorkflowStub(DemoWorkflow.class, workflowId); // workflowClient is an injected spring bean
workflow.sendSignal();

```

I’m curious to know if this approach is recommended. Additionally, when using the `newWorkflowStub` method, does it create a new instance of the workflow stub object each time, or is it like `getWorkflowStub` in terms of object creation?

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [August 9, 2023, 11:29am UTC](https://community.temporal.io/t/how-to-direct-signals-to-specific-workflow-execution/9121/2 "2023-08-09T11:29:51Z")

</div>

Hi @MedGr

`newWorkflowStub ` creates a proxy that allows you to interact with the workflow execution

Is signaling the workflow execution working for you now?

Antonio

---

<div class="post-metadata">

**Author:** ![MedGr](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@MedGr](https://community.temporal.io/u/MedGr)\
**Post date:** [August 9, 2023, 5:50pm UTC](https://community.temporal.io/t/how-to-direct-signals-to-specific-workflow-execution/9121/3 "2023-08-09T17:50:55Z")

</div>

Hi @antonio.perez,

Thank you for your prompt response.

Yes, the signal is functioning as expected now. However, I’m still curious to know if this approach is the recommended method or if there’s a simpler way to achieve the same outcome.

Regarding the `newWorkflowStub` function, I’m wondering if it generates a new proxy instance or simply retrieves an existing one. If it creates new instances, I’m wondering if this could have any implications for memory performance.

Your insights are greatly appreciated!

---

<div class="post-metadata">

**Author:** ![anshu\_tyagi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/anshu_tyagi/32/7111_2.png) [@anshu\_tyagi](https://community.temporal.io/u/anshu_tyagi)\
**Post date:** [April 8, 2025, 6:26am UTC](https://community.temporal.io/t/how-to-direct-signals-to-specific-workflow-execution/9121/4 "2025-04-08T06:26:11Z")

</div>

> [@MedGr](#):
>
> `workflowClient.newWorkflowStub`

This works.
