Is it possible to trigger the /v2/agentscripts/scriptinstances endpoint via the Genesys Cloud REST API while maintaining a high concurrency load without hitting payload validation errors?
We are running a stress test in the us-east-1 region using JMeter 5.6.2 to simulate 50 concurrent agent script executions. The goal is to validate the throughput of the Agent Scripting service under load. The test plan uses the POST /v2/agentscripts/scriptinstances endpoint to start instances of a specific script ID.
The request payload includes the scriptId, agentId, and a variables object. The variables are generated dynamically per thread to ensure uniqueness.
{
"scriptId": "abc-123-def-456",
"agentId": "dynamic-agent-id",
"variables": {
"orderId": "ORD-" + ${__counter(TRUE,)},
"timestamp": ${__time()}
}
}
At low concurrency (10 threads), the requests succeed with a 201 Created status. However, when scaling to 50 concurrent threads, approximately 30% of the requests fail with a 400 Bad Request. The error response body is minimal:
{
"message": "Invalid variable value format",
"code": "bad.request"
}
The documentation states:
“Variables passed in the request body must adhere to the script definition schema. Numeric fields must be integers or floats, and string fields must not exceed 255 characters.”
The generated values are well within these limits. The orderId is a short string, and timestamp is a long integer. We have verified the script definition in Architect; it expects a String for orderId and a Number for timestamp.
Interestingly, the failures are not consistent across threads. Some threads succeed, while others fail with the same payload structure. We checked the X-Genesys-Request-Id headers, and each request is unique. There are no 429 rate limit errors, just these sporadic 400s.
Could this be a race condition in the validation layer? Or is there a hidden limit on concurrent script instance creations per account? We are using the standard Genesys Cloud API client library in Java 17. Any insights on how to debug this variable validation issue under load would be appreciated.