422 on Cognigy.AI prediction endpoint when context matrix exceeds max size

HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
// 422 Unprocessable Entity

The ServiceNow integration script hits the Cognigy.AI prediction endpoint to grab intent scores before we route incidents. Running into a 422 error the second the context string crosses the inference engine’s max size limit. The Java builder packs the bot ID, input text matrix, and context variable directives into the JSON body. We’ve tried trimming the matrix and running local schema validation, but the atomic POST still fails the format verification check. Swapped the auto intent ranking trigger to manual mode. That clears the 422, but it completely breaks the confidence thresholding pipeline. Entity extraction verification returns null payloads when the ranker stays off. The prediction retriever needs to feed clean scores into the webhook callback for the MLOps latency tracking. Audit log generation is also stalling because the validation logic expects a ranked response structure. We’ve got the threshold logic set to drop anything under 0.75, but the server won’t even return a ranked array. Anyone else hit this max context wall with the Java HTTP client? The local schema checker isn’t catching the overflow until the remote endpoint throws the 422.

Problem
The CONTEXT_MATRIX_SIZE usually breaks when you skip the TRUNCATION_POLICY on the outbound request.

Code

{
 "endpoint": "/api/v2/platform/webhooks",
 "request": { "url": "https://cognigy.ai/predict", "MAX_TOKENS": 256 }
}

Error
You’ll hit that 422 hard if the payload exceeds the limit, so isn’t your INPUT_LENGTH_LIMIT configured too high?

Dropped the truncation policy in the request body and it’s clearing the 422 immediately.

{ "contextMatrix": { "maxTokens": 256, "truncateStrategy": "keep_latest" } }

You still seeing the engine drop the intent scores at exactly 256 tokens? Parser usually just throws a 400 there.