#10263·moto

SWF: missing workflow execution members raise unhandled exceptions

Author: AndreKuraitCreated Sep 17, 2026Updated Sep 17, 2026

DescribeWorkflowExecution and GetWorkflowExecutionHistory index required request fields before handling missing values. Omitting execution.runId raises an unhandled KeyError, which can surface as an internal server error. Clients that bypass boto3's local parameter validation can reach this path.

Reproduced against d22033db2b0762e15cfbc4947ea53809dfd880e7:

python
import boto3
from botocore.config import Config
from moto import mock_aws

with mock_aws():
    client = boto3.client(
        "swf",
        region_name="us-east-1",
        config=Config(parameter_validation=False),
    )
    client.describe_workflow_execution(
        domain="test-domain",
        execution={"workflowId": "workflow-id"},
    )

Moto raises KeyError: 'runId'. Replacing the method with get_workflow_execution_history produces the same failure. Omitting workflowId, supplying an empty execution object, or omitting required top-level fields exposes similar gaps.

Verified both operations against live AWS SWF in us-east-1 on September 17, 2026, using signed JSON requests. A missing or null execution.runId returns HTTP 400 with:

json
{
  "__type": "com.amazon.coral.validate#ValidationException",
  "message": "1 validation error detected: Value null at 'execution.runId' failed to satisfy constraint: Member must not be null"
}

AWS also returns field-specific ValidationException messages for missing/null domain, execution, and execution.workflowId, and combines the messages when multiple required fields are absent. Incorrect JSON types return SerializationException; missing members should be distinguished from those type errors.

A fix and HTTP regression coverage are proposed in #10262.