When we restructure the workflow definition, what're the safe guidelines to change the activity/ function definition

Hey Community,

I have a question about the deterministic errors when we restructure the activities I used in the workflow definition.

My workflow uses an activity in the first version,
fun SomeActivityX (a, b, c)
but now I wanna change it to the second version,
fun SomeActivityX(a, b, c, d=1)

  1. I am not sure how much the replay compares, does it compare entirely the original parameters to the new signature?
  2. And am I safe in directly changing the old SomeActivityX to the new one without adding version tags to it?

Background information we are building workflows in kotlin on top of java-sdk.

Such change doesn’t require versioning.

We recommend that production use cases use a single value type input argument. This has multiple benefits.

  • It is converted to a JSON with named properties. Positional arguments are converted to a JSON array. So their names are lost.
  • It is easier to make adding and removing properties from the value type backward compatible.

Thanks, Maxim, I wanna double confirm my understanding: so the change of parameter numbers doesn’t cause deterministic errors as long as the function still accepts only fun SomeActivityX(a, b, c, d=1)as default. so if I change the function to fun SomeActivityX(a, b, c, d) it will cause problem.

I’m confused. You asked about Java SDK. Java doesn’t support default parameter values.

we are using Kotlin on top of the Java-SDK. Maven Central Repository Search
so we can have something like.

I feel very uncertain when I reconstruct the workflow definition (workflow execution runtime data, signals, and activities are all to be modified). And I guess my uncertainty comes from I am not 100% sure about the details of the replay which I will dig into later.

And it is good to find the reply test mechanism. Also, I am thinking myself along the way if any light way can be found for a fast and more confident way of reconstruction of workflow definitions.