# Workflow signal and query

**URL:** <https://community.temporal.io/t/workflow-signal-and-query/8577>\
**Category:** Community Support\
**Tags:** go-sdk, general-impl\
**Created:** [June 20, 2023, 10:23am UTC](https://community.temporal.io/t/workflow-signal-and-query/8577 "2023-06-20T10:23:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomaz\_Cuk](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tomaz_cuk/32/3929_2.png) [@Tomaz\_Cuk](https://community.temporal.io/u/Tomaz_Cuk)\
**Post date:** [June 20, 2023, 10:23am UTC](https://community.temporal.io/t/workflow-signal-and-query/8577/1 "2023-06-20T10:23:56Z")

</div>

Hi, we are trying to adopt Temporal at our company but we have a fundamental issue regarding signals and queries.

One of our use cases is multi-step registration and this is the outline of the workflow:

1. Receive HTTP request and begin execution of the workflow with some parameters like email/phone…
2. The workflow executes validation code and then sends a verification code to the provided email/phone. If there is any error during this phase the workflow exits.
3. Then it waits for signals, one signal that can be received is the verification code and another is a resend request that sends the verification code again. There is also a timer for timeout at which we stop the workflow.
4. When it receives the verification code, it verifies it with our external provider and if it’s correct, creates a user record in the DB.

Now along of these steps there can be an error for example when the user sends a HTTP request for registration, we have to send him a response indicating either an error during validation or sending, or a success.  
Another example is when the user sends a HTTP request with the code, we send a signal to the workflow and then we have to send him a response if the code is correct or not.

We tried accomplishing that with queries so after the code is sent we change a boolean variable to true and if there is an error we set a variable. In the HTTP request code, we execute the workflow and then query the workflow for results and because sending the code takes some time, the query already returns a result with variables set to false even though later the operation is successful.

One of the ways I guess is polling the query every x milliseconds but that is a lot of queries and latency and it doesn’t feel right to me.  
Has anybody encountered this problem and has any solutions?

---

<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:** [June 20, 2023, 2:30pm UTC](https://community.temporal.io/t/workflow-signal-and-query/8577/2 "2023-06-20T14:30:02Z")

</div>

The solution is a synchronous update feature that is expected to be a part of the next release. Polling query every x milliseconds is a reasonable workaround until the update is released.
