Multiple external triggers to resume the same workflow

Hi Temporal Community,

I need your assistance regarding an application I am building in Go that provides a certain product to users through a mobile application. The workflow involves several steps, and I am exploring Temporal to manage this process. Here is an overview of the workflow:

  1. User Data Entry: Users enter data through multiple pages sequentially in the app. Each page has a submit button that advances the backend (BE) process to the next step. The BE needs to get the data, advance to the next step, and return control to the user (client) for the next data entry step.
  2. Separate Workstreams: Within the user journey, there could be other completely different workstreams that the user needs to carry out, such as KYC, which is separate from the loan journey.
  3. Backend Processing: Once the user is done submitting data on all pages, the BE needs to perform a series of steps like risk checks and payments, involving other microservices in a specified sequence.
  4. Operations Team Intervention: In certain scenarios, an operations team will need to approve the loan or perform other tasks that will resume the user’s journey.
  5. Event-Driven Resumption: Other BE services might send events in Kafka that would resume the ongoing flow.

We currently manage this with state machines, but it is becoming increasingly difficult to maintain and keep bug-free. Therefore, we are exploring Temporal for this purpose.

My Questions:

  1. How can Temporal handle the steps mentioned above?
  2. Are there specific sections or features within Temporal that I should explore for this use case?
  3. Are there any example code references or documentation that would be particularly helpful?
  4. Based on your experience, is Temporal a good fit for this type of workflow?

Any additional insights or suggestions to gather the best answers from the community would be greatly appreciated.

Thank you!

  1. Easily :). Let us know if you have a specific concern or question about how to implement this logic.
  2. See Workflow message passing - Java SDK | Temporal Platform Documentation
  3. A new reference application to understand how to build with Temporal | Temporal
  4. Absolutely. Many production use cases resemble your application.

You can find more resources at learn.temporal.io

Appreciate the prompt response. I went through the resources you suggested. I am not very clear on the implementation of the following things -

  1. I understand that signals can be used to communicate with the ongoing workflow from the external world. But my question is - when a signal is sent to the WF from another part of the code, is it possible to get back a response from the WF when it encounters another await signal? In other words, is it possible for the WF caller or the signal triggerer to get a response from the WF whenever the WF awaits for another signal? Basically it is important for the outside world to know when it can send another signal. I want to send a signal only when it is done processing the earlier signal and is awaiting another one.
  2. As part of the FE interaction, at every page in the APP, we want to do two calls to the BE - one POST call to submit the data input by the user and move the workflow one step forward, and one GET call to fetch some data from BE using whatever data has been input already from FE in the POST call. What’s a good way to implement this within a Temporal Workflow?
  1. Use update instead of signal to receive response.
  2. Use update.
1 Like