[{"data":1,"prerenderedAt":57},["ShallowReactive",2],{"workflow-pagination-loop":3},{"id":4,"title":5,"cleanup":6,"contributors":11,"deploy":13,"description":16,"diagram":17,"extension":18,"framework":19,"gitHub":20,"introBox":29,"level":36,"meta":37,"resources":38,"s3URL":44,"services":45,"simplicity":48,"stem":49,"testing":50,"type":54,"usecase":55,"videoId":28,"__hash__":56},"workflows\u002Fworkflows\u002Fpagination-loop.json","Pagination loop",{"headline":7,"text":8},"Cleanup",[9,10],"1. Delete the stack: \u003Ccode>sam delete --stack-name STACK_NAME\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>",[12],"content\u002Fcontributors\u002Fbenjamin-smith.json",{"text":14},[15],"sam deploy --guided","Use Amazon States language (ASL) to implement a for-loop without writing code","\u002Fassets\u002Fimages\u002Fworkflows\u002Fpagination-loop.png","json","AWS SAM",{"template":21,"payloads":26},{"repoURL":22,"templateDir":23,"templateFile":24,"ASL":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002F\u002Fstep-functions-workflows-collection\u002Ftree\u002Fmain\u002Fpagination-loop\u002F","pagination-loop\u002F","template.yaml","statemachine\u002Fstatemachine.asl.json",[27],{"headline":28,"payloadURL":28},"",{"headline":30,"text":31},"How it works",[32,33,34,35],"This pattern shows how to use Amazon States language (ASL) to implement a for-loop without writing code.  The workflow uses the `ListExecutions` SDK call, to retrive all previous Workflow executions.","The maximum number of executions that can be returned for each call is 100.  If the workflow execution history shows more than 100, then a pagination token is returned, This can then be used to access the next 100 executions, and so on.","When no Pagination token is returned, the loop is complete.","Extend this pattern for any type of loop by using a `Choice` state with a default rule to check for more items, and an exit path if no more items are found.","100",{},{"headline":39,"bullets":40},"Additional resources",[41],{"text":42,"link":43},"ListExecutions SDK docs","https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fapireference\u002FAPI_ListExecutions.html#StepFunctions-ListExecutions-request-stateMachineArn","https:\u002F\u002Fda-public-assets.s3.amazonaws.com\u002Fworkflows\u002Fpagination-loop\u002Fcloudformation.yml",[46,47],"dynamodb","lambda","2 - Pattern","workflows\u002Fpagination-loop",{"headline":51,"text":52},"Testing",[53],"See the GitHub repo for detailed testing instructions.","Standard","Production Line","695UYi6gociSaNTi5epkLAfF_B8dJ_PW1RMh9UASRh8",1778846889295]