Is your feature request related to a problem? Please describe.
When the CLI is using Temporal Cloud and configured with a remote codec server, exporting a large workflow history can be very slow:
temporal workflow show \
--workflow-id <workflow-id> \
--output json > history.json
The codec protocol supports sending multiple payloads in one /decode request. However, the CLI's payload visitor makes a separate request for each payload or Payloads field it encounters and processes those visits serially.
Because workflows contain so many payloads, even a small amount of latency (~50ms) causes some exports to take 5+ minutes for us.
Increasing the RPC timeout prevents the operation from timing out, but does not address the latency.
Describe the solution you'd like
Remote codec calls made while processing a workflow history should be concurrent, batched more broadly, or otherwise avoid paying one network round trip serially for every visited field.
api-go now supports opt-in concurrent payload visiting through VisitPayloadsOptions.ConcurrencyLimit, which may provide a path to doing this with bounded concurrency.
Additional context
This was previously recognized in:
That issue explicitly mentioned concurrently calling the codec instead of using the serial visitor. It was closed by #676, which added a configurable RPC timeout but did not address the underlying latency.
There is also an open cross-SDK feature tracking concurrent payload visiting:
The Temporal CLI item remains unchecked. The underlying Go support has since landed:
The CLI currently constructs NewPayloadCodecGRPCClientInterceptor here:
https://github.com/temporalio/cli/blob/main/cliext/client.go
However, that interceptor is currently used without configuring the payload visitor's concurrency option.
Is your feature request related to a problem? Please describe.
When the CLI is using Temporal Cloud and configured with a remote codec server, exporting a large workflow history can be very slow:
The codec protocol supports sending multiple payloads in one
/decoderequest. However, the CLI's payload visitor makes a separate request for each payload orPayloadsfield it encounters and processes those visits serially.Because workflows contain so many payloads, even a small amount of latency (~50ms) causes some exports to take 5+ minutes for us.
Increasing the RPC timeout prevents the operation from timing out, but does not address the latency.
Describe the solution you'd like
Remote codec calls made while processing a workflow history should be concurrent, batched more broadly, or otherwise avoid paying one network round trip serially for every visited field.
api-gonow supports opt-in concurrent payload visiting throughVisitPayloadsOptions.ConcurrencyLimit, which may provide a path to doing this with bounded concurrency.Additional context
This was previously recognized in:
That issue explicitly mentioned concurrently calling the codec instead of using the serial visitor. It was closed by #676, which added a configurable RPC timeout but did not address the underlying latency.
There is also an open cross-SDK feature tracking concurrent payload visiting:
The Temporal CLI item remains unchecked. The underlying Go support has since landed:
The CLI currently constructs
NewPayloadCodecGRPCClientInterceptorhere:https://github.com/temporalio/cli/blob/main/cliext/client.go
However, that interceptor is currently used without configuring the payload visitor's concurrency option.