# Are there any guidelines or a precaution around using a @SignalMethod and an @UpdateMethod for the same workflow?

**URL:** <https://community.temporal.io/t/are-there-any-guidelines-or-a-precaution-around-using-a-signalmethod-and-an-updatemethod-for-the-same-workflow/17457>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [May 19, 2025, 5:17pm UTC](https://community.temporal.io/t/are-there-any-guidelines-or-a-precaution-around-using-a-signalmethod-and-an-updatemethod-for-the-same-workflow/17457 "2025-05-19T17:17:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubhamutwal](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/shubhamutwal/32/6325_2.png) [@shubhamutwal](https://community.temporal.io/u/shubhamutwal)\
**Post date:** [May 19, 2025, 5:17pm UTC](https://community.temporal.io/t/are-there-any-guidelines-or-a-precaution-around-using-a-signalmethod-and-an-updatemethod-for-the-same-workflow/17457/1 "2025-05-19T17:17:12Z")

</div>

Both the @SignalMethod and the @UpdateMethod update the state of the workflow, the @SignalMethod was conveniently used with the signalWithStart() method allowing me to start a workflow if it’s not started already, and signal it if it’s already running.

I have seen a few instances where the @UpdateMethod can race with the @SignalMethod and cause disruptions in the event histories, affecting the replays of events when the workflow state gets reconstructed on long running workflows.

Temporal SDK: 1.25.0

Code Snippet:

```java
@WorkflowInterface
public interface DemoWorkflow {
    @WorkflowMethod
    void startWorkflow(WorkflowInput input);

    @UpdateMethod
    Response get(String Id);

    @SignalMethod
    void aggregate(Payload payload);
}

// client code:
final BatchRequest batchRequest = workflowClient.newSignalWithStartRequest();
           
batchRequest.add(notificationWorkflow::startWorkflow, new WorkflowInput());
batchRequest.add(workflow::aggregate, payload);

final WorkflowExecution workflowExecution = workflowClient.signalWithStart(batchRequest);

```

---

<div class="post-metadata">

**Author:** ![shubhamutwal](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/shubhamutwal/32/6325_2.png) [@shubhamutwal](https://community.temporal.io/u/shubhamutwal)\
**Post date:** [May 19, 2025, 5:18pm UTC](https://community.temporal.io/t/are-there-any-guidelines-or-a-precaution-around-using-a-signalmethod-and-an-updatemethod-for-the-same-workflow/17457/2 "2025-05-19T17:18:45Z")

</div>

@maxim any ideas? ^

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 25, 2025, 3:34pm UTC](https://community.temporal.io/t/are-there-any-guidelines-or-a-precaution-around-using-a-signalmethod-and-an-updatemethod-for-the-same-workflow/17457/3 "2025-05-25T15:34:40Z")

</div>

If you believe that there is a bug in the SDK, please submit a reproduction or at least specific scenarios with more details. It is very hard to troubleshoot a problem based on “I have seen a few instances” without any specifics.
