title: Step Function Created using CDK Fails
body: <p>I have created a state machine using CDK as per the following Python code:</p>
  <pre class="lang-py prettyprint-override"><code>orderbook_upload_state_machine = sfn.StateMachine(
      self, &quot;orderbook_upload_state_machine&quot;,
      definition=tasks.LambdaInvoke(
          self, &quot;orderbook_file_splitter_task&quot;,
          lambda_function=orderbook_file_splitter
      ).next(
          sfn.Map(self, &quot;orderbook_chunk_processor_map&quot;).iterator(
              tasks.LambdaInvoke(
                  self, &quot;orderbook_chunk_processor_task&quot;,
                  lambda_function=orderbook_chunk_processor
              )
          )
      )
  )
  </code></pre>
  <p>In the AWS console, I note that the above code has generated the following ASL JSON:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;StartAt&quot;: &quot;orderbook_file_splitter_task&quot;,
    &quot;States&quot;: {
      &quot;orderbook_file_splitter_task&quot;: {
        &quot;Next&quot;: &quot;orderbook_chunk_processor_map&quot;,
        &quot;Retry&quot;: [
          {
            &quot;ErrorEquals&quot;: [
              &quot;Lambda.ServiceException&quot;,
              &quot;Lambda.AWSLambdaException&quot;,
              &quot;Lambda.SdkClientException&quot;
            ],
            &quot;IntervalSeconds&quot;: 2,
            &quot;MaxAttempts&quot;: 6,
            &quot;BackoffRate&quot;: 2
          }
        ],
        &quot;Type&quot;: &quot;Task&quot;,
        &quot;Resource&quot;: &quot;arn:aws:states:::lambda:invoke&quot;,
        &quot;Parameters&quot;: {
          &quot;FunctionName&quot;: &quot;arn:aws:lambda:eu-west-1:xxxxxxxxxxxx:function:orderbook_file_splitter&quot;,
          &quot;Payload.$&quot;: &quot;$&quot;
        }
      },
      &quot;orderbook_chunk_processor_map&quot;: {
        &quot;Type&quot;: &quot;Map&quot;,
        &quot;End&quot;: true,
        &quot;Iterator&quot;: {
          &quot;StartAt&quot;: &quot;orderbook_chunk_processor_task&quot;,
          &quot;States&quot;: {
            &quot;orderbook_chunk_processor_task&quot;: {
              &quot;End&quot;: true,
              &quot;Retry&quot;: [
                {
                  &quot;ErrorEquals&quot;: [
                    &quot;Lambda.ServiceException&quot;,
                    &quot;Lambda.AWSLambdaException&quot;,
                    &quot;Lambda.SdkClientException&quot;
                  ],
                  &quot;IntervalSeconds&quot;: 2,
                  &quot;MaxAttempts&quot;: 6,
                  &quot;BackoffRate&quot;: 2
                }
              ],
              &quot;Type&quot;: &quot;Task&quot;,
              &quot;Resource&quot;: &quot;arn:aws:states:::lambda:invoke&quot;,
              &quot;Parameters&quot;: {
                &quot;FunctionName&quot;: &quot;arn:aws:lambda:eu-west-1:xxxxxxxxxxxx:function:orderbook_chunk_processor&quot;,
                &quot;Payload.$&quot;: &quot;$&quot;
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  <p>However, invoking the step function fails with the following error:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;error&quot;: &quot;States.Runtime&quot;,
    &quot;cause&quot;: &quot;Reference path \&quot;$\&quot; must point to array.&quot;
  }
  </code></pre>
  <p>What gives?</p>
  <p>I note that if I tweak the generated ASL in the console as follows, then it's successful.  However I wouldn't know how to translate those changes back into the CDK code.</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;StartAt&quot;: &quot;orderbook_file_splitter_task&quot;,
    &quot;States&quot;: {
      &quot;orderbook_file_splitter_task&quot;: {
        &quot;Next&quot;: &quot;orderbook_chunk_processor_map&quot;,
        &quot;Retry&quot;: [
          {
            &quot;ErrorEquals&quot;: [
              &quot;Lambda.ServiceException&quot;,
              &quot;Lambda.AWSLambdaException&quot;,
              &quot;Lambda.SdkClientException&quot;
            ],
            &quot;IntervalSeconds&quot;: 2,
            &quot;MaxAttempts&quot;: 6,
            &quot;BackoffRate&quot;: 2
          }
        ],
        &quot;Type&quot;: &quot;Task&quot;,
        &quot;Resource&quot;: &quot;arn:aws:lambda:eu-west-1:xxxxxxxxxxxx:function:orderbook_file_splitter&quot;
        // ⭐⭐ I remove the 'Parameters' block and put the function name here 
      },
      &quot;orderbook_chunk_processor_map&quot;: {
        &quot;Type&quot;: &quot;Map&quot;,
        &quot;End&quot;: true,
        &quot;Iterator&quot;: {
          &quot;StartAt&quot;: &quot;orderbook_chunk_processor_task&quot;,
          &quot;States&quot;: {
            &quot;orderbook_chunk_processor_task&quot;: {
              &quot;End&quot;: true,
              &quot;Retry&quot;: [
                {
                  &quot;ErrorEquals&quot;: [
                    &quot;Lambda.ServiceException&quot;,
                    &quot;Lambda.AWSLambdaException&quot;,
                    &quot;Lambda.SdkClientException&quot;
                  ],
                  &quot;IntervalSeconds&quot;: 2,
                  &quot;MaxAttempts&quot;: 6,
                  &quot;BackoffRate&quot;: 2
                }
              ],
              &quot;Type&quot;: &quot;Task&quot;,
              &quot;Resource&quot;: &quot;arn:aws:states:::lambda:invoke&quot;,
              &quot;Parameters&quot;: {
                &quot;FunctionName&quot;: &quot;arn:aws:lambda:eu-west-1:xxxxxxxxxxxx:function:orderbook_chunk_processor&quot;,
                &quot;Payload.$&quot;: &quot;$&quot;
              }
            }
          }
        }
      }
    }
  }
  </code></pre>