continue as new restarts the workflow with the same
WorkflowId from the beginning. The previous run of the workflow can pass arguments to the next one.
The workflow started with step1 and entered the while loop and the while loop is running lets say 100000. To avoid the history getting accumulated, I want to invoke each 1000 itereations a new workflow(continuedAsNew) but that will start the flow again.
If you want to use continue as new only for the
step4 loop then consider executing it in a child workflow. The parent doesn’t see that child called continue as new, it is only notified when the last child run is completed.
The same is not found din java sdk ContinueAsNewError, I want to understand l
The continue as new is implemented on the server side. So the semantic is exactly the same for all SDKs. In Java as soon as the workflow method of the continue as new stub is called the workflow run ends and the new one starts from the beginning.