Workflow Signalling Deadlock

What happens when two workflows try to communicate with each other at the exact same time? Is it a deadlock? How can it be resolved?
WF 1 → tries to message WF2 using ExternalWorkflowStub
WF 2 → tries to message WF1 using ExternalWorkflowStub

link for reference

Hi @Hrishikesh_Chappadi

It should work fine if both workflows are running when you try to send the signal to them.

what is the error you are facing? Can you share your code?

Can you describe your use case for this? Are you relying on some sort of order of receiving the signals or is this just a generic question? In Java SDK each signal is handled in its own workflow thread, so receiving and handling one signal does not block all consecutive signals that are received at the same time.

I’m not exactly relying on the order…

But W1 trying to communicate with W2 will fail if W2 is also blocked on trying to communicate with W1 right?

No, there is no blocking condition in this case.

The signal is delivered asynchronously. So if the workflow code is blocked on something, the signal handler is still called in a different thread.