I’ve defined a workflow with a single input parameter. If I add a new parameter to the input struct without updating the workflow registration (so only the client is updated, not the workflow), so that the call to ExecuteWorkflow(ctx, opt, wf, STRUCT_WITH_NEW_FIELDS) I get the following error:
wrapError: unable to decode the workflow function input payload with error: payload item 0: unable to decode: unknown field "product" in models.OrderLineItem, function name: ReturnProcessWorkflow
It’s like there is no FORWARD compatibility because of the converter in Temporal being too strict. Is there any solution apart from switching the parameter type to string and manage myself the conversion??
Is models.OrderLineItem a protobuf? I am assuming so (if not, ignore the detail below).
By default we use proto JSON which by default disallows unknown fields. We use both the older jsonpb (a faster alternative to the common jsonpb) and the newer protojson both of which default to disallowing unknown fields.
Alternatively, you could just remove the proto JSON payload converter from the set of payload converters when constructing that data converter and then it’d use binary proto which by default supports unknown fields, but you lose the easy-to-read aspect of the UI and it won’t be compatible with already-running workflows, so it’s not recommended.