Is context propagation supported with replay?


Is context propagation supported with replay?

I was wondering what the best way to handle replay when you are testing child workflows and the child workflow depends on context propagation from the parent. In this case, we have the child history but it doesn’t seem like the values store in the context are being passed down.


  • where is the context propagation stored? is it in the parent or child history?
  • How would I inject this into the replayer
	var replayOptions worker.ReplayWorkflowHistoryOptions		
       replayOptions.OriginalExecution = workflow.Execution{
		ID: tc.parentWfId,
	err = replayer.ReplayWorkflowHistoryWithOptions(replay_versions.NewDefaultLogger(), history,


The context is stored as the header field in the child WorkflowExecutionStartedEvent.

@maxim Thanks, so I realize that if you don’t set the context propagator in your replayer, it will inject your data into a nested structure in the context so it won’t be able to find it. Once i fixed the replayer, it worked.

	replayer, err := worker.NewWorkflowReplayerWithOptions(worker.WorkflowReplayerOptions{
		ContextPropagators: []workflow.ContextPropagator{
			// add propagators

Here is an example for anyone else that runs into this problem.

func getParentWorkflowStartTimeFromContext(ctx workflow.Context) *time.Time {
     v := ctx.Value(startTime{})

without the context propagator configured in the replayer, the data in the headers in the execution history don’t translate properly as seen in the debugger above.

I think this is how these protobufs are represented as JSON.

Sorry i meant to just give an example of what to look for and what happens when you don’t configure the propagator when you create the replayer to run the execution history.