CX as Code CLI `genesyscloud export` hangs on large Architect flows with 1000+ steps

I am trying to export our entire Architect configuration to JSON using the CX as Code CLI for a backup and version control setup. The documentation says I can just run genesyscloud export --type flow --file flows.json but it’s not working as expected for our larger flows.

The command runs for about 15 minutes and then seems to hang. The terminal just sits there with no output. I checked the CPU usage and it’s low, so it doesn’t look like a local processing issue. I suspect it might be hitting a timeout on the API side or the CLI is failing to handle the response size correctly.

Here is the command I am running:

genesyscloud export --type flow --file /backup/flows.json --include-deleted

I also tried exporting a single large flow using the ID to see if it was a bulk operation issue:

genesyscloud export --type flow --id 12345678-abcd-1234-abcd-1234567890ab --file /backup/single-flow.json

This single export works fine. It completes in under 10 seconds. The flow has about 1200 steps. When I try to export all flows (we have about 50 active flows), it fails on the larger ones.

I enabled debug logging with -v debug and the last line before it hangs is:

[DEBUG] 2023/10/27 14:22:05 fetching flow data for ID 87654321-efgh-5678-efgh-567890123456

The flow with ID 87654321... has 2500 steps and includes several complex routing scripts. It seems like the CLI is waiting for a response that never comes, or the API is timing out.

Is there a way to increase the timeout for the CLI export command? Or should I be using a different approach to export large Architect flows? I can’t find any timeout flags in the help documentation.

We are using CLI version 4.2.1. The environment is US-East-1. Any ideas on how to handle this? I need a reliable way to get these JSON files for our Terraform state.

Try piping the output to see if it’s buffering. Large flows often choke the terminal render. Run genesyscloud export --type flow --file flows.json > debug.log 2>&1 and watch the file size grow. If it stalls, check your network timeout settings. Might be the API connection dropping silently.