We are using a Temporal self-hosted server. The key versions:
- Temporal server 1.22.3
- Postgres Database version 14.11
- The application is using the Java SDK.
We are using a ContextPropagator implementation to send tracing information from our client to the worker. This works without any problems.
Our workflow can create a child workflow in certain cases. The child workflow creation uses setContextPropagator as follow.
ChildWorkflowOptions options = ChildWorkflowOptions.newBuilder()
.setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
.setContextPropagators(Collections.singletonList(new MdcContextPropagator()))
.setTaskQueue("taskqueue")
.build();
Again this works fine and we see the context inside the child workflow.
The child workflow includes a signal method to wake up the workflow, check the result from a downstream API. Depending on the result it will either go back to sleep or complete.
This is the interface for the child workflow
@WorkflowInterface
public interface ChildProcessingWorkflow {
@WorkflowMethod
void startProcessing();
@SignalMethod
void resumeProcessing();
}
At the moment we call it asynchronously using:
ChildProcessingWorkflow workflow = workflowClient.newWorkflowStub(ChildProcessingWorkflow.class, options);
CompletableFuture.supplyAsync(() -> WorkflowClient.execute(workflow::startProcessing)
.thenRunAsync(workflow::resumeProcessing);
I can see the context serialisation occur in the client but it’s not updated in the child workflow. My question is whether it’s possible to do context propagation for a workflow that is already running?