{
  "StartAt": "MainTask",
  "States": {
    "MainTask": {
      "Type": "Task",
      "Next": "Success",
      "TimeoutSeconds": 3600,
      "Resource": "arn:aws:states:::batch:submitJob.sync",
      "Parameters": {
        "JobDefinition.$": "$.config.JobDefinition",
        "JobName.$": "$.name",
        "JobQueue.$": "$.config.JobQueue",
        "ContainerOverrides": {
          "Command.$": "$.command",
          "Environment": []
        }
      },
      "ResultPath": "$.result",
      "Retry": [
        {
          "ErrorEquals": ["States.TaskFailed", "States.Timeout"],
          "IntervalSeconds": 3,
          "MaxAttempts": 2,
          "BackoffRate": 2
        }
      ],
      "Catch": [
        {
          "ErrorEquals": ["States.ALL"],
          "ResultPath": "$.error",
          "Next": "Failed"
        }
      ]
    },
    "Failed": {
      "Type": "Fail"
    },
    "Success": {
      "Type": "Succeed"
    }
  }
}
