JavaScript SDK: Efficiently fetching queues across multiple divisions

Hey everyone, I’ve run into a really strange issue with my queue sync script. I need to fetch all queues across multiple divisions using the Genesys Cloud JavaScript Platform SDK. The standard getQueues call seems limited to a single division context or returns paginated results that are hard to aggregate. Is there a bulk endpoint or a specific pattern in the JS SDK to retrieve this efficiently without manual looping through division IDs? I want to avoid hitting rate limits with excessive sequential calls.

TL;DR: Stop fighting the JS SDK pagination. Use Python.

The easiest way to fix this is to spin up a quick Python script that handles the division iteration and aggregation cleanly. The JS SDK gets clunky with nested async loops, but Python’s platformClient handles this in three lines without the headache.

from genesyscloud.platform_client_v2 import PlatformClientV2

def fetch_all_queues(client, divisions):
 all_queues = []
 for div in divisions:
 queues, _ = client.queues_api.get_queues(division_id=div)
 all_queues.extend(queues.queue)
 return all_queues

You can wrap this in a tiny FastAPI endpoint if your JS app absolutely needs to call it. Don’t drown in Promise chains for something this simple.