Hey everyone,
I’m trying to kick off an Architect flow from our internal Node.js microservice using the genesys-cloud-nodejs-client. The basic call works fine, but the moment I add custom data to the payload, the server throws a 500 Internal Server Error.
Here’s the setup. We’ve got a flow with a Data Action that expects a userId and sessionId in the interaction context. I’m constructing the request body like this:
const flowsApi = platformClient.flows;
const payload = {
flowId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
userId: 'external-user-123', // This is a real user ID in our system
attributes: {
'userId': 'external-user-123',
'sessionId': 'sess_987654321'
}
};
try {
const response = await flowsApi.postFlowsExecutions(payload);
console.log('Flow started:', response.body);
} catch (error) {
console.error('Error:', error.status, error.message);
}
The flowId is definitely correct. If I remove the attributes object entirely, the flow starts without issue, though obviously the downstream logic fails because it can’t find the userId. I’ve verified the user ID exists in Genesys Cloud too, just to rule that out.
The error response is pretty vague:
Error: 500 Internal Server Error
I’ve tried changing the attribute keys to snake_case, removing the quotes around the keys, and even sending the attributes as a query param instead of in the body. Nothing sticks. The SDK logs show the request is being sent with Content-Type: application/json.
Is there a specific format for the attributes object that the Node SDK expects? Or maybe a limitation on what you can pass via the REST API versus the UI? We’re on version 4.2.0 of the SDK.
Any help would be great. I’m stuck on this for hours now.