Skip to content

fix(ext-workflow): honor DAPR_GRPC_MAX_INBOUND_MESSAGE_SIZE_BYTES on workflow channels#1085

Open
tezizzm wants to merge 1 commit into
dapr:mainfrom
tezizzm:fix/workflow-grpc-max-message-size
Open

fix(ext-workflow): honor DAPR_GRPC_MAX_INBOUND_MESSAGE_SIZE_BYTES on workflow channels#1085
tezizzm wants to merge 1 commit into
dapr:mainfrom
tezizzm:fix/workflow-grpc-max-message-size

Conversation

@tezizzm

@tezizzm tezizzm commented Jun 10, 2026

Copy link
Copy Markdown

Description

Long-running workflows whose activity results exceed gRPC's 4 MiB default fail with
RESOURCE_EXHAUSTED: Sent message larger than max (X vs. 4194304). #1024 added
DAPR_GRPC_MAX_INBOUND_MESSAGE_SIZE_BYTES and threaded it through the Dapr API
channel only — it did not cover the workflow (durabletask) channel, so even with
the env var exported, workflows still hit the 4 MiB ceiling once the orchestration
history (input + accumulated activity results) crossed the limit.

This PR mirrors the #1024 pattern in dapr-ext-workflow:

  • Adds a get_grpc_channel_options() helper in dapr/ext/workflow/util.py. Resolution
    order: explicit max_grpc_message_length kwarg → settings.DAPR_GRPC_MAX_INBOUND_MESSAGE_SIZE_BYTES
    None (gRPC default).
  • Threads a new optional max_grpc_message_length: Optional[int] = None kwarg through
    the three workflow gRPC constructors and passes the resolved channel_options:
    • WorkflowRuntime.__init__TaskHubGrpcWorker
    • DaprWorkflowClient.__init__ (sync) → TaskHubGrpcClient
    • aio.DaprWorkflowClient.__init__ (async) → AsyncTaskHubGrpcClient
  • Updates the public docstrings of all three constructors to document the kwarg and its
    precedence.

Unlike #1024, the limit is applied symmetrically to both send and receive, because
workflow activity payloads cross the channel in both directions (worker → daprd carries
activity output too); #1024 only set the receive limit in its env-var branch.

No new environment variable is introduced (reuses #1024's), and no vendored
_durabletask/ internals or dapr/proto/ files are touched.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1084

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

…workflow channels

Workflow activity payloads over gRPC's 4 MiB default raised
RESOURCE_EXHAUSTED because the durabletask channel ignored the message
size limit. dapr#1024 plumbed DAPR_GRPC_MAX_INBOUND_MESSAGE_SIZE_BYTES
through the Dapr API channel only; the workflow worker and clients still
fell back to the gRPC default.

Add a get_grpc_channel_options helper that resolves the limit from an
explicit max_grpc_message_length kwarg, then the env var, then None, and
thread it through WorkflowRuntime, DaprWorkflowClient, and the async
DaprWorkflowClient. Unlike dapr#1024, set both send and receive limits
symmetrically since workflow payloads cross the channel in both
directions. Reuses the existing setting; no new env var.

Signed-off-by: Martez Killens <5050479+tezizzm@users.noreply.github.com>
@tezizzm tezizzm requested review from a team as code owners June 10, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WORKFLOW SDK BUG] Activity payloads >4 MiB raise RESOURCE_EXHAUSTED on the workflow gRPC channel

1 participant