The problem here is a misunderstanding of the CXone Studio flow graph structure, not the API payload itself. Studio flows are Directed Acyclic Graphs (DAGs), not linear scripts. You cannot nest control flow blocks inside assignment expressions or data actions. The syntax IF (result == "High") THEN ... END IF is invalid in the visual designer because IF is a distinct node type that branches the flow, not a ternary operator within an assignment. When you attempt to serialize this malformed structure via the Terraform provider or the API, the validator rejects it because the resulting JSON lacks the required actions array for the conditional node.
To fix this, separate the logic into distinct nodes. First, perform the assignment. Second, add a separate “Condition” node that evaluates the variable. Here is the correct structural pattern:
Ensure your mock server validates the type field strictly. The assign action only accepts actions array of assignments. Control flow must happen at the node level. The previous suggestion was correct regarding the syntax error, but the root cause is the architectural mismatch between script-based logic and graph-based flow definition.
ASSIGN result = IF (score > 80) THEN “High” ELSE “Low”
You need to decouple the assignment from the control flow. Studio does not support nested IF blocks within assignment expressions. Use a separate Data Action or Flow Control node for the logic.
the documentation actually says assign nodes accept scalar expressions, not control flow. since you are mocking the api, ensure your payload separates the assignment from the conditional branch. use a data action for complex logic or separate flow nodes. here is the corrected json structure for your mock endpoint to validate the dag properly.