Temporal workflow with task waiting for user input?

Hey we are trying to build a front end application and trying to use temporal as our workflow orchestration engine.

We have several user input phases in our use cases, like

user input + trigger async job A + waiting for user input + trigger async job B.

Does temporal currently support something like that without breaking the whole workflow into smaller workflows to exclude user input phases?

Would you explain what “waiting for user input” means in the context of your application?

Temporal supports signals which are asynchronous events that are delivered to a workflow. Usually, external user input is modeled as a signal. A workflow code can wait for a signal if needed.

Hey,

Sure let me elaborate our use case in a simplified manner.

  1. Render front-end module to start asking user initial questions
  2. Kick off async job A, which takes answers from previous questions as input.
  3. Render a series of front-end modules to let user pick among options that are generated from the previous job A.
  4. Kick off two sequential asyncs job B + C, which takes the selected option as the input.

As you can see the latter steps always take the output of the previous step as input and each step waits for the previous steps to be finished first.

My question is if treating all of the steps above as a single workflow, each step as a task, is it something temporal can support? If it’s supported, do we have a similar use case or support documents that you can share?

I have limited knowledge on temporal right now. According to my current understanding, once a signal is sent to temporal server to start the workflow, then worker will start executing the workflow. Then the question becomes is it possible to render front end module and start gathering user input in the middle of a workflow and once the input is received, resume the workflow to the next activities.

@pumpopo - look at examples of how signals are used.

You can use queries on the workflow to communicate state to the frontend (e.g. what view to render).

You can use signals to pass information back to the workflow. You can suspend workflow execution while waiting for a signal and then resume once the signal comes in.

See Signals in Java | Temporal documentation