title: Combining `InputPath` and `Parameters` in AWS States Language
body: <p>The <a href="https://states-language.net/spec.html" rel="noreferrer">AWS States Language specification</a> describes the role of the <code>InputPath</code> and <code>Parameters</code> fields but does not give an example of the filters being used together.</p>
  
  <p>My understanding is that, if specified, the JSON path given by the <code>InputPath</code> field is applied to the raw input producing the effective input. <em>Then</em>, if specified, the value of the parameters field is applied, modifying the effective input.</p>
  
  <p>Extending <a href="https://states-language.net/spec.html#filters" rel="noreferrer">the example given in the spec</a>, given the following <code>Task</code> state definition:</p>
  
  <pre><code>"X": {
    "Type": "Task",
    "Resource": "arn:aws:swf:us-east-1:123456789012:task:X",
    "Next": "Y",
    "InputPath": "$.sub",
    "Parameters": {
      "flagged": true,
      "parts": {
        "first.$": "$.vals[0]",
        "last3.$": "$.vals[3:]"
      }
    }
  }
  </code></pre>
  
  <p>then, given the following input:</p>
  
  <pre><code>{
    "flagged": 7,
    "sub" : { 
        "vals": [0, 10, 20, 30, 40, 50]
    }
  }
  </code></pre>
  
  <p>the effective input to the code identified in the <code>Resource</code> field would be:</p>
  
  <pre><code>{
    "flagged": true,
    "parts": {
      "first": 0,
      "last3": [30, 40, 50]
    }
  }
  </code></pre>
  
  <p>Is my interpretation correct?</p>