{
  "Comment": "Handles parsing a DDEX document and ingesting information from it into the Orchard",
  "StartAt": "CheckForSentinelFile",
  "States": {
    "CheckForSentinelFile": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.detail.requestParameters.key",
          "StringMatches": "*/${filename_pattern}",
          "Next": "ParseDDEX"
        }
      ],
      "Default": "FailState"
    },
    "ParseDDEX": {
      "Type": "Task",
      "Resource": "${lambda_parse_ddex_arn}:qa",
      "Parameters": {
        "bucket.$": "$.detail.requestParameters.bucketName",
        "key.$": "$.detail.requestParameters.key",
        "ddex_provider.$": "$.detail.requestParameters.ddex_provider",
        "execution_name.$": "$$.Execution.Name",
        "state_machine_name.$": "$$.StateMachine.Name",
        "execution_start_time.$": "$$.Execution.StartTime",
        "ingest_id.$": "$.detail.requestParameters.ingest_id",
        "artwork_ingestion_only.$": "$.detail.requestParameters.artwork_ingestion_only"
      },
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "GraphQLError"
          ],
          "IntervalSeconds": 20,
          "MaxAttempts": 2,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "CreateIngestionLockFile"
    },
    "CreateIngestionLockFile": {
      "Type": "Task",
      "Resource": "${lambda_create_ingestion_lock_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "LockfileExistsException"
          ],
          "IntervalSeconds": 60,
          "MaxAttempts": 60,
          "BackoffRate": 2,
          "MaxDelaySeconds": 240
        },
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "CheckPurgedRelease"
    },
    "CheckPurgedRelease": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.is_purged_release",
          "BooleanEquals": true,
          "Next": "ProcessPurgedRelease"
        }
      ],
      "Default": "PrepDDEX"
    },
    "ProcessPurgedRelease": {
      "Type": "Task",
      "Resource": "${lambda_process_purged_release_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "RemoveIngestionLockFileSuccess"
    },
    "PrepDDEX": {
      "Type": "Task",
      "Resource": "${lambda_prep_sme_ddex_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "ValidateDDEX"
    },
    "ValidateDDEX": {
      "Type": "Task",
      "Resource": "${lambda_validate_ddex_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "ReplaceWithPlaceholderUpc"
    },
    "ReplaceWithPlaceholderUpc": {
      "Type": "Task",
      "Resource": "${lambda_replace_with_placeholder_upc_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "FindOrCreateAccount"
    },
    "FindOrCreateAccount": {
      "Type": "Task",
      "Resource": "${lambda_find_or_create_account_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "RetryableException"
          ],
          "IntervalSeconds": 10,
          "MaxAttempts": 7,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 60,
          "MaxAttempts": 20,
          "BackoffRate": 1
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "ProductExistUnderDifferentVendorException",
            "VendorDoNotIngestException"
          ],
          "Next": "RemoveIngestionLockFileSkip",
          "ResultPath": "$.errors"
        },
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "ProcessParticipants"
    },
    "CreateTracks": {
      "Type": "Task",
      "Resource": "${lambda_create_tracks_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException",
            "GraphQLError"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "ProcessProductData"
    },
    "SetProject": {
      "Type": "Task",
      "Resource": "${lambda_set_project_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "DuplicateProjectCodeException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 3,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "GraphQLError"
          ],
          "IntervalSeconds": 20,
          "MaxAttempts": 2,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "SetProjectException"
          ],
          "Next": "EmailSuccess",
          "ResultPath": "$.errors"
        },
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "CheckVideoRelease"
    },
    "CheckVideoRelease": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.product.release_type",
          "StringMatches": "VideoSingle",
          "Next": "RemoveIngestionLockFileSkip"
        }
      ],
      "Default": "SetProduct"
    },
    "SetProduct": {
      "Type": "Task",
      "Resource": "${lambda_set_product_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException",
            "GraphQLError"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "SetProductException"
          ],
          "Next": "EmailSuccess",
          "ResultPath": "$.errors"
        },
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "GetOrchardProductMetadata"
    },
    "GetOrchardProductMetadata": {
      "Type": "Task",
      "Resource": "${lambda_retrieve_orchard_metadata_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "CreateTracks"
    },
    "ProcessParticipants": {
      "Type": "Task",
      "Resource": "${lambda_process_participants_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "GraphQLError"
          ],
          "IntervalSeconds": 30,
          "MaxAttempts": 5,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 35,
          "MaxAttempts": 7,
          "BackoffRate": 4
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "SetProject"
    },
    "ProcessProductData": {
      "Type": "Parallel",
      "Branches": [
        {
          "StartAt": "ProcessTrackMetadata",
          "States": {
            "ProcessTrackMetadata": {
              "Type": "Map",
              "MaxConcurrency": 1,
              "ItemsPath": "$.tracks",
              "Parameters": {
                "track.$": "$$.Map.Item.Value",
                "context": {
                  "product.$": "$.product",
                  "error_correction.$": "$.error_correction",
                  "is_purged_release.$": "$.is_purged_release",
                  "bucket.$": "$.bucket",
                  "key.$": "$.key",
                  "errors.$": "$.errors",
                  "message_id.$": "$.message_id",
                  "message_thread_id.$": "$.message_thread_id",
                  "update_indicator.$": "$.update_indicator",
                  "maintenance_owner.$": "$.maintenance_owner",
                  "orchard_label.$": "$.orchard_label",
                  "execution_name.$": "$.execution_name",
                  "state_machine_name.$": "$.state_machine_name",
                  "execution_start_time.$": "$.execution_start_time",
                  "project_id.$": "$.project_id",
                  "warnings.$": "$.warnings",
                  "ddex_provider.$": "$.ddex_provider",
                  "correlation_id.$": "$.correlation_id",
                  "deal_coordinators.$": "$.deal_coordinators",
                  "has_switchboard_deal.$": "$.has_switchboard_deal"
                }
              },
              "Iterator": {
                "StartAt": "SetTrackMetadata",
                "States": {
                  "SetTrackMetadata": {
                    "Type": "Task",
                    "Resource": "${lambda_set_track_metadata_arn}:qa",
                    "HeartbeatSeconds": 60,
                    "TimeoutSeconds": 3600,
                    "Catch": [
                      {
                        "ErrorEquals": [
                          "States.ALL"
                        ],
                        "Next": "CatchSetTrackMetadataError"
                      }
                    ],
                    "Retry": [
                      {
                        "ErrorEquals": [
                          "States.Timeout",
                          "Lambda.ServiceException",
                          "Lambda.AWSLambdaException",
                          "Lambda.SdkClientException",
                          "SetTrackMetadataException"
                        ],
                        "IntervalSeconds": 5,
                        "MaxAttempts": 5,
                        "BackoffRate": 3
                      },
                      {
                        "ErrorEquals": [
                          "OwsProductUserIsForbiddenException"
                        ],
                        "IntervalSeconds": 300,
                        "MaxAttempts": 20,
                        "BackoffRate": 2,
                        "MaxDelaySeconds": 1800
                      },
                      {
                        "ErrorEquals": [
                          "Lambda.TooManyRequestsException"
                        ],
                        "IntervalSeconds": 10,
                        "MaxAttempts": 5,
                        "BackoffRate": 5
                      }
                    ],
                    "OutputPath": "$.errors",
                    "End": true
                  },
                  "CatchSetTrackMetadataError": {
                    "Type": "Succeed"
                  }
                }
              },
              "End": true
            }
          }
        },
        {
          "StartAt": "ArtworkFound",
          "States": {
            "ArtworkFound": {
              "Type": "Choice",
              "Choices": [
                {
                  "Variable": "$.product.artwork",
                  "IsNull": false,
                  "Next": "HandleArtwork"
                }
              ],
              "Default": "MissingArtwork"
            },
            "HandleArtwork": {
              "Type": "Task",
              "Resource": "${lambda_handle_artwork_arn}:qa",
              "HeartbeatSeconds": 60,
              "TimeoutSeconds": 3600,
              "Retry": [
                {
                  "ErrorEquals": [
                    "States.Timeout",
                    "Lambda.ServiceException",
                    "Lambda.AWSLambdaException",
                    "Lambda.SdkClientException",
                    "Lambda.TooManyRequestsException"
                  ],
                  "IntervalSeconds": 5,
                  "MaxAttempts": 5,
                  "BackoffRate": 3
                }
              ],
              "Catch": [
                {
                  "ErrorEquals": [
                    "States.ALL"
                  ],
                  "Next": "CatchHandleArtworkErrors"
                }
              ],
              "Next": "CatchHandleArtworkErrors"
            },
            "CatchHandleArtworkErrors": {
              "Type": "Succeed"
            },
            "MissingArtwork": {
              "Type": "Succeed"
            }
          }
        },
        {
          "StartAt": "SetMainReleaseDate",
          "States": {
            "SetMainReleaseDate": {
              "Type": "Task",
              "Resource": "${lambda_set_main_release_date_arn}:qa",
              "HeartbeatSeconds": 60,
              "TimeoutSeconds": 3600,
              "Retry": [
                {
                  "ErrorEquals": [
                    "States.Timeout",
                    "Lambda.ServiceException",
                    "Lambda.AWSLambdaException",
                    "Lambda.SdkClientException",
                    "Lambda.TooManyRequestsException",
                    "GraphQLError"
                  ],
                  "IntervalSeconds": 5,
                  "MaxAttempts": 5,
                  "BackoffRate": 3
                }
              ],
              "Catch": [
                {
                  "ErrorEquals": [
                    "States.ALL"
                  ],
                  "Next": "CatchReleaseDateErrors"
                }
              ],
              "Next": "StoreLinksAndPreOrder"
            },
            "CatchReleaseDateErrors": {
              "Type": "Succeed"
            },
            "StoreLinksAndPreOrder": {
              "Type": "Parallel",
              "Branches": [
                {
                  "StartAt": "SetPreOrderInfo",
                  "States": {
                    "SetPreOrderInfo": {
                      "Type": "Task",
                      "Resource": "${lambda_set_preorder_info_arn}:qa",
                      "HeartbeatSeconds": 60,
                      "TimeoutSeconds": 3600,
                      "Retry": [
                        {
                          "ErrorEquals": [
                            "States.Timeout",
                            "Lambda.ServiceException",
                            "Lambda.AWSLambdaException",
                            "Lambda.SdkClientException",
                            "Lambda.TooManyRequestsException"
                          ],
                          "IntervalSeconds": 5,
                          "MaxAttempts": 5,
                          "BackoffRate": 3.0
                        }
                      ],
                      "Catch": [
                        {
                          "ErrorEquals": [
                            "States.ALL"
                          ],
                          "Next": "CatchPreorderInfoErrors"
                        }
                      ],
                      "OutputPath": "$.errors",
                      "End": true
                    },
                    "CatchPreorderInfoErrors": {
                      "Type": "Succeed"
                    }
                  }
                }
              ],
              "End": true
            }
          }
        }
      ],
      "Next": "DetectErrors"
    },
    "DetectErrors": {
      "Type": "Task",
      "Resource": "${lambda_detect_errors_arn}:qa",
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "ApproveProduct"
    },
    "ApproveProduct": {
      "Type": "Task",
      "Resource": "${lambda_approve_product_arn}:qa",
      "HeartbeatSeconds": 60,
      "TimeoutSeconds": 3600,
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException",
            "ApproveProductGraphQLException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "CheckErrors"
    },
    "CheckErrors": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.errors",
          "IsNull": false,
          "Next": "EmailErrors"
        }
      ],
      "Default": "EmailSuccess"
    },
    "EmailSuccess": {
      "Type": "Task",
      "Resource": "${lambda_report_errors_arn}:qa",
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "GraphQLError"
          ],
          "IntervalSeconds": 25,
          "MaxAttempts": 2,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "EmailErrors",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "RemoveIngestionLockFileSuccess"
    },
    "EmailErrors": {
      "Type": "Task",
      "Resource": "${lambda_report_errors_arn}:qa",
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        },
        {
          "ErrorEquals": [
            "GraphQLError"
          ],
          "IntervalSeconds": 25,
          "MaxAttempts": 2,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "RemoveIngestionLockFileFailure",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "RemoveIngestionLockFileFailure"
    },
    "RemoveIngestionLockFileSuccess": {
      "Type": "Task",
      "Resource": "${lambda_remove_ingestion_lock_arn}:qa",
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "WriteCatalogIngestionFailure",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "SkipForErrorCheck"
    },
    "SkipForErrorCheck": {
      "Type": "Choice",
      "Choices": [
        {
          "Variable": "$.errors",
          "IsPresent": false,
          "Next": "WriteCatalogIngestionSuccess"
        },
        {
          "Variable": "$.errors",
          "IsNull": true,
          "Next": "WriteCatalogIngestionSuccess"
        }
      ],
      "Default": "WriteCatalogIngestionSuccess"
    },
    "RemoveIngestionLockFileFailure": {
      "Type": "Task",
      "Resource": "${lambda_remove_ingestion_lock_arn}:qa",
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "WriteCatalogIngestionFailure",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "WriteCatalogIngestionFailure"
    },
    "WriteCatalogIngestionSuccess": {
      "Type": "Task",
      "Resource": "${lambda_write_catalog_ingestion_arn}:qa",
      "Parameters": {
        "context.$": "$",
        "status": "Success"
      },
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "FailState",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "SuccessState"
    },
    "WriteCatalogIngestionFailure": {
      "Type": "Task",
      "Resource": "${lambda_write_catalog_ingestion_arn}:qa",
      "Parameters": {
        "context.$": "$",
        "status": "Failure"
      },
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "FailState",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "FailState"
    },
    "RemoveIngestionLockFileSkip": {
      "Type": "Task",
      "Resource": "${lambda_remove_ingestion_lock_arn}:qa",
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "WriteCatalogIngestionSkip",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "WriteCatalogIngestionSkip"
    },
    "WriteCatalogIngestionSkip": {
      "Type": "Task",
      "Resource": "${lambda_write_catalog_ingestion_arn}:qa",
      "Parameters": {
        "context.$": "$",
        "status": "Skip"
      },
      "Retry": [
        {
          "ErrorEquals": [
            "States.Timeout",
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException",
            "Lambda.TooManyRequestsException"
          ],
          "IntervalSeconds": 5,
          "MaxAttempts": 5,
          "BackoffRate": 3
        }
      ],
      "Catch": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "FailState",
          "ResultPath": "$.errors"
        }
      ],
      "Next": "SuccessState"
    },
    "SuccessState": {
      "Type": "Succeed"
    },
    "FailState": {
      "Type": "Fail"
    }
  }
}
