Skip to content

Expose raw Failure and Payload protos on SDK error and result types #2203

@yuandrew

Description

@yuandrew

Is your feature request related to a problem? Please describe.
When consuming update (and standalone activity) results through the SDK's high-level types, callers like the CLI
cannot access the full underlying proto data:

  • Errors: PollWorkflowUpdate returns a bare error. The underlying temporalError preserves the original
    *failurepb.Failure proto (including stack trace, structured error chain, encoded details), but failure() is
    unexported. There's no public way to extract the full structured failure for display.
  • Results: PollWorkflowUpdate returns EncodedValue, which only exposes Get(valuePtr) — it decodes the payload into
    a Go type, discarding the raw *commonpb.Payload. Callers that need the raw payload (e.g., to render with or
    without JSON shorthand) have no way to access it.

This affects CLI issue temporalio/cli#952.

Describe the solution you'd like
Add public accessors to the existing SDK types:

  1. A public Failure() *failurepb.Failure method on temporalError (or a public interface that error types
    implement), so callers can access the full proto failure including stack trace, error chain, and encoded details.
  2. A way to get the raw *commonpb.Payload from EncodedValue without going through data conversion — e.g., a
    Payload() *commonpb.Payload accessor or similar.

This keeps the high-level types as the primary API while making them fully inspectable for advanced callers.

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