1 Answer
- Newest
- Most votes
- Most comments
0
Use a Choice state to check for existence of array[0]. Something like this:
{
"StartAt": "CheckArrayEmpty",
"States": {
"CheckArrayEmpty": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.array[0]",
"IsPresent": true,
"Next": "NotEmpty"
}
],
"Default": "Empty"
},
"NotEmpty": {
"Type": "Pass",
"End": true
},
"Empty": {
"Type": "Pass",
"End": true
}
}
}
Relevant content
- asked 2 years ago
- asked 6 years ago
- asked a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 4 months ago
Thank you for replying Uri. I came up with a work-around outside of this step function but I would still like to know about catching the error. Is this a bug in the service?