Skip to content

Commit bd14d85

Browse files
committed
Specify payloads too large failure cause
1 parent 217b209 commit bd14d85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

temporalio/worker/_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import temporalio.converter
2424
import temporalio.exceptions
2525
import temporalio.workflow
26+
from temporalio.api.enums.v1 import WorkflowTaskFailedCause
2627
from temporalio.bridge.worker import PollShutdownError
2728

2829
from . import _command_aware_visitor
@@ -385,8 +386,9 @@ async def _handle_activation(
385386
)
386387
completion.failed.Clear()
387388
await data_converter.encode_failure(err, completion.failed.failure)
388-
# TODO: Add WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE to API
389-
# completion.failed.force_cause = WorkflowTaskFailedCause.WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE
389+
completion.failed.force_cause = (
390+
WorkflowTaskFailedCause.WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE
391+
)
390392
except Exception as err:
391393
logger.exception(
392394
"Failed encoding completion on workflow with run ID %s", act.run_id

0 commit comments

Comments
 (0)