Architect Script Node Failing on Dynamic Variable Injection

Dealing with a very strange bug here with…

Architect flow fails at the Script node when injecting dynamic variables via the GC CLI. The script renders correctly in the UI but throws a 500 Internal Server Error during runtime when called from the API.

Environment: Genesys Cloud EU1
Tooling: gc-apis-cli v4.5.2
Flow: Standard IVR with dynamic script selection

Snippet:

{
 "scriptId": "${script_id_var}"
}

Error log shows Invalid script reference. Is this a known limitation with variable resolution in script nodes?

Cause: The 500 error likely stems from the Script node receiving an untyped or null value when the dynamic variable ${script_id_var} is resolved at runtime. Architect often fails silently on type mismatches between the injected JSON payload and the expected string format for scriptId. The Queue Performance dashboard will show elevated handle times and dropped interactions at this specific node, indicating a processing error rather than a routing failure.

Solution: Validate the variable type before injection. Use a Set Variable node immediately prior to the Script node to explicitly cast the incoming value to a String.

  1. Add a Set Variable node.
  2. Set Target to script_id_clean.
  3. Set Value to ${script_id_var}.
  4. Ensure the Data Type is set to String.
  5. Update the Script node configuration to use scriptId: "${script_id_clean}".

This ensures the payload is sanitized. Monitor the Conversation Detail view to confirm the variable is populated correctly before the script executes. If the variable remains empty, the flow should divert to a default script or error handling path to prevent the 500 crash.