Migrating a workflow & activity argument to a propagated context field


I have a cron based workflow that received 2 arguments at execution time. One of these arguments should actually have been a context key/value pair. I just finished implementing a custom context propagator. The propagation works. I am now at the point where I could remove that field from the arguments list in my workflow and activities.

I am wondering what happens if I would deploy this code. There are still workflows which are based on the 2 arguments and do not have the context field. Should I use Versioning to handle this change, and if so, how can I make sure that the field is added to the context when Temporal reschedules the job based on my cron setting?

1 Like

I believe it is possible using WorkflowInterceptor. Let me prototype to confirm.

It looks like the current implementation of the interceptor is not going to work for this use case. Filed an issue to come up with a comprehensive solution.