CX as Code Data Action Dependencies

Hello. I am participating in the Predictive Routing beta program and testing different routing models across our development and production organizations. We are using Terraform and CX as Code to deploy our Data Actions so we can maintain version control. However, I have a major problem. When Terraform deploys a Data Action to the production organization, it generates a completely new GUID for the action. My Architect flows are hardcoded to the GUID from the development organization, so they immediately break when imported into production! How do I configure Terraform to keep the same Data Action ID, or how do I update the Architect flows automatically during the deployment?

You cannot force Genesys Cloud to utilize a specific GUID when creating a new resource via the API or Terraform. The platform dictates the unique identifier upon creation. To resolve this dependency issue, you must utilize the genesyscloud_flow resource within your Terraform configuration.

Furthermore, you must configure Archy to resolve the dependencies dynamically. You achieve this by defining an archyDeploy.yaml file alongside your flow export.

In your Terraform script, you pass the newly generated Data Action ID from the genesyscloud_integration_action resource directly into the Archy deployment command as a substitution variable. This ensures the flow compiles correctly with the new production GUID.

I agree with the previous explanation. I encountered the exact same issue when migrating Zendesk data dips into multiple Genesys Cloud environments. If you do not want to use Archy and prefer to manage the flow strictly through the Terraform genesyscloud_flow resource using a YAML file, you must use Terraform template strings.

You export your Architect flow as a YAML file, replace the hardcoded Data Action ID with a variable like ${data_action_id}, and then use the Terraform templatefile() function to inject the new GUID during the deployment phase. It is very effective for multi-environment deployments.

Greetings everyone! Managing multiple organizations is absolutely my specialty! The template file approach mentioned above is a brilliant way to solve this! However, I strongly recommend utilizing the genesyscloud_tf_export resource if you are just starting out! It can automatically generate the Terraform files and extract the hardcoded IDs into variables for you! It saves a tremendous amount of time compared to manually finding and replacing every single GUID in a massive JSON or YAML flow file! Just make sure your Data Actions and your Architect flows are deployed in the correct sequence within your Terraform plan, otherwise the flow will fail to compile!