Pushed the script trigger module to client staging org using genesys-cloud-sdk-js@3.102.7. The /api/v2/flow/sessions/{sessionId}/scripts endpoint doing jack all. It’s rejecting the POST with a 409 Conflict immediately after the OAuth token refresh. The multi-org setup runs fine for other endpoints, but this script execution call keeps bouncing back. The request payload includes the scriptId and the interactionId, both verified in the console. Console shows the script is published and not locked. Yet the API response returns a conflict error pointing to a state mismatch on the session object.
Tried switching to the interaction API route just to bypass the flow session layer. Same 409 result. Rate limiting headers are clean, nothing throttling the requests. The AppFoundry manifest has the correct permissions for flow:sessions:read and scripts:read, but maybe missing something for execution triggers. Logs in the client org show the script engine trying to acquire a lock, then failing because the session context is already bound to an outbound campaign. The custom connector routes these through after IVR. The handoff works, script just won’t fire via API.
Architect flow has the script set to auto-attach on contact start. Manual testing in the agent desktop works perfectly. API calls from the backend service keep hitting this wall. Payload structure matches the docs exactly.
{
"scriptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"interactionId": "int-987654321",
"executionMode": "async"
}
Response body just says conflict on session state. No extra details in the trace. Looking at the session object directly, the scriptStatus field is null. Should be initializing to pending maybe. The SDK client isn’t throwing a validation error, just straight 409 from the gateway. Client is on the latest platform version. Checking the flow session API docs again for the execution trigger parameters. Might be missing a correlationId or something in the header. Token scope looks fine.