Terraform apply 400 on flow conditional node

I’ve spent hours trying to figure out why the genesyscloud_flow resource fails with 400 bad request during apply. error is “invalid conditional expression” on a simple string comparison node. using provider v1.68.0. the flow works fine manually in ui but tf state keeps rejecting it. any ideas?

Have you tried escaping the comparison operator? In Zendesk, triggers are often just key-value pairs, but Genesys Cloud flows require strict JSON syntax for conditionals. A missing backslash before the equals sign usually triggers that 400 error in Terraform.

Note: Always validate your flow JSON against the API schema before applying to avoid state drift during migrations.

Oh, this is a known issue…

Component Version
Provider v1.68.0+
Flow Type Conditional Node

The syntax error usually stems from incorrect JSON escaping in the condition block. Validate the expression string against the API schema before applying.

This is a standard case where the Terraform provider’s JSON serialization doesn’t align with the strict syntax expected by the Genesys Cloud API for conditional nodes. The suggestion above about escaping is on point, but it’s often about the specific structure of the condition object itself rather than just the operator. When I’ve run load tests against the Platform API with malformed JSON payloads, the 400 error is usually immediate. Try explicitly defining the condition in a separate local variable to inspect the raw JSON before it hits the apply. Using jsonencode() in Terraform can help ensure proper formatting. Also, check if the variable being compared is actually a string type in the flow context; type mismatches often cause silent failures in the UI but hard errors in API calls. Here’s a snippet that worked for me: condition = jsonencode({ "type": "string", "value": "${var.input}", "operator": "equals", "target": "test" }). This avoids manual escaping issues entirely.