Listening to multiple external signals

Hello,

We are building a new workflow system on top of Temporal and wanted to clarify a few things.

Imagine a use-case:

  1. Send an email to list of users
  2. Wait for 7 days
  3. For users who didn’t open the email, send a follow up email
  4. As soon as the user opens the follow up email and visits the website, notify downstream service.

Going through the documentation, sending the email will be a separate activity and we are planning to use signals to wait for the external event.

The questions we have are:
A. Can the signal state be maintained within the workflow execution, or is it better to persist it in a db?
B. We are planning to use a DSL/Internal UI to define the business workflow and translate that to a Temporal workflow. From step (3) in the above example, how can we listen to multiple signals?
C. Do you have any Java examples for converting a DSL to a Temporal workflow?

A. Can the signal state be maintained within the workflow execution, or is it better to persist it in a db?

Yes, the state can be maintained within workflow execution. The durability of the whole workflow state is one of the main benefits of Temporal.

B. We are planning to use a DSL/Internal UI to define the business workflow and translate that to a Temporal workflow. From step (3) in the above example, how can we listen to multiple signals?

When using the Java SDK you define multiple methods annotated with @SignalMethod. When using the Go SDK use Selector to listen on multiple signal channels.

C. Do you have any Java examples for converting a DSL to a Temporal workflow?

We don’t have the Java DSL sample yet. In the meantime, I would recommend looking at the Go one as the basic idea is the same.