---
title: "Paging with POST /wql/v1/data in a PMD Grid — Kiweely"
description: "How to paginate a Workday Extend PMD grid when a dynamic WQL query exceeds the 2,048-character GET URL limit and POST /wql/v1/data throws HTTP 500."
url: https://kiweely.com/guides/wql-post-data-endpoint-grid-pagination-url-limit
---

# Paging with POST /wql/v1/data in a PMD Grid When Queries Exceed URL Limits

Switching a PMD grid endpoint from GET /wql/v1/data to POST /wql/v1/data when a WQL query exceeds 2,048 characters causes HTTP 500 when native grid pagingInfo is enabled. Learn why PMD grid paging fails with POST and three working architectures to paginate long queries.

-   **Checked** against Workday on November 6
-   Applies to **Workday Query Language**
-   3 min read
-   Published November 6
-   By Kiweely

## Why Switching a Paginated PMD Grid to `POST /wql/v1/data` Returns HTTP 500

The WQL REST API provides two endpoints for executing queries:

-   `GET /wql/v1/data?query={myquery}`: Supports WQL queries up to **2,048 characters**.
-   `POST /wql/v1/data`: Accepts a JSON request body (`{"query": "...", "limit": 100, "offset": 0}`) for queries between **2,048 and 16,000 characters**.

When a Workday Extend page constructs a long dynamic `WHERE ... IN (...)` clause or selects dozens of fields and aliases, the query string easily crosses the 2,048-character threshold for `GET`. However, if you change a PMD inbound endpoint bound to a `grid` widget’s `pagingInfo` block from `"httpMethod": "GET"` to `"httpMethod": "POST"`, the page fails with an HTTP `500` error as soon as the grid loads or the user clicks to the next page.

This happens because Workday Extend’s built-in `pagingInfo` framework on a `grid` widget is designed around `GET` requests. When a user pages through a grid, the native `pagingInfo` handler automatically appends `?limit=...&offset=...` as URL query parameters to the endpoint invocation rather than serializing `limit` and `offset` into the JSON request body expected by `POST /wql/v1/data`.

## Three Working Patterns for Paginating Long Queries in a PMD Grid

When you cannot shorten the WQL query below 2,048 characters (for instance, by moving complex conditions into a Calculated Field or using a hierarchy filter), use one of these three verified patterns.

### Pattern 1: Wrap `POST /wql/v1/data` in a Synchronous Orchestration Called via `GET`

The cleanest way to preserve native PMD grid `pagingInfo` while executing `POST /wql/v1/data` is to create a **Synchronous Orchestration** that acts as a bridge:

1.  Configure the Synchronous Orchestration to accept `limit`, `offset`, and your filter criteria (or a reference ID to a staging record) as orchestration launch parameters.
2.  Inside the orchestration, add a **Send Workday API Request** (or WQL step) that sends an HTTP `POST` to `/wql/v1/data` with the JSON body containing the full `query`, `limit`, and `offset`:
    
    json
    
    ```
    {
      "query": "SELECT worker, employeeID, location FROM allWorkers WHERE ...",
      "limit": 100,
      "offset": 0
    }
    ```
    
3.  Return the WQL JSON response (`data` and `total`) as the Synchronous Orchestration’s output.
4.  On the PMD page, bind the inbound endpoint to the Synchronous Orchestration using `"httpMethod": "GET"`, and bind the grid’s `pagingInfo.endPoint` to that endpoint. Because the PMD page talks to the Synchronous Orchestration over `GET`, native grid pagination works without modification while the orchestration executes the 16,000-character `POST /wql/v1/data` call behind the scenes.

### Pattern 2: Convert the Query to a Workday GraphQL (`workday-graphql`) Endpoint

Workday GraphQL (`POST https://api.workday.com/graphql/v1`) natively uses HTTP `POST` without the 2,048-character URL ceiling, and PMD’s `graphQuery` property explicitly binds `pagingVariables.offset` and `pagingVariables.limit` into GraphQL `$offset` and `$limit` variables.

First, create a Graph Query component (`getWorkers.graph`):

