{
  "Comment": "A description of my state machine",
  "StartAt": "Parallel",
  "States": {
    "Parallel": {
      "Type": "Parallel",
      "Branches": [
        {
          "StartAt": "Map",
          "States": {
            "Map": {
              "Type": "Map",
              "ItemProcessor": {
                "ProcessorConfig": {
                  "Mode": "INLINE"
                },
                "StartAt": "Update UnicornStatus",
                "States": {
                  "Update UnicornStatus": {
                    "Type": "Task",
                    "Resource": "arn:aws:states:::dynamodb:updateItem",
                    "Arguments": {
                      "TableName": "unicorn_status",
                      "Key": {
                        "id": {
                          "S": "{% $states.input.id %}"
                        }
                      },
                      "UpdateExpression": "SET hunger = hunger + :feedRef",
                      "ExpressionAttributeValues": {
                        ":feedRef": {
                          "N": "{% $string($states.input.amount) %}"
                        }
                      }
                    },
                    "End": true
                  }
                }
              },
              "End": true,
              "Items": "{% $states.input.Unicorns %}"
            }
          }
        },
        {
          "StartAt": "Update FeedAmount",
          "States": {
            "Update FeedAmount": {
              "Type": "Task",
              "Resource": "arn:aws:states:::dynamodb:updateItem",
              "Arguments": {
                "TableName": "feed_amount",
                "Key": {
                  "id": {
                    "S": "feed_amount"
                  }
                },
                "UpdateExpression": "SET amount = amount - :amountRef",
                "ExpressionAttributeValues": {
                  ":amountRef": {
                    "N": "{% $string($states.input.TotalFeedAmount) %}"
                  }
                }
              },
              "End": true
            }
          }
        }
      ],
      "End": true
    }
  },
  "QueryLanguage": "JSONata"
}