CX as Code CLI export architect-flow returns empty array for root division

Problem
We need to export all Architect flows as JSON via the CX as Code CLI. The export command ignores child divisions. Passing the root division ID produces an empty list. Flows exist across multiple hierarchy levels.

Code

nice-cxone-cx-as-code-cli export architect-flow --divisionId "00000000-0000-0000-0000-000000000000" --output flows.json

Error
The command exits cleanly but the output is empty.

[]

The Python SDK confirms flows are present in child divisions.

client.architect_api.get_architect_flow_list(division_id="child-id")
# Returns expected flow list

Tried adding a recursive flag based on old forum notes.

nice-cxone-cx-as-code-cli export architect-flow --recursive --divisionId "00000000-0000-0000-0000-000000000000"
Error: unknown flag: --recursive

Question
How to export flows across all divisions in a single run? The docs only mention --divisionId. We don’t want to loop through every division ID in the automation script. The CLI manifest doesn’t show scope settings for recursion. There has to be a way to dump the full tree without iterating manually.

You’re hitting a known limitation with the CLI. It doesn’t recursively pull flows from child divisions by default. You’ll need to iterate through your division hierarchy manually.

First, grab all your active divisions:

nice-cxone-cx-as-code-cli get division --type all

Then loop through each ID to export. Here’s a quick bash snippet I use:

for div_id in $(nice-cxone-cx-as-code-cli get division --type all --output json | jq -r '.[].id'); do
 nice-cxone-cx-as-code-cli export architect-flow --divisionId "$div_id" --output "flows_${div_id}.json"
done

If you really want a single file, you’ll have to merge those JSONs yourself. The CLI just isn’t built for deep hierarchy exports right now. It’s annoying, but it works. Just make sure your token has the architect:flow:read scope, or you’ll get auth errors on the child divisions.