diff --git a/packages/aws-cdk-lib/aws-stepfunctions/README.md b/packages/aws-cdk-lib/aws-stepfunctions/README.md index 59453e23c32d4..51a1488815b09 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/README.md +++ b/packages/aws-cdk-lib/aws-stepfunctions/README.md @@ -354,10 +354,13 @@ choice.afterwards().next(shipTheItem); You can add comments to `Choice` states as well as conditions that use `choice.when`. ```ts -const choice = new sfn.Choice(stack, 'What color is it?', { +const choice = new sfn.Choice(this, 'What color is it?', { comment: 'color comment', }); +const handleBlueItem = new sfn.Pass(this, 'HandleBlueItem'); +const handleOtherItemColor = new sfn.Pass(this, 'HanldeOtherItemColor'); choice.when(sfn.Condition.stringEquals('$.color', 'BLUE'), handleBlueItem, 'blue item comment'); +choice.otherwise(handleOtherItemColor); ``` If your `Choice` doesn't have an `otherwise()` and none of the conditions match