We’re trying to baseline our Architect flows before migrating tracing logic into Data Actions. The goal is to export every flow as a JSON file so we can parse the node IDs and inject them into our OpenTelemetry span attributes later.
I’ve been following the CX as Code documentation, but the genesys cloud CLI seems to only export resources I explicitly specify or have in a state file. I don’t want to maintain a massive list of flow IDs in a config file if I can help it.
Here’s what I’ve tried so far:
genesys cloud architect flows export --all --format json
This returns a 400 Bad Request error:
{
"code": "bad-request",
"status": 400,
"message": "Invalid request parameters. The 'all' flag is not supported for flow exports without a specified resource ID."
}
I also tried using the REST API directly to list all flows first:
GET /api/v2/architect/flows?page_size=100
Then iterating through the IDs in Python to call the export endpoint for each:
import requests
import json
headers = {"Authorization": "Bearer <token>"}
flows_resp = requests.get("https://myorg.mygenesyscloud.com/api/v2/architect/flows?page_size=100", headers=headers)
flow_ids = [f["id"] for f in flows_resp.json()["entities"]]
for fid in flow_ids:
export_resp = requests.get(f"https://myorg.mygenesyscloud.com/api/v2/architect/flows/{fid}/export", headers=headers)
with open(f"flow_{fid}.json", "w") as f:
json.dump(export_resp.json(), f)
This works, but it’s painfully slow and I hit rate limits after about 50 flows. The CLI tool should have a way to do this in bulk, right? Or is there a specific flag I’m missing in the genesys cloud architect flows export command that handles bulk extraction without needing a pre-existing state file?
We need this to run automatically in our CI pipeline every night. Hardcoding IDs isn’t an option since new flows get created constantly.