Skip to content

[Feature Request] support json/protobuf payloads for workflow gate #414

Description

@robcao

Is your feature request related to a problem? Please describe.

Users using protobuf messages for workflow inputs want to be able to use protobuf messages as inputs to the workflow gate. json/protobuf is supported by things like the temporal cli and ui, and should also be supported by the worker controller.

Describe the solution you'd like

Add an additional optional field called ProtoMessageType to GateWorkflowConfig (and the WorkerDeployment CRD). When this field is populated alongside an input payload, the client should send the payload as a json/protobuf payload, instead of a json/plain payload, like this

var arg interface{}
if len(wf.input) > 0 {
    if wf.protoMessageType != "" {
        arg = converter.NewRawValue(&commonpb.Payload{
            Metadata: map[string][]byte{
                converter.MetadataEncoding:    []byte(converter.MetadataEncodingProtoJSON),
                converter.MetadataMessageType: []byte(wf.protoMessageType),
            },
            Data: wf.input,
        })
    } else {
        arg = json.RawMessage(wf.input)
    }
}

Additional context

We are happy to help contribute this if we can agree on the shape of the change

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions