Signals vs Asynchronous Activity Completion

I’m pondering the idea of using Temporal for a signup workflow and wondering which of these is more suited to my use case;

iPhone Application

  1. user enters email address – workflow starts >> createandsendtokenactivity
  2. user receives an email with a verification token link
  3. user clicks verification token link – signal? async?tokenvalidationactivity
  4. user enters phone number – signal? async?
  5. user receives otp via sms – createandsendotpactivity
  6. use enters otp – otpvalidationactivity >> workflow completes
1 Like

TLDR; I would use signals for 3, 4, and 6.

While you could technically use the async activity completion for these, signals are a better fit. The reason is that initiating an operation can fail and should be retried and this requires timeouts and retry policy just for that operation. The reply from the user is usually can take much longer and has its own timeouts.

Another reason for using signals for manual interactions is that such interactions frequently have multiple states. For example, a task can be available, assigned, timed out, completed, etc. In this case modeling external events that happen to it through signal is the only way to track its state transitions.