Changing WorkflowMethod param type

Hi @Abhishek_Sharma1

I think if you add a new parameter it will be converted to null during replay, so your code has to be backward compatible. Note from our doc that “we strongly recommend that objects are used as parameters, so that the object’s individual fields may be altered without breaking the signature of the Workflow.”

After all workflows have migrated to using my updated signature, Can I remove the first “foo” param entirely or would that break backwards compatibility

You can if you don’t query closed workflows (which will make workers replay those workflows)

I would test any change with workflow.replay first Develop code that durably executes - Java SDK dev guide | Learn Temporal

Do the answer to the above two change for activity methods?

Activity inputs are not deserialized for completed/failed activities, only the output.

For pending activities, the new parameter will be converted to null, so your code has to be backward compatible. I think this thread can be helpful too Non Determinism

Antonio.