Hey I have a query, Can changing arguments to an activity result in non Determinism?
No. Activity arguments are not checked during replay. But if thenchange is not backwards compatible then activity invocation might fail
Hi Maxim can you please explain in detail on what “Change is not backwards compatible” is?. Can you please explain with an example if possible. When can a change in activity arguments can cause a failure?
I’m trying to remove an argument in the activity signature. Because I don’t need the argument, I’m pulling the value directly from another place directly inside activity implementation. Hoping that Workflow doesn’t fail in this case.
Changing the number of parameters or input/output types can lead to other issues unrelated to temporal. Eg: If there are pending activities (scheduled activities with no terminal event like completed/failed…) and you change the signature, you can get a deserialization error (maybe ts won’t complain and it just sets the values as 0 or undefined). This should be easy to test.
The reason is that the payload value is recorded in the event ActivityTaskScheduled. When the workers run the activity, the payload is deserialized to the type/s in the activity signature.
If you are unsure I think it is better to version the code samples-typescript/patching-api at main · temporalio/samples-typescript · GitHub and you can use replay to test the changes before deploying.
Antonio