In the How to Send Signals section of the “Signalling Your Workflows” chapter of the “Interacting with Workflow with Java” course, is this paragraph:
Another reason we use the
newExternalWorkflowStub
method is to ensure that Workflows remain deterministic. Recall that one aspect of deterministic Workflows means not directly making network calls from the Workflow. This means that developers cannot use a Temporal Client directly within the Workflow code to send Signals or start other Workflows. Instead, to communicate between Workflows, we usenewExternalWorkflowStub
to both ensure that Workflows remain deterministic and also that these interactions are recorded as Events in the Workflow’s Event History.
I understand the part about recording Events, but I do not understand the rest. I know what “deterministic” means, but how does using newExternalWorkflowStub
ensure that Workflows remain deterministic? How does the alternative fail to do so?