Lambda function won't run in parallel via Statemachine step functions

I am sure I am missing some basic info but my setup is as follows:

I have 1 lambda function and I have 2 State Machines. Each state machine is calling the same lambda function twice in sequence (30 sec pause between calls) Then I have rules setup to trigger the state machines every minute. Below is what each of my state machines look like, each lambda invoke is for the same function.

enter image description here

Each state machine is passing different params to the lambda function so I am trying to get to a situation where my Lambda function is called every 30 seconds with 1 set of params (from statemachine 1), and the same lambda function is called with a different set of params (via statemachine 2) every 30 seconds.

Looking at the lambda function logs it looks like the state machines will not run the lambda function until the other state machine has completed its entire execution (ie calling the lambda function twice). I would expect that the two state machines would run independently of each other and there would be no timing dependency between them?

Is there some limitation because they are all calling the same lambda function? Or is there some setup issue or is this just how it works?

Thanks!


From the documetation:

When you invoke a Lambda function, the execution will wait for the function to complete. However, it is possible to call Lambda asynchronously using the InvocationType parameter, as seen in the following example

To avoid waiting for oneLambda function to end and continue your step function you have to set the InvocationType to Event in the parameters. However, if your Lambda functions are completely independent from one another using the Parallel execution type may be a better option for you.

step function with parallel execution

{
  "Comment": "Parallel Example.",
  "StartAt": "LookupCustomerInfo",
  "States": {
    "LookupCustomerInfo": {
      "Type": "Parallel",
      "End": true,
      "Branches": [
        {
         "StartAt": "LookupAddress",
         "States": {
           "LookupAddress": {
             "Type": "Task",
             "Resource":
               "arn:aws:lambda:us-east-1:123456789012:function:AddressFinder",
             "End": true
           }
         }
       },
       {
         "StartAt": "LookupPhone",
         "States": {
           "LookupPhone": {
             "Type": "Task",
             "Resource":
               "arn:aws:lambda:us-east-1:123456789012:function:PhoneFinder",
             "End": true
           }
         }
       }
      ]
    }
  }
}