WorkflowReplayer - java.lang.IllegalArgumentException: First event is corrupted

Mine is a long running workflow(continue-as-new). I am just trying use WorkflowReplayer

 @RegisterExtension
    val extension = TestWorkflowExtension.newBuilder()
        .setWorkflowTypes(MyWorkflowImpl::class.java)
        .setNamespace("Cloud")
        .setWorkflowClientOptions(
            WorkflowClientOptions.newBuilder()
                .setDataConverter(
                    DefaultDataConverter(
                        JacksonJsonPayloadConverter(
                            Jackson2ObjectMapperBuilder.json()
                                .modulesToInstall(KotlinModule())
                                .build()
                        ),
                    ),
                )
                .build(),
        )
        .useInternalService()
        .setDoNotStart(false)
        .build()

WorkflowReplayer.replayWorkflowExecutionFromResource("MyWorkflowHistory_V2_addedKafkaEvent.json", testEnv, MyWorkflowImpl::class.java)

I get this exception. Thoughts?


First event is corrupted
java.lang.IllegalArgumentException: First event is corrupted
	at io.temporal.internal.common.WorkflowExecutionHistory.checkHistory(WorkflowExecutionHistory.java:80)
	at io.temporal.internal.common.WorkflowExecutionHistory.fromJson(WorkflowExecutionHistory.java:65)
	at io.temporal.testing.WorkflowHistoryLoader.readHistory(WorkflowHistoryLoader.java:60)
	at io.temporal.testing.WorkflowHistoryLoader.readHistoryFromResource(WorkflowHistoryLoader.java:54)
	at io.temporal.testing.WorkflowReplayer.replayWorkflowExecutionFromResource(WorkflowReplayer.java:77)

@tihomir is there an utility class that we can use to convert/fix the json file from UI? we can not tctl on our prod cluster