With SignalWithStartWorkflow if the workflow isn’t running and a new one needs to be started, will it start at the point of the signal or will it rerun the workflow again passing in the signal?
Act A, Act B, BlockWaitSignal, Act C
will only Act C be run as that signal is designed to get information for it to run
Is there a way to get a behaviour where Act A, Act B are not redone? because they’ve already been done.
Act A - successful
Act B - successful
BlockWaitSignal - SignalWorkflow received signal - user submits phone number
Act C - send user SMS with OTP — (succeeds internally and workflow ends but user didn’t receive SMS or OTP expired)
the next thing is for user to click resend code - which does SignalWithStartWorkflow, maybe a way to wrap activities to check where the workflow was started with SignalWithStartWorkflow
I think there is some misunderstanding. Act A, Act B will not be redone. SignalWithStart has nothing to do with the order activities are executed or reexecuted. It only. starts a new workflow execution if it is not already running. In your case, it is always expected to be running, so it will just send a signal. I would also recommend using SignalWorkflowExecution here as it is expected that the workflow is already running when user clicks “resend code”.
The workflow will end soon as Act C is done - so the workflow isn’t running during resend. Once an OTP is sent the workflow ends - validation of the OTP is not done within thesame workflow.
Hmm it should be within 60mins in reality. so once we send the OTP first time (Act C) it succeeds - how do we keep the workflow running – for another 60mins incase user sends a SignalWithStartWorkflow with their phone number because OTP isn’t received or is expired - and successfully complete the workflow after 60mins assuming successful.
I guess in that case we will always use - SignalWorkflow since we’re keeping it running. not sure how to keep it running.