json

```
{
  "id": "getWorkers",
  "query": "query getWorkers($offset: BigInt, $limit: BigInt) { worker(dataSource: {indexedAllWorkers: {filter: {indexedAllWorkersFilter: {}}}}, limit: $limit, offset: $offset) { data { nameInGeneralDisplayFormat descriptor workdayID { id } } total } }"
}
```

Then configure the PMD inbound endpoint with `"httpMethod": "POST"` and map `pagingVariables.offset` and `pagingVariables.limit` using `number:convertStringToInt`:

json

```
{
  "id": "workersView",
  "endPoints": [
    {
      "name": "getWorkers",
      "httpMethod": "POST",
      "authType": "sso",
      "url": "https://api.workday.com/graphql/v1",
      "graphQuery": {
        "queryId": "getWorkers",
        "variables": {
          "offset": "<% empty pagingVariables.offset ? 0 : number:convertStringToInt(pagingVariables.offset) %>",
          "limit": "<% empty pagingVariables.limit ? 100 : number:convertStringToInt(pagingVariables.limit) %>"
        }
      },
      "failOnStatusCodes": [
        { "code": 400 },
        { "code": 429 }
      ]
    }
  ],
  "presentation": {
    "body": {
      "type": "section",
      "children": [
        {
          "type": "grid",
          "id": "workersGrid",
          "label": "Workers",
          "rows": "<% getWorkers.data.worker.data %>",
          "rowVariableName": "worker",
          "pagingInfo": {
            "endPoint": "<% endpoints.getWorkers %>",
            "rowCount": "<% getWorkers.data.worker.total %>",
            "data": "<% getWorkers.data.worker.data %>"
          },
          "columns": [
            {
              "type": "column",
              "columnId": "workerIdColumn",
              "label": "Worker ID",
              "cellTemplate": {
                "type": "text",
                "id": "workerId",
                "value": "<% worker.workdayID?.id %>"
              }
            }
          ]
        }
      ]
    }
  }
}
```

Keep in mind that Workday GraphQL enforces a maximum `limit` of 100 rows per page, so set the default `limit` to `100` or less.

### Pattern 3: Custom Paging Buttons with `pageVariables`

If you want to call `POST /wql/v1/data` directly from PMD without a Synchronous Orchestration or GraphQL, omit the native `pagingInfo` block on the `grid` widget and manage pagination state in `pageVariables`:

1.  Initialize `pageVariables.offset = 0` and `pageVariables.limit = 50`.
2.  Configure your deferred `POST /wql/v1/data` endpoint to read `pageVariables.offset` and `pageVariables.limit` inside its JSON request body.
3.  Add **Previous** and **Next** button widgets below the grid whose `onClick` scripts increment or decrement `pageVariables.offset` by `pageVariables.limit`, re-invoke the `POST` endpoint, and refresh the grid’s `rows` array.

## How to Verify in the Tenant

1.  Test your WQL statement in **View WQL Query Result** or via `POST /wql/v1/data` in **REST API Explorer** to confirm the query syntax is valid and under the 16,000-character `POST` limit.
2.  Deploy your PMD page and Synchronous Orchestration (or Graph Query component) to your development tenant.
3.  Open the browser developer tools (**Network** tab), load the Extend page, and click through pages 1, 2, and 3 on the grid.
4.  Confirm that each page transition returns HTTP `200`, advances `offset` by the page size, and displays the expected slice of `total` records without throwing an HTTP `500` error.

## Sources checked

