The Two Scale Limits That Break Single-Row RBOs and Large IN (...) Filters
Developers designing WQL integrations frequently know about WQL’s top-level row limits—up to 10,000 rows per page via limit and offset, and up to 1,000,000 rows total—but hit two lesser-known architectural limits at runtime:
- The 500-Instance Limit per Multi-Instance RBO Field: Even if a WQL query returns only 1 top-level row, any multi-instance Related Business Object (
RBO) field selected with{...}curly braces can return a maximum of 500 instances for that primary row. - Large
IN (...)Filter Complexity & Character Limits: Passing hundreds of individual Workday IDs (for example, 200 to 600+ location or worker WIDs) inside a singleWHERE field IN (...)clause causes WQL to fail withcode: "S24",error: "Internal error"or exceed the query character limit.
Understanding how Workday evaluates both constructs lets you redesign the query before it fails in production.
Limit 1: Maximum of 500 Instances on a Multi-Instance Related Business Object
Suppose you query a supervisory organization, a cost center, or a custom parent business object that returns a single top-level row, and you use RBO {} syntax to pull a multi-instance child collection containing thousands of workers or dependents:
SELECT supervisoryOrganization, workers{worker, employeeID, businessTitle}
FROM supervisoryOrganizations
WHERE supervisoryOrganization IN (356850fb684a10dec08d71cf278f916d)Although this query returns only 1 top-level row (well under the 10,000-row page limit), WQL fails with an error whenever the multi-instance RBO lookup field returns more than 500 values for a single primary business object (PBO) row. As documented in Workday’s Concept: Related Business Objects in WQL, Workday supports at most 500 instances per multi-instance RBO field.
Fix A: Invert the Query so the Child RBO Becomes the Primary Business Object
Instead of querying the parent object as the PBO and traversing the 1-to-many relationship via RBO {} braces, switch to a data source where the child record is the Primary Business Object (PBO) and filter by the parent instance in the WHERE clause:
SELECT worker, employeeID, businessTitle, supervisoryOrganization
FROM allWorkers
WHERE supervisoryOrganization IN (356850fb684a10dec08d71cf278f916d)When Worker (or Dependent, or your child Extend Model Business Object) is the PBO, each child instance is a top-level row. You can now retrieve 10,000 rows per page (up to 1,000,000 rows total) using standard limit and offset pagination without hitting the 500-instance RBO ceiling.
Fix B: Use Reports as a Service (RaaS) When PBO Inversion Is Not Possible
If no Workday data source exposes the child object as a PBO, build a custom Advanced Report and expose it via Reports as a Service (RaaS). Unlike WQL, RaaS does not cap multi-instance related business object collections at 500 values per row.
Limit 2: S24 Internal Error When Filtering 200–600+ IDs in WHERE ... IN (...)
A second failure occurs when an application maps a user’s selection (for example, 20 jurisdictions that expand to 600 individual Location Workday IDs) into a massive WHERE location IN (...) filter:
SELECT worker, employeeID, location, totalBasePay_Amount
FROM indexedAllWorkers (dataSourceFilter = indexedAllWorkersFilter)
WHERE location IN (
356850fb684a10dec08d71cf278f916d,
356850fb684a10dec08d7a46a6779177,
/* ... 600+ 32-character WIDs ... */
356850fb684a10dec08da9b8110791ae
)While this query succeeds for 10 or 20 locations, passing 200 to 600+ Workday IDs fails with HTTP 500 / 400:
{
"error": "Internal error",
"code": "S24",
"caseId": "a00f404e-d514-4ba5-be87-2af95c837252"
}In addition, if a dynamic script interpolates an empty array into an OR condition—producing invalid syntax such as WHERE (locationHierarchy IN () OR location IN (...))—WQL rejects the empty IN () list.
Fix A: Filter by Hierarchy or Parent Attribute Instead of Leaf WIDs
Never enumerate hundreds of leaf location, cost center, or organization WIDs when those instances belong to a parent hierarchy or share an attribute:
- Filter by Location Hierarchy (
locationHierarchyorlocationHierarchies) instead of 600 individuallocationWIDs. - If the grouping is defined in an Extend object or custom mapping, stamp a Custom Organization or Calculated Field (such as
cf_CFLRVTerritoryOfWorkeror primary work address state) onto the worker and filter on those 10–20 parent jurisdiction values directly.
Fix B: Guard Empty IN () Clauses and Chunk Large ID Lists
If you must filter by an arbitrary list of Workday IDs that do not share a hierarchy:
- Never emit an empty
IN ()clause: In PMD or Orchestrate, check whether the array of IDs is non-empty before appendingfield IN (...)to theWHEREstring. - Watch the character ceiling: 45 Workday IDs (each 32 chars plus quotes and commas) add over 1,600 characters, pushing
GET /wql/v1/dataover its 2,048-character URL limit. Switching toPOST /wql/v1/dataraises the character ceiling to 16,000 characters (~400 WIDs), but very largeINlists can still hit WQL filter tree complexity limits (S24). - Chunk in batches of 100–150 IDs: In an Orchestration loop, partition large ID lists into chunks of 100–150 WIDs per
POST /wql/v1/datarequest and aggregate the responses.
How to Verify in the Tenant
- Open View WQL Query Result in the tenant and test your query with a high-volume parent record (for example, a supervisory organization or location with more than 500 workers).
- Confirm that querying
workers{...}as an RBO fails once the child count exceeds 500, whereas queryingFROM allWorkers WHERE supervisoryOrganization IN (...)returns the full population cleanly. - For dynamic
IN (...)filters, test both boundary cases in your PMD or Orchestrate script: when a user selects0items (ensuringIN ()is omitted from the generated WQL) and when a user selects the maximum number of items.