title: How to pass different output from Choice state in AWS Step Function?
body: <p>Let say part of my Step Function looks like next:</p>
  
  <pre><code>"ChoiceStateX": {
    "Type": "Choice",
    "Choices": [
      {
        "Variable": "$.value",
        "NumericEquals": 0,
        "Next": "ValueIsZero"
      }
    ],
    "Default": "DefaultState"
  },
  "ValueIsZero": {
    "Type" : "Task",
    "Resource": "arn:aws:lambda:******:function:Zero",
    "Next": "NextState"
  },
  "DefaultState": {
    "Type" : "Task",
    "Resource": "arn:aws:lambda:******:function:NotZero",
    "Next": "NextState"
  }
  </code></pre>
  
  <p>Let assume that input to this state is:</p>
  
  <pre><code>{
     "value": 0,
     "output1": object1,
     "output2": object2,
  }
  </code></pre>
  
  <p>My issue is that I have to pass <code>output1</code> to <code>ValueIsZero</code> state and <code>output2</code> to <code>DefaultState</code>. I know that it is possible to change <code>InputPath</code> in <code>ValueIsZero</code> and <code>DefaultState</code> states. But this way isn't acceptable for me because I am calling these states from some other states also.</p>
  
  <p>I tried to modify <code>ChoiceStateX</code> state like next:</p>
  
  <pre><code>"ChoiceStateX": {
    "Type": "Choice",
    "Choices": [
      {
        "Variable": "$.value",
        "NumericEquals": 0,
        "OutputPath": "$.output1",
        "Next": "ValueIsZero"
      }
    ],
    "Default": "DefaultState"
  }
  </code></pre>
  
  <p>I got next error in this case: <em>Field OutputPath is not supported</em>.</p>
  
  <p>How is it possible to implement this functionality?</p>
  
  <p><strong>PS:</strong> In the current moment I am using 'proxy' states between ChoiceStateX and ValueIsZero/DefaultState where modifying the output.</p>
  
  <p>I have checked:</p>
  
  <ul>
  <li><a href="https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-input-output-processing.html" rel="nofollow noreferrer">Input and Output Processing</a> </li>
  <li><a href="https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html" rel="nofollow noreferrer">Choice</a></li>
  </ul>
  
  <p>but haven't found a solution yet.</p>