Add counter which increases on every request

Hi,
I want to add one condition in below scenario. Like I would like to exit from the scenario if counter=8 or WorkflowStatus=true
does anyone knows how to add increment counter variable and above condition in below scenario?

`
class LaunchResources extends Simulation {

val scenarioRepeatCount = Integer.getInteger(“scenarioRepeatCount”, 1).toInt
val userCount = Integer.getInteger(“userCount”, 1).toInt
val UUID = System.getProperty(“UUID”, “24d0e03”)
val username = System.getProperty(“username”, “p1”)
val password = System.getProperty(“password”, “P12”)
val testServerUrl = System.getProperty(“testServerUrl”, “https://someurl.net”)

val httpProtocol = http
.baseURL(testServerUrl)
.basicAuth(username, password)
.connection(""“keep-alive”"")
.contentTypeHeader(""“application/vnd+json”"")

val headers_0 = Map(
“”“Cache-Control”"" → “”“no-cache”"",
“”“Origin”"" → “”“chrome-extension://fdmmgasdw1dojojpjoooidkmcomcm”"")

val scn = scenario(“LaunchAction”)
.repeat (scenarioRepeatCount) {
exec(http(“LaunchAResources”)
.post( “”"/api/actions""")
.headers(headers_0)
.body(StringBody(s"""{“UUID”: “$UUID”, “stringVariables” : {“externalFilePath” : “/Test.mp4”}}"""))
.check(jsonPath("$.id").saveAs(“WorkflowID”)))

.exec(http(“SaveWorkflowStatus”)
.get("""/api/actions/{$WorkflowID}""")
.headers(headers_0)
.check(jsonPath("$.status").saveAs(“WorkflowStatus”)))

}

setUp(scn.inject(atOnceUsers(userCount))).protocols(httpProtocol)
}

`

Thanks.