Trying to bulk export Architect flows using the CX as Code CLI. The docs are thin on this. I’ve tried genesys cloud architect:export --help but it only lists single resource exports. Is there a flag or script to dump all flows in an org to JSON files? I’ve seen references to a download command in older repos but it’s missing in the current npm package. Just want to avoid writing a custom loop around the API.
Cause: The CX as Code CLI is designed for configuration management, not bulk archival. It expects a manifest file to know what to export. The download command you remember was likely part of an older internal tool or a different repo. The current standard is to define what you want in a manifest.yaml and then run the export. Trying to bypass this with a custom script is tempting, but you’ll hit rate limits fast if you don’t handle pagination correctly in the /api/v2/architect/flows endpoint.
Solution: You don’t need a custom loop. Just create a manifest that targets all flows. Here is the setup.
First, install the CLI if you haven’t:
npm install -g @genesys/cxascode
Then, create a manifest.yaml in your project root. This tells the CLI what to grab.
resources:
architect/flows:
filter:
- name: '*'
The filter: '*' is the key. It acts as a wildcard for all flows in your org. Once that file is in place, run the export command:
genesys cloud architect:export --manifest manifest.yaml --output ./exports
This will dump every flow into JSON files in the exports directory. It handles the API calls and pagination for you. If you only want specific flows, replace the * with a regex pattern like name: 'Production.*'.
Be aware that this exports the entire flow definition, including nodes and connections. If you have massive flows, the JSON files can get huge. Also, make sure your OAuth token has the architect:flow:view scope. Without it, the CLI will throw a 403 and fail silently on some resources.
I usually run this before a major deployment just to have a backup. It’s safer than relying on the UI export feature, which is slow and error-prone for large orgs. The CLI is much more deterministic.