Anyone free to help troubleshoot this 400 Bad Request when injecting dynamic Zendesk article URLs into a GC Architect flow. The Zendesk API returns a clean markdown link, but the Set Variable node fails validation when trying to pass it to the Digital Messaging send node.
Genesys Cloud Architect v2
Zendesk API v2 integration
Error: invalid_type: expected string, found object on variable article_url
Need some help troubleshooting a 400 Bad Request when injecting dynamic Zendesk article URLs into a GC Architect flow. The Zendesk API returns a clean markdown link, but the Set Variable node fails validation when trying to pass it to the Digital Messaging send node.
I usually solve this by forcing a strict string conversion before the variable hits the messaging node. The error invalid_type: expected string, found object is a classic symptom of the Zendesk API returning a nested JSON object (like {"html_url": "..."}) instead of a raw string, even if the docs claim otherwise. The Set Variable node is likely passing that entire object structure downstream.
The fix is to use a Data Action or a simple JavaScript snippet in the Set Variable node to extract the actual URL string. If you are using the built-in expression engine, try wrapping the incoming variable in a toString() function or using the split method to isolate the URL if it’s embedded in an array.
For example, if your Zendesk response is {{zendesk_result.data.html_url}}, ensure you are referencing the specific property, not the whole data object.
// If using a custom JS node or Data Action
let cleanUrl = String(incomingZdResponse.data.html_url).trim();
// Validate it's actually a string before passing to Digital Messaging
if (typeof cleanUrl === 'string' && cleanUrl.startsWith('http')) {
return cleanUrl;
}
As a WFM scheduler, I deal with strict data types all the time when pushing schedule adherence metrics. If the payload isn’t a pure string, the system rejects it. Check the raw JSON response from your Zendesk Data Action. You might be seeing an object wrapper. Strip it down to the bare URL string. This usually clears up the 400 error immediately. Also, verify that the Digital Messaging node isn’t expecting a formatted markdown object instead of a plain text link. Sometimes switching the message type to “Rich Text” helps if you really need the formatting, but for a simple link, plain text is safer.
You need to validate the Zendesk response structure before assignment. The API often returns a nested object containing the html_url or url, not a raw string.
Extract the specific field in the Set Variable node:
article_url = $.body.url
Passing the whole object causes the type mismatch.
It depends, but generally… the validation fails because the webhook payload retains object metadata. Ensure the Set Variable node explicitly targets the string property, similar to ServiceNow REST API handling. See Data Action Payload Mapping for schema details.