Querying Workflow after Signal

Question on Signals:

If I send a signal to my workflow and then immediately query the workflow:

const workflowHandler = await temporalClient.workflow.signalWithStart( .....

const info = await workflowHandler.query(.....

Can I assume that the signal will executed/completed before the query returns? Or is there a race condition here?

I want to make sure that the query will return the updated workflow state from the signal

There is a guarantee that the signal handler is invoked before the query handler. However, the signal handler can block for a long time and is not guaranteed to complete before the query handler is invoked.

1 Like