i’m wondering if there are any best practices on using long-running workflows as actors.
this simple case seems straightforward - signals and queries are inputs and outputs, the workflow method is the state machine loop, and it will continue-as-new when the history gets too long.
i’m also thinking of a slightly more advanced case: an actor that spawns additional actors. naively, this seems like it could be done with child workflows, but it is unclear from the documentation (and java SDK) how this would interact with continue-as-new.
will a child workflow’s parent close policy be invoked if the parent does a continue-as-new?
rather than child workflows, instead should there be an activity that spawns an independent workflow, and the workflow IDs for any running “children” be passed to the next execution in continue-is-new?
the bit you had a question on @tihomir is the same thing that the sliding window workflow calls out as an assumption:
The assumption is that the parent workflow doesn’t need to deal with child workflow results and failures.
i’m not concerned with child workflow results, but i do want to have the parent deal with child workflow failures.
that’s where i was thinking about passing the set of active child workflow IDs through continueAsNew so the “new parent” can continue to keep track of them.
Unfortunately, at this point, it is not possible if you need to call continue-as-new. Here is the issue to allow listening for a result of an external workflow.