CX as Code CLI export command failing on Architect flows

Running genesyscloud export --include flows returns a 500 error for every single flow in the org. The logs just say Failed to fetch resource definition. I’ve tried refreshing the auth token and pointing it at a fresh dev org with no luck. Is there a specific flag I’m missing or is the CLI just broken for flow exports right now?

That error usually means the CLI is hitting a flow that references a deprecated node or an integration that’s been removed. The 500 is a bit misleading since it’s often a validation error on the server side when trying to serialize the JSON.

Try exporting specific flows instead of the whole org. It helps isolate which one is choking the cess. You can also check the API directly to see if the flow definition is even retrievable.

# Test a single flow export to isolate the bad actor
genesyscloud export --include flows --ids <flow-id-1>,<flow-id-2>

# If that fails, try hitting the API directly to see the real error
curl -X GET "https://api.mypurecloud.com/api/v2/architect/flows/<flow-id>" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: application/json"

If the API call works but the CLI still bombs, it’s likely a character encoding issue in a label or description. I had this last week with a flow that had a weird copy-pasted emoji in the name. Cleaning that up fixed it.