Activity interfaces across languages

I’m new to Temporal. We have a workflow implemented in Java that calls an activity handled by a Go worker. The Go worker expects 5 arguments: string, string, string, bool, bool.

But the activity described in Java has just 3 arguments: string, string, string. I’m assuming the person implementing the workflow just didn’t have a need for those last 2 arguments. And Go makes them false by default?

We want to add a new argument.

My question is, would things be simpler if we had the convention of activities just having 1 single argument which was a struct/dataclass? Because that would change things from positional arguments to more like a map?

I found this in the docs:

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. [ . . . ] We recommend passing a single parameter that contains all the input fields to allow for adding fields in a backward-compatible manner.

That was talking about Workflows. But does the same hold for Activities?

Thanks for any insight.

Yes, this applies to all arguments and results. Activities, signals, queries, updates.

1 Like