-   [Reference: WQL REST API](https://developer.workday.com/documentation/GUID-5c940864-7651-4e28-a9d2-79b45292e66a-enHYPHENus)
-   [Concept: Pagination of WQL Query Results](https://developer.workday.com/documentation/GUID-c4a11fa0-44b9-49ef-bb37-49f3b601b3bd-enHYPHENus)
-   [WQL Query Components](https://developer.workday.com/documentation/GUID-7521e54e-6b4c-498a-be58-e0c83b8fb85d-enHYPHENus)
-   [Graph Query Components](https://developer.workday.com/documentation/rol1682042554209)

## Related guides

[All guides](https://kiweely.com/guides)

-   [### WQL 500-Instance Related Business Object Limit and Large IN (...) Filter Limits WQL enforces a strict limit of 500 instances per multi-instance Related Business Object (RBO) on a single row and fails with S24 Internal Error when filtering large IN (...) lists of 200–600+ Workday IDs. Learn how to invert the PBO, filter by hierarchy, or use RaaS.](https://kiweely.com/guides/wql-500-rbo-instances-per-row-large-in-filter-limits)
-   [### What is Workday Query Language (WQL), and how do you write and run a query? Workday Query Language (WQL) is Workday’s SQL-like language for reading data from data sources and fields instead of reports. You need the Workday Query Language domain in the System functional area; an external caller also needs an API client with System scope.](https://kiweely.com/guides/workday-wql)
-   [### Why does my Workday WQL query fail? The exact error messages and how to fix each one Workday has no WQL message worded ‘instance set invalid for prompt’. A rejected prompt value returns ‘Invalid Parameter Values for parameter’ or ‘does not meet the restrictions defined for this field’. This page quotes each common error as Workday returned it, with the fix.](https://kiweely.com/guides/wql-error-messages)
-   [### How do I get more than 500 rows from a Workday WQL query? The 500-row stop belongs to the View WQL Query Result report. The WQL REST API returns up to 10,000 rows per page: pass limit (0 to 10,000) and offset. A worked run pages 48,491 rows in five calls, with Workday’s exact errors for a limit above 10,000 and an offset past the end.](https://kiweely.com/guides/wql-more-than-500-rows)

### More guides on WQL

[All 31 guides](https://kiweely.com/guides#wql)

-   [Escaping Single Quotes for Multi-Value IN Clauses and Fixing Double URL-Encoded Unicode in PMD WQL](https://kiweely.com/guides/wql-pmd-single-quote-escaping-double-urlencoded-unicode)
-   [Filtering WQL Queries by Organization Hierarchy and workersByRole Without Throwing Security Errors](https://kiweely.com/guides/wql-organization-hierarchy-filter-workersbyrole)
-   [Why WQL Queries on findCandidates and allWorkers Return Empty Right After a Business Process Step](https://kiweely.com/guides/wql-indexing-delay-findcandidates-bp-status-change)
-   [Fixing WQL Error 804 on GROUP BY and Related Business Object Aggregation Limits](https://kiweely.com/guides/wql-group-by-error-804-rbo-aggregation-limits)
-   [Fixing WQL Error “Empty Required Parm Moment\_Parm” with SUM()](https://kiweely.com/guides/wql-empty-required-parm-moment-parm-sum)
-   [Fixing WQL “Cannot construct instance source on grouped results” with COUNT(DISTINCT)](https://kiweely.com/guides/wql-count-distinct-with-where-on-rbo-filter)
-   [Why WHERE fieldA = fieldB Throws “Invalid Where Clause” in WQL](https://kiweely.com/guides/wql-compare-two-fields-where-clause-invalid)
-   [Filtering Empty Related Business Objects in WQL and Guarding Omitted RBO Keys in PMD](https://kiweely.com/guides/wql-check-rbo-empty-missing-json-keys-pmd)

### From the blog on WQL

[All posts](https://kiweely.com/blog)

-   [Answering Executive Span-of-Control and Headcount Questions Live from Workday](https://kiweely.com/blog/executive-org-span-of-control-attrition-questions-live-workday)
-   [Build vs. Buy a Workday MCP Server: OAuth 2.1, SOAP, WQL, and Twice-Yearly Releases](https://kiweely.com/blog/build-vs-buy-workday-mcp-server-engineering-cost)
-   [What happens after ChatGPT writes your WQL query](https://kiweely.com/blog/after-chatgpt-writes-your-wql)

## Let Workday check the work.

Kiweely writes WQL and builds orchestrations in your own tenant, and Workday, not Kiweely, says whether they passed.

[Start for free](https://kiweely.com/download) [See how it works](https://kiweely.com/vine/how-it-works)

## Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.
