Payload visualisation in UI with pure protobuf (not json/protobuf) encoding

I use Temporal in OCaml with a custom SDK. My protobuf library does not have any way to encode protobuf in the special JSON encoding of protobuf defined in the spec. I however want to use protobuf to share my types between Go and OCaml, because most of my activities are in OCaml and most workflow definitions are in Go.

Is there any way to have the UI display a meaningful string serialisation (possibly JSON) of my protobuf payloads? I looked at codec server docs but it seems only for pure compression/encryption without context, i.e. the server does not know what is the type (in the protobuf sense) of the data it is operating on.

Edit: Seems like there is a way to manage something with the codec server exploiting payload metadata like messageType metadata fields? Not sure if the Go SDK adds them by default.

Best,
Vincent

There is no way to view a user-friendly form of protobuf given a binary-serialized protobuf unless you have all of the proto definitions used to make it up. Protobuf is not like schemaless protocols (e.g. json and msgpack) that do have human readable forms. The UI does not have the schema you’re using.

Compression and encryption are the common use case, but you can technically use it for a human-readable form of your payloads. The messageType field in the payload is the fully qualified proto name. Go does add it by default.

Great, thanks. Seems the most promising route for me!

Happy to help. And if you ever have any public code/links to share with Temporal + OCaml use, we would love to see it!

I will release the SDK when I’ll be a bit less in a rush :slight_smile: