This is a Burst Task with parent - child workflows, where Parent workflow calls activity and activity creates child workflows. Creating parent workflow and calling activity part works fine. From Activity when tried to create number of child workflows gets an error as below:
for (task in 1..numTasks) {
Workflow.newChildWorkflowStub(XxxWorkflowInterface::class.java, childWorkflowOptions)
}
“thread”:“Activity Executor taskQueue=“PAGE_TASK_QUEUE”, namespace=“default”: 8”,“class”:“io.temporal.internal.sync.POJOActivityTaskHandler”,“exception”:"java.lang.Error: Called from non workflow or workflow callback thread\n\tat io.temporal.internal.sync.DeterministicRunnerImpl.currentThreadInternal(DeterministicRunnerImpl.java:135)\n\tat io.temporal.internal.sync.WorkflowInternal.getWorkflowInterceptor(WorkflowInternal.java:293)\n\tat io.temporal.internal.sync.WorkflowInternal.newChildWorkflowStub(WorkflowInternal.java:220)\n\tat io.temporal.workflow.Workflow.newChildWorkflowStub(Workflow.java:459)