You can use a Map State for this. You define it like so in CDK:
Posts for: #Step-Functions
Catching and Responding To Failures in AWS Step Functions
To handle errors within a Step Function, you can use a Catch block that hands off execution to an Error State. This State can be a Task type, which can (among other things)…
How to Pass Arguments to Training Code in Sagemaker via a Step Function
To pass arguments to training code in Sagemaker by itself or via a Step Function, set up an argument parser in the Python script with keyword arguments.