Reputation: 2667
For StepFunctions, can we have both Retry
and Catch
working together on the exhausted case?
Here is my use case
"ExecuteMyJob": {
"Type": "Task",
"Resource": "arn:aws:states:::glue:startJobRun.sync",
"Parameters": {
"JobName.$": "$.jobName",
"Arguments.$": "$.jobArguments"
},
"Retry" : [{
"ErrorEquals": [ "States.TaskFailed", "States.Runtime" ],
"MaxAttempts": 3,
"IntervalSeconds": 60,
"BackoffRate": 2
}],
"Catch": [{
"ErrorEquals": [ "States.ALL" ],
"Next": "MarkJobFailOnDbTable"
}],
"Next": "NextJobOnPreviousSuccess"
}
Upvotes: 5
Views: 5607
Reputation: 1391
Step Functions lets you have both Retry
and Catch
together:
https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
The Complex retry scenarios example in that link is similar to your example:
"X": {
"Type": "Task",
"Resource": "arn:aws:states:us-east-1:123456789012:task:X",
"Next": "Y",
"Retry": [ {
"ErrorEquals": [ "ErrorA", "ErrorB" ],
"IntervalSeconds": 1,
"BackoffRate": 2.0,
"MaxAttempts": 2
}, {
"ErrorEquals": [ "ErrorC" ],
"IntervalSeconds": 5
} ],
"Catch": [ {
"ErrorEquals": [ "States.ALL" ],
"Next": "Z"
} ]
}
Upvotes: 5