Getting NaN when trying to calculate the difference in minutes between two timestamps in a Genesys Cloud Architect Data Action.
We’re running a Node.js backend that pushes interaction metadata to GC via the /api/v2/interactions endpoint. The timestamps are ISO 8601 strings in UTC, but our business logic requires checking if the interaction happened within the last 15 minutes of JST business hours.
I’ve got a Data Action set up with these parameters:
{
"name": "CheckRecentInteraction",
"type": "data",
"expression": "DateTimeDiff([CurrentTime], [InteractionTimestamp], 'minutes')"
}
The issue is that DateTimeDiff seems to ignore the timezone context entirely or parses the string incorrectly when it hits the T separator. If I pass 2023-10-27T10:00:00.000Z, the result is garbage.
I tried using GetDayOfWeek([InteractionTimestamp]) as a sanity check to see if the parser is even recognizing the date string, but that also returns null or an error.
Here’s the kicker: if I hardcode the timestamp in the Data Action expression like DateTimeDiff([CurrentTime], '2023-10-27 10:00:00', 'minutes'), it works fine. But as soon as I swap it for the dynamic variable [InteractionTimestamp] coming from the webhook payload, it breaks.
Is there a specific format requirement for date strings passed into Architect expressions via REST? The docs say it accepts ISO 8601, but maybe the Node SDK is stripping the timezone info or adding extra milliseconds that the expression engine chokes on?
I’ve verified the payload hitting the GC API is clean:
{
"timestamp": "2023-10-27T10:00:00.000Z"
}
Also tried formatting it in JS before sending:
const isoDate = new Date().toISOString().replace('T', ' ').slice(0, 19);
That didn’t help either.
Anyone else hit this wall with dynamic date comparisons in Data Actions? The expression engine feels pretty brittle when it comes to string-to-date parsing from external sources. We’re in Asia/Tokyo, so maybe there’s some weird local timezone offset being applied server-side that I’m not accounting for?
Just need to get the minute diff calculation working reliably. Can’t have the routing logic failing because of a timestamp parse error.