File tree 1 file changed +20
-1
lines changed
packages/aws-cdk-lib/aws-stepfunctions 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -467,8 +467,27 @@ execute the same steps for multiple entries of an array in the state input.
467
467
const map = new sfn .Map (this , ' Map State' , {
468
468
maxConcurrency: 1 ,
469
469
itemsPath: sfn .JsonPath .stringAt (' $.inputForMap' ),
470
+ parameters: {
471
+ item: sfn .JsonPath .stringAt (' $$.Map.Item.Value' ),
472
+ },
473
+ resultPath: ' $.mapOutput' ,
470
474
});
471
- map .iterator (new sfn .Pass (this , ' Pass State' ));
475
+
476
+ // The Map iterator can contain a IChainable, which can be an individual or multiple steps chained together.
477
+ // Below example is with a Choice and Pass step
478
+ const choice = new sfn .Choice (this , ' Choice' );
479
+ const condition1 = sfn .Condition .stringEquals (' $.item.status' , ' SUCCESS' );
480
+ const step1 = new sfn .Pass (this , ' Step1' );
481
+ const step2 = new sfn .Pass (this , ' Step2' );
482
+ const finish = new sfn .Pass (this , ' Finish' );
483
+
484
+ const definition = choice
485
+ .when (condition1 , step1 )
486
+ .otherwise (step2 )
487
+ .afterwards ()
488
+ .next (finish );
489
+
490
+ map .iterator (definition );
472
491
```
473
492
474
493
### Custom State
You can’t perform that action at this time.
0 commit comments