Modify data in temporal context

I have a question.

We use context propagators (java-sdk) to propagate headers incoming from APIs that are used to start the workflows, and this is working fine.

Let’s say then that our workflows receive some signals, that are sent to the running workflow also using APIs.

In this context, we see that the key-value pairs propagated through context propagators do not update the workflow context, to explain better, we propagated i.e. a property named “user”, let’s say that the user that start the workflow is not the same as the one that sends the signal, nevertheless when we test this scenario we see the user remains the same even after the signal is sent (is always the one that was set during workflow creation).

Is it somehow possible to achieve this result (user gets updated when workflow is signaled)?

Doesn’t look as context propagators are invoked on handling signals. You could do what you need via workflow interceptors, see for example how opentracing support works in the java sdk, it’s interceptor based, and sample here.

With interceptors you could intercept both signal and query handlers, see for example here.