Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-14-2025 08:18

    I am new to CX as code. Can someone explain how we can export the Architect flow with all the dependencies from the Dev Environment and import it in the Prod Environment with all dependencies using CX as Code?


    #CXasCode

    ------------------------------
    Hari Shankar
    Genesys Specialist
    ------------------------------


  • 2.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-14-2025 08:44

    Hi Hari,


    Take a look at our export guide: https://registry.terraform.io/providers/MyPureCloud/genesyscloud/latest/docs/guides/export

    If you set the enable_dependency_resolution  flag to true and you will get the static dependency exported.  However, if you are doing anything dynamic (e.g. FindByQueueName or looking up data from a data table), you will need to explicitly add that to the final export using the terraform depends_on tag.

    Thanks,
        John



    ------------------------------
    John Carnell
    Director, Developer Engagement
    ------------------------------



  • 3.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-15-2025 07:59

    Hi John,

    Thanks for the reply I tried the below .tf file to export the Architect flow with all the dependencies.

    terraform {
      required_providers {
        genesyscloud = {
          source  = "mypurecloud/genesyscloud"
          version = "~> 1.10"
        }
      }
    }
     
    provider "genesyscloud" {
      oauthclient_id     = var.client_id
      oauthclient_secret = var.client_secret
      aws_region              = var.region
    }
     
    resource "genesyscloud_tf_export" "support_inbound_flow" {
     
      directory                   = "./genesyscloud/include-filter"
     
      export_format               = "hcl"
     
      log_permission_errors       = true
     
      enable_dependency_resolution = true
     
     
     
      include_filter_resources = [
     
        "genesyscloud_flow::^Support_Inbound_Flow$"
     
      ]
     
    }

    after hitting terraform apply command it created .tf inside /genesyscloud/include-filter this folder but that tf file doesn't have any details related to Architect flow.

    Please find the content of that file 

    terraform {
      required_providers {
        genesyscloud = {
          source  = "registry.terraform.io/mypurecloud/genesyscloud"
          version = "1.63.0"
        }
      }
    }
     
    Can you please help me with how i can achieve my requirement here


    ------------------------------
    Hari Shankar
    Genesys Specialist
    ------------------------------



  • 4.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-19-2025 08:33

    Hi Hari,

    Please make sure you set: 

    use_legacy_architect_flow_exporter = false


    ------------------------------
    John Carnell
    Director, Developer Engagement
    ------------------------------



  • 5.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-21-2025 02:10

    Hi John,

    I tried the below terraform to export the flow with its dependency, but it's not working.

    terraform {
      required_providers {
        genesyscloud = {
          source  = "mypurecloud/genesyscloud"
          version = "~> 1.63.0"
        }
      }
    }
     
    provider "genesyscloud" {
      oauthclient_id     = var.client_id
      oauthclient_secret = var.client_secret
      aws_region         = var.region
    }
     
    resource "genesyscloud_tf_export" "example" {
      directory                          = "./genesyscloud/flows"
      export_format                      = "hcl"
      include_filter_resources           = ["genesyscloud_flow::^Support_Inbound_Flow$"]
    enable_dependency_resolution       = true
      use_legacy_architect_flow_exporter = false
    }
    using the above Terraform, when I hit terraform apply it generates one Terraform file which has the following content.
    terraform {
      required_providers {
        genesyscloud = {
          source  = "registry.terraform.io/mypurecloud/genesyscloud"
          version = "1.63.0"
        }
      }
    }
     


    ------------------------------
    Hari Shankar
    Genesys Specialist
    ------------------------------



  • 6.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-21-2025 08:23

    Hi Hari,  

    Just so I am clear you are not even getting the architect flow configuration (not even the YAML) file being returned.  That would tell me that there is something wrong with the regular expression you are using.   The regular expression you are using is pretty restrictive and will do an exact match on case and name.  Are you sure you want that?  For instance you might consider something a little more loose:

    (?i)Support_Inbound_Flow

    Thanks, 
       John



    ------------------------------
    John Carnell
    Director, Developer Engagement
    ------------------------------



  • 7.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-21-2025 10:41
    Edited by Charlie Conneely 05-22-2025 04:39

    Hi Hari,

    John is correct. The regex is not finding the flow. This appears to be a bug on our end; a simple regex like this should work. We're going to create a ticket and address it as soon as we can.
    In the meantime, the example below will manage to locate the flow:

    include_filter_resources = ["genesyscloud_flow::Support_Inbound_Flow"]

    Unfortunately, this will act as regex that will match other flows like "Support_Inbound_Flow_123", for example. For now, the solution to this problem is to make sure no other flow names contain the text "Support_Inbound_Flow"



    ------------------------------
    Charlie Conneely
    Software Engineer
    ------------------------------



  • 8.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-22-2025 06:57

    Hi Charlie and John,

    Thanks for the reply, I tried with include_filter_resources = ["genesyscloud_flow::Support_Inbound_Flow"] and it is working with me.

    Flow was exported with its dependency, except for the dependency of Integration. Is that some limitation for the Flow?

    But what if I want to export for the exact name, as the name was correct? 

    Can we also export the flow for some specific version of the flow? 



    ------------------------------
    Hari Shankar
    Genesys Specialist
    ------------------------------



  • 9.  RE: Export the Architect flow with all the dependency from Dev Environment and Import it in Prod Environment using CX as Code

    Posted 05-26-2025 06:52
    Edited by Charlie Conneely 05-26-2025 06:53

    Another developer in the company pointed out that the regex is not working because, for flows, you need to include the flow type at the start of the expression (e.g., "genesyscloud_flow::^INBOUNDCALL_Support_Inbound_Flow$").

    The regex is not actually run against the name of the entity, but rather against the label of the exported resource. We usually set the exported resource label as the name of the entity; however, since multiple flows can have the same name, we need to include the flow type.

    I'm not sure about the integration issue. Is the integration referenced inside the flow config? If it is further downstream (e.g. the flow references a data action that references the integration), then the dependency resolution logic may not catch it. In that case, I would include "genesyscloud_integration" in the include_filter_resources list.



    ------------------------------
    Charlie Conneely
    Software Engineer
    ------------------------------