Terraform Plan - Data Action

Hi all,

We’ve run into a rather peculiar situation during automated deployments of Architect flows via terraform. It concerns Data Actions embedded within conditional route steps - specifically, when the Data Action’s input parameters contain characters that require URL encoding. The terraform plan consistently fails, and it’s not immediately obvious why.

The flow in question uses a Data Action to query an external system. The Data Action itself is relatively straightforward. It takes a single input parameter - a customer identifier - which could potentially include plus signs (+) or other reserved characters. The issue appears when the conditional route step attempts to pass this encoded value to the Data Action.

Now, what we’ve observed is that Terraform seems to be double-encoding the parameter. The value passed into the conditional route step initially looks correct - properly encoded for URL transmission. However, when the plan applies and the Great Cloud attempts to process the flow update, the parameter appears to be encoded again. This results in a failed deployment and, subsequently, a broken flow.

It’s not a simple case of omitting the encoding. If we skip encoding entirely in the terraform configuration, the initial deployment fails with a different error - an invalid character. So, we’re caught in a bit of a catch-22.

The Terraform provider version is 3.63.0. We are using the standard flow update endpoints for updates. The relevant section of the terraform configuration is shown below. Note that the encoded_value variable contains the already URL-encoded string.

resource "genesyscloud_architect_flow" "example" {
 name = "Test Flow"
 division_id = "your_division_id"

 script_body = <<EOF
{
 "type": "ArchitectFlow",
 "version": "1.0",
 "flowVersion": "1.0",
 "steps": [
 {
 "type": "ConditionalRoute",
 "name": "Conditional Route",
 "parameters": {
 "conditions": [
 {
 "type": "DataActionCondition",
 "data_action": "your_data_action_id",
 "input_parameters": {
 "customer_id": "${var.encoded_value}"
 }
 }
 ]
 }
 }
 ]
}
EOF
}

The error message from the apply is not terribly informative, simply stating “Failed to update flow”. It’s not a 4xx or 5xx status code, which is making debugging this a little more difficult. It would be helpful to understand if others have encountered this, or if there’s a recommended approach for handling URL-encoded parameters within Data Actions when deploying flows via terraform. Quick one - has anyone seen similar behaviour?