Skip to content

Allow payload visitors to visit memo payloads in aggregate #782

@jmaeagle99

Description

@jmaeagle99

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

The payload visitors in the SDK visit each payload of a memo separately such that the visit callback only sees one payload at a time. This doesn't allow transformations or validation to occur at the scope of a memo simultaneously. For example, we would want to check if the entire size of a memo is larger than some threshold and make a decision around that, such as failing a workflow task if the memo is too large for the server.

Describe the solution you'd like

The payload visitors should have an option or callback that allows visiting the payloads of a memo simultaneously. Each language may choose a variation of the solution so long as it meets the requirements of:

  • Optionally allowing all payloads of a memo to be visited together
  • Allowing the callback to determine if the visit call is for a memo vs some other payload visiting context.

For example, the following is a possible solution for the Go payload visitor and its options. Add a custom callback field named VisitMemo whose type is func(*VisitPayloadsContext, map[string]*common.Payload) (map[string]*common.Payload, error). It is invoked when VisitMemo is not nil, otherwise fallback to visiting each payload individually.

Per-SDK Tickets

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions