ContinueAsNew and execution result?

Hi, we have a use case where a workflow needs to return a result to calling client and continue execution as new workflow (different workflow fn but same workflow id). However it seems like success return result is ignored if the workflow return NewContinueAsNewError?

func WorkflowA(ctx workflow.Context, input string) (Response, error) {
...

return Response{Result: 123}, workflow.NewContinueAsNewError(ctx, WorkflowB, newInput)
}

I’ve tried to use the DisableFollowingRuns in the client e.g.

we, err := c.ExecuteWorkflow(ctx, options, WorkflowA, input)
var res Response
err := we.GetWithOptions(ctx, &res, client.WorkflowRunGetOptions{
	DisableFollowingRuns: true,
})

we want res to be {Result:123} but it is never filled in.

If this is not possible, is there any workaround for this?

Thanks in advance!!

It is not currently possible. We plan to add this as part of the synchronous update feature.
The current workaround is to have a workflow that returns the value and starts an abandoned child workflow that implements background processing.

thanks Maxim! glad to hear that its part of the future planned feature :man_bowing:

The current workaround is to have a workflow that returns the value and starts an abandoned child workflow that implements background processing.

we thought of this (please cmiiw) where WorkflowA execute WorkflowB as child with abandon policy, but given that both the WorkflowA and WorkflowB needs to have same workflow ID, is this even possible?

cos i imagine we need someone else to execute WorkflowB just after WorkflowA is finished. but then we might need some mechanism to ensure no race condition happen where client execute another WorkflowA (and steal the workflow ID) in between the time when prev WorkflowA is finished and WorkflowB is executed?

I’m facing the same use case here, does this feature have any ETA or any public issue where we can track the progress?