Can’t get this config to load properly… The Genesys Cloud Data Action configured to trigger a ServiceNow incident creation via REST API is consistently failing with a 400 Bad Request response when the JSON payload exceeds 2KB or contains nested objects for custom fields. The Architect flow utilizes a Set Variable block to construct the JSON string using concatenation, which appears to be introducing escape character issues before the HTTP Request block executes. The ServiceNow REST API endpoint expects a strictly formatted JSON body, but the payload received seems to have malformed quotes around special characters in the caller’s transcript. Logs in Genesys Cloud show the request is sent, but the response body from ServiceNow indicates ‘Invalid JSON: Unexpected token’. I have verified the payload structure using the ServiceNow API Explorer and it works perfectly when tested directly. The issue seems to stem from how Genesys Cloud serializes the variable before sending it to the webhook. Has anyone successfully handled large, complex JSON payloads with special characters from Genesys Cloud to ServiceNow without hitting serialization errors? What is the recommended method for ensuring proper JSON formatting within the Architect flow before the HTTP Request?
How I usually solve this is by avoiding string concatenation in Architect. Use the genesyscloud_flow resource to define a JSON template instead.
{“error”: “Invalid JSON: unexpected token at position 1204”}
This prevents escape character hell. Define the payload structure in HCL and map variables dynamically. Much cleaner than manual string building.
have you tried using the json.stringify block in architect instead of manual concatenation? it handles the escaping automatically and saves so much headache during our weekly schedule publishes.
Oh, this is a known issue with string concatenation in Architect. The manual building method breaks easily when payloads exceed standard limits or contain special characters.
Use JSON stringify blocks instead. This handles escaping automatically and keeps the payload structure valid for ServiceNow.