Architect Data Action 500 Error: JSON Parsing Failure on Cognigy Profile Token Response

We’ve hit a wall with a Data Action in Genesys Cloud Architect that’s supposed to fetch user profile data from NICE Cognigy. The setup is straightforward: we hit our internal endpoint which returns a JWT, then pass that token to the Cognigy /api/v2/profiles/{profileId} endpoint to get the actual profile attributes.

The issue is sporadic. About 10% of the time, the Data Action fails with a generic 500 Internal Server Error. The logs show the HTTP call to Cognigy succeeded with a 200 OK, but the parsing step in Architect chokes.

Here’s the JSON response Architect is trying to parse:

{
 "statusCode": 200,
 "body": {
 "profileId": "abc-123",
 "attributes": {
 "loyaltyTier": "Gold",
 "lastLogin": "2023-10-27T14:30:00Z"
 }
 },
 "headers": {
 "content-type": "application/json"
 }
}

The error log just says Failed to parse response body as JSON. We’ve verified the content-type header is correct. I’ve tried wrapping the response in a string and using JSON.parse() in a subsequent JavaScript step, but Architect seems to fail before that step even runs.

Has anyone seen this specific parsing failure when chaining external API calls in Data Actions? Is there a known issue with how Architect handles nested JSON objects from non-Genesys sources?