Hi I am trying to signal a child workflow outside of a workflow using newWorkflowStub but getting “Null workflowId. Was workflow started?”, the parent workflow has finished executing.
This is how I started the child workflow
val options =
ChildWorkflowOptions.newBuilder()
.setTaskQueue("QUEUE")
.setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
.setWorkflowId("CONSENT")
.build();
val child = Workflow.newChildWorkflowStub(UserConsentWorkflow::class.java, options);
Async.procedure { child.initUserConsentWorkflow(userId) }
val childExecution = Workflow.getWorkflowExecution(child);
childExecution.get()
This is how I am trying to signal the child workflow
val workflowOptions = WorkflowOptions.newBuilder().setTaskQueue("QUEUE")
.setWorkflowId("CONSENT").build();
val workflow = temporalClient.newWorkflowStub(UserConsentWorkflow::class.java, workflowOptions);
workflow.submitUserConsent(consent)
Signal Method
override fun submitUserConsent(consent: Consent) {
this.consent = consent
this.isConsentSubmitted = true
}