Complete Parent workflow, once ChildWorkflow is scheduled/started

I want my parent workflow to call a long running child workflow asynchronously.
I want to keep it untype (for future flexibility). so here is what I am doing as per docs

        val childUntyped = Workflow.newUntypedChildWorkflowStub(
        val childExecution = childUntyped.executeAsync(
        // Important:This is to ensure that a Child Workflow Execution starts before the parent closes.
        // If the parent initiates a Child Workflow Execution and then completes immediately after,
        // the Child Workflow will never execute. Refer:
        childExecution.get()"Successfully Scheduled Child workflow")

both workflows are kicked off.

  • child workflow has a timer and is still running.

  • I expected the parent workflow to complete after the child workflow has started. but I see it is still waiting for the promise - childExecution.get()

I am not sure why the promise is not returned after child has started?

ChildWorkflowStub.executeAsync returns a Promise that becomes ready when a child workflow completes. Use ChildWorkflowStub.getExecution() to get a Promise that becomes ready when the child workflow starts.