Problem
The custom event pipeline drops Agent Scripting execution events when the script payload balloons past 4KB. The NRQL dashboard doesn’t show latency metrics for complex flows. The webhook callback to the NR collector returns a 200, yet the event never lands in the CustomEvent table. It’s completely silent on the failure. The NRQL query SELECT durationMs FROM AgentScriptExecution WHERE scriptId='a1b2c3d4' SINCE 1 hour ago returns zero rows for scripts with dynamic variable expansion.
Environment
- Genesys Cloud Org: US1
- NR APM Agent: Java 8.8.0 on OpenJDK 17
- Agent Scripting API: v2/federation/agent-scripting
- Webhook URL: https://collect.newrelic.com/v1/accounts/{id}/events
- Script Steps: 14 conditional branches with nested variable assignments.
- NRQL Dashboard: Aggregates
durationMsbyscriptId.
Code
{
"eventType": "AgentScriptExecution",
"scriptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"durationMs": 1250,
"steps": [
{ "id": "step_01", "type": "assign", "payload": { "value": "long_string_data..." } },
{ "id": "step_02", "type": "condition", "payload": { "expression": "complex_logic_here..." } }
]
}
Error
NR collector logs flag PayloadTooLarge and MalformedPayload. The GC webhook retry mechanism exhausts after three attempts. The script execution finishes fine in the UI, but the instrumentation layer chokes on the payload size. The steps array gets sliced mid-object, breaking the JSON structure. The truncation hits right at the variable expansion block. Other webhooks like CALL_EVENT ingest payloads over 10KB without issue. This points to a specific limit on Agent Scripting events. The NR custom event attributes include stepCount and outcome. The outcome populates correctly, but the broken steps array causes the drop. The NR account has plenty of ingest capacity left. The webhook client doesn’t respect the retry-after header, hammering the collector faster.
The NRQL dashboard shows a gap in data correlating with script complexity. The stepCount attribute is accurate, but the event drop prevents the latency calculation. The NR alert policy triggers on high duration, but the dropped events cause false positives in the logic. The NR APM transaction trace shows the webhook call timing out on the GC side, even though the client reports success. The discrepancy suggests the GC webhook handler buffers the payload and drops it silently when the buffer overflows. The buffer size might be hardcoded to 4KB for this event type. The NR collector logs show the request arriving with a truncated body, confirming the drop happens before transmission. The instrumentation strategy requires full payload delivery to correlate step performance with overall execution time. The partial data is misleading for optimization efforts. The NRQL query can’t filter by step type if the steps are missing. The dashboard widgets show empty states. The alert policy is noisy. The webhook configuration is standard. The issue is isolated to the payload size. The NR side is working as expected. The GC webhook is the bottleneck.
Steps
- Reduced script steps to 5. Events ingested successfully.
- Increased NR webhook batch size to 10KB. Still fails on step 6.
- Checked GC API response headers.
Content-Lengthmatches the truncated payload. - Verified NR schema validation. Strict mode is enabled.
Question
Is there a hidden payload cap on the webhook event body for Agent Scripting? The docs mention a 1MB limit for script definitions, but the webhook event seems capped much lower. The truncation happens exactly when the variable expansion block inflates the JSON. The GC side appears to be slicing the byte stream without closing the JSON structure. This breaks the NR ingestion pipeline for any script with dynamic variables. The instrumentation layer is doing jack all for complex flows right now. The truncation happens exactly at the variable expansion block.