Architect AI Task 400 Bad Request during Terraform Apply

Dealing with a very strange bug here with the Genesys Cloud Terraform provider when updating an Architect flow that uses the ‘Run AI Task’ action. The deployment succeeds in the dev environment but fails consistently in staging.

The error returned is a 400 Bad Request with the message: Invalid configuration for AI Task. The model version ID does not match the expected schema for the selected model type.

Here are the environment details:

  • Terraform Version: 1.7.5
  • Genesys Cloud Provider: 1.19.0
  • Genesys Cloud Region: US1 (Sydney office connecting to US1 API)
  • Flow ID: f8a7b6c5-1234-5678-90ab-cdef12345678

The AI Task is configured to use a custom NLU model. The model version ID v2-abc123 exists and is active in the console. I have verified the ID via the CLI genesys cloud:ai:nlu:models:get command. The response confirms the model is valid.

The HCL resource looks like this:

resource "architect_flow" "main" {
 name = "Customer Intent Flow"
 description = "Handles customer inquiries using AI"
 
 # ... other flow config ...
 
 action {
 label = "Analyze Intent"
 type = "ai-task"
 
 ai_task_configuration {
 model_id = "custom-nlu-model-id"
 version_id = "v2-abc123"
 
 input_mapping = {
 text = "{{user.text}}"
 }
 
 output_mapping = {
 intent = "{{ai.intent}}"
 confidence = "{{ai.confidence}}"
 }
 }
 }
}

When I extract the flow via CLI, the JSON structure matches the console export exactly. However, pushing it back via Terraform triggers the 400 error. The API endpoint /api/v2/architect/flows/{id} returns the error during the PUT request.

Is there a known issue with the provider’s handling of AI task configuration blocks? Or is the version_id field expecting a different format? I have tried using the full UUID of the model version, but the error persists.

Any insights would be appreciated. The staging environment is blocked.