1

I'm facing some issues with StepFunctions... Is there a way to Catch errors like States.ExceedToleratedFailureThreshold in DistributedMaps? I have something like this but somehow the Catch isn't applied and the execution just fails when at least one Lambda is failing:

{
  "Next": "ReleaseSlot",
  "Type": "Map",
  "ItemReader": {
    "ReaderConfig": {
      "InputType": "CSV",
      "CSVHeaderLocation": "FIRST_ROW"
    },
    "Resource": "arn:aws:states:::s3:getObject",
    "Parameters": {
      "Bucket": "<BUCKET>",
      "Key.$": "$.filename"
    }
  },
  "ItemBatcher": {
    "MaxItemsPerBatch": 1000,
    "BatchInput": {
      "data.$": "$"
    }
  },
  "ItemProcessor": {
    "StartAt": "BatchImporter",
    "States": {
      "BatchImporter": {
        "Type": "Task",
        "Resource": "arn:aws:states:::lambda:invoke",
        "Parameters": {
          "FunctionName": "<FUNCTION_ARN>",
          "Payload": {
            "body": "$"
          }
        },
        "ResultPath": null,
        "OutputPath": null,
        "End": true
      }
    },
    "ProcessorConfig": {
      "Mode": "DISTRIBUTED",
      "ExecutionType": "STANDARD"
    }
  },
  "MaxConcurrency": 16,
  "ToleratedFailurePercentage": 0,
  "Catch": [
    {
      "ErrorEquals": [
        "States.All"
      ],
      "Next": "ReleaseSlot"
    }
  ]
}

I wanted to catch this error, as if it occurred then distributed map failed to run "ReleaseSlot" state, which leads to inconsistent state.

1 Answer 1

2

The casing in your Error name is incorrect. You need to use States.ALL (capitalized ALL).

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, that was a silly mistake from myside, I updated the casing and it worked like a charm.
Nice!. I wish we didn't make that so prone to error. Something we are thinking about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.