I have a variable A in the ChildWorkflow . Now I want to pass it to the parent ParentWorkflow. How do I do it?
Hello @lyq
You can signal the parent workflow
Optional<String> parentWorkflowId = Workflow.getInfo().getParentWorkflowId();
if (parentWorkflowId.isPresent()) {
String parentId = parentWorkflowId.get();
Child parent =
Workflow.newExternalWorkflowStub(Parent.class, parentId);
parent.signal(value);
}
or return the value in the child workflow and wait in the parent for the child workflow to complete
Let me know if it helps