Store state in workflow class level variable


For Java SDK. Please consider next use case.

  1. Start workflow
  2. Signal workflow and add some external value to class level variable. Eg some mutable List (ArrayList)
  3. Just before finish of workflow as a last step check if List has any value
  4. If yes, continue same workflow AsNew by provide List and object from List as input
  5. Exec new workflow.

Is it working case for Temporal?

Yes, this sounds like a pretty simple scenario.

1 Like