title: AWS Step Function NumericGreaterThan a Parameter
body: <p>In an AWS Step Function, in a Choice step, we want to compare a result from an AWS Lambda function to a threshold given as a parameter using "NumericGreaterThan".</p>
  
  <p>In our example, we compare a calculated from a lambda with a threshold given by the event.</p>
  
  <p>I tried defining my step function in the following way:</p>
  
  <pre><code>{
    "StartAt": "Check Enough Data",
    "States": {
      "Check Enough Data": {
        "Type": "Task",
        "Resource": "arn:aws:lambda:REGION:ID:function:FUNCTION:$LATEST",
        "Next": "Validate Count",
        "ResultPath": "$.count"
      },
      "Validate Count": {
        "Type": "Choice",
        "Choices": [
          {
            "Variable": "$.count",
            "NumericGreaterThan": "$.threshold",
            "Next": "Succeed State"
          }
        ],
        "Default": "Wait 24 Hours"
      },
      "Wait 24 Hours": {
        "Type": "Wait",
        "Seconds": 86400,
        "Next": "Check Enough Data"
      },
      "Succeed State": {
        "Type": "Succeed"
      }
    }
  }
  </code></pre>
  
  <p>but got an error <em>Expected value of type: Integer, Float insted of String</em>.
  If I replace "$.threshold" with a hard-coded value (like 20), it works, but the value is not dynamic as I want.</p>
  
  <p>The following input should cause the lambda to get to the Succeed State:</p>
  
  <pre><code>{
     "country": "japan",
     "threshold": 40
  }
  </code></pre>
  
  <p>I know we can replace the Choice step with another Lambda function, but we do not want to do that from cost-effective issues.</p>
  
  <p>Does anyone have an idea on how to solve the problem?</p>