Support Callback state from serverless workflow DSL


I am looking at the Java samples for supporting the serveless workflow DSL. I have couple of questions.

  1. I see that there is support for various states like Operation, Event, Switch etc. But I couldn’t find the support or examples for Callback state. Is there plan to add it to the sample code?
  2. I am looking to get results after every state. Is that possible?

Prasad patil

Hi, sure we can add sample for Callback state, please add feature request here.
It would be just invocation of activity to invoke a service and then Workflow.await(condition), or Workflow.await(duration, condition) after to wait for completion signal(s).

For the second question, not sure this is needed, can you give use case for it please?
Typically you would maintain state as your temporal workflow state during execution and update it based on activity results, signal payloads, etc.

Thank you @tihomir . I am able to get callback working. It executes the activity and then await for the signal. I used run id as correlation property to identify the existing workflow instance when it receives signal.

For the 2nd question, let me revisit and ask you specific question if any. I think I am almost getting this right now.

Also the swtemporal repo, is there any license for using or extending this repo?

Also the swtemporal repo, is there any license for using or extending this repo?

feel free to use it as you wish :slight_smile:

Hi @tihomir I have another question related to callback implementation. I want to return data returned by function called and then await. So the flow I am trying to build is

  1. The workflow is advanced to the callback state.
  2. The function “f1” is called. It returns value "r1. "
  3. Return “r1” to the UI (this value UI can use for human decisions)
  4. Await(signal1)
  5. UI submits data to backend
  6. Backend sends signal signal1 to workflow instance
  7. Execution continues

My confusion is around 3 and 4 how to archive that. The help would be appreciated.