---
title: "Fix WQL Indexing Delays on findCandidates and allWorkers"
description: "Fix empty WQL query results on findCandidates and indexedAllWorkers after a business process step by separating transaction commit timing from index lag."
url: https://kiweely.com/guides/wql-indexing-delay-findcandidates-bp-status-change
---

# Why WQL Queries on findCandidates and allWorkers Return Empty Right After a Business Process Step

WQL queries triggered during a Workday business process often return zero rows for two distinct reasons: the transaction has not committed yet, or the query reads an eventually consistent indexed data source like findCandidates. Trigger on Completed status or pass launch parameters directly.

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

## Why WQL returns zero rows right after a business process fires

When an orchestration or integration runs a Workday Query Language (`WQL`) query immediately after a candidate applies for a job or a worker transaction starts, the `/wql/v1/data` response frequently comes back with `"total": 0` and `"data": []`. Rerunning the same integration manually a few minutes later returns the expected candidate or worker record without any change to the query.

This symptom comes from two separate platform mechanisms that look identical from the outside:

1.  **Transaction sequencing (uncommitted business process data):** If the orchestration is launched by an in-flight Integration System step inside a business process—such as **Assess Candidate** or **Job Application**—before the business process step writing the record has committed, the target instances do not exist in the reporting layer yet.
2.  **Indexed data source lag (eventual consistency):** Even after the business process transaction commits, indexed reporting data sources (`findCandidates`, `indexedAllWorkers`, and extended indexed data sources) are updated asynchronously. Workday’s search index refresh is eventually consistent and is not guaranteed to reflect newly created records within seconds of submission.

Adding an artificial loop or delay step inside an orchestration does not reliably solve either condition. Under tenant load, index updates can take minutes or longer, and an in-flight business process step waiting on a synchronous integration will hold the transaction open for the entire duration of the delay.

## Fix 1: Pass business process context directly or trigger on status change

If your orchestration only needs the candidate, worker, or assessment event that triggered the workflow, do not run a discovery `WQL` query to search for the record that the business process just touched.

### Use a Business Process Trigger Orchestrate Service step

When you attach a **Business Process Trigger Orchestrate Service** step directly to the business process definition, you configure the exact contextual fields that Workday passes into the orchestration at launch. Instead of querying `findCandidates` by candidate name or application date, pass the `Job_Application_Event` WID, `Candidate` WID, and assessment references as launch parameters on the trigger step.

Inside the orchestration, read the launched instance directly from the `lp` global variable:

javascript

```
// Retrieve the Candidate WID and Event WID passed by the BP trigger
lp.referenceData("Candidate", "WID")
lp.referenceData("Event", "WID")
```

Because you already have the exact `workdayID` of the primary object, you can read its fields directly via a transactional Workday REST or SOAP operation, or query a non-indexed Primary Business Object (`PBO`) data source filtered by `WHERE workdayID = '<WID>'`.

### Trigger on Business Process Status Change

If the orchestration is triggered via an integration step while the business process is still mid-step, move the trigger to launch on a **Business Process Status Change**—such as when the business process reaches `Completed`—rather than an in-flight step before the commit boundary. Launching on completion guarantees that the underlying business process transaction has committed its records to the tenant database before the first orchestration step runs.

## Fix 2: Replace indexed data sources with non-indexed PBO data sources

When your orchestration or Presentation Metadata (`PMD`) page must run a `WQL` query immediately after a transaction commits, inspect the `FROM` clause of your query. You can check whether a data source is indexed by opening the **Data Source** report in your tenant or running **Convert Report to WQL** on a test custom report.

### Switching from `findCandidates` to a non-indexed candidate data source

A query against the indexed `findCandidates` data source looks like this:

sql

```
SELECT workdayID, candidateID, fullName, email, phoneNumber
FROM findCandidates
WHERE jobApplicationEvent = 'c1a822a2c1a41012126f2bb624820000'
```

Because `findCandidates` is an indexed data source, a candidate who just submitted an external job application will not appear in `findCandidates` until the search index refreshes. To read the candidate record immediately upon creation, switch the `FROM` clause to a non-indexed candidate or job application data source (or query the `Candidate` business object directly by its `workdayID`).

### Retrieving internal candidate contact details on non-indexed data sources

One reason developers choose `findCandidates` is that its top-level `email` and `phoneNumber` fields return contact details for both external and internal candidates, whereas non-indexed candidate data sources only populate direct candidate contact fields for external candidates. For internal candidates, contact information lives on the linked `Worker` business object rather than the `Candidate` record.

To get real-time results without losing internal candidate contact fields:

1.  Run **Create Calculated Field** in the tenant and create an **Extract Single Instance** or **Lookup Related Value** calculated field (`cf_InternalCandidateWorkEmail` and `cf_InternalCandidatePhone`) on the `Candidate` business object that pulls primary work contact data from the related `Worker` object.
2.  Create an **Evaluate Expression** calculated field (`cf_CandidateResolvedEmail`) on `Candidate` that returns the external candidate email when present and falls back to `cf_InternalCandidateWorkEmail`.
3.  Select the calculated field in your `WQL` query against the non-indexed data source:

sql

```
SELECT workdayID,
       candidateID,
       fullName,
       cf_CandidateResolvedEmail AS email,
       cf_CandidateResolvedPhone AS phoneNumber
FROM candidatesForRecruiting
WHERE workdayID = 'd92a14f8b6110100245cb60433080001'
```

Similarly, for worker queries that run immediately after a **Hire** or **Change Job** completion, avoid `indexedAllWorkers` when real-time consistency is required; query `workersForHCMReporting` or `allActiveAndTerminatedWorkers` filtered by `WHERE workdayID = '<workerWID>'`.

## How to verify the fix in your tenant

1.  Open **View WQL Query Result** (or test via **REST API Explorer** against `GET /wql/v1/data`) using your non-indexed data source and the calculated contact fields for both an internal candidate (`Worker` record linked) and an external candidate.
2.  Submit a new application for a test requisition so the **Job Application** and **Assess Candidate** business processes run end to end.
3.  Open **Orchestration Activity** (or **Integration Events**) for the triggered run and inspect the `WQL` step output payload. Confirm that `"total"` is `1` and the candidate’s `workdayID` and contact fields are populated on the first execution without manual relaunch.

## Sources checked

-   [Concept: Indexed Data Sources and Fields](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/data-sources/dan1370796448940.html)
-   [Launch Orchestrations on Business Process Status Changes](https://developer.workday.com/documentation/GUID-9b1d837c-fd73-4768-92d7-40b9ed06ac25)
-   [Trigger an Orchestration from a Business Process](https://developer.workday.com/documentation/kcz1625656998198)
-   [Concept: Workday Query Language (WQL)](https://developer.workday.com/documentation/GUID-6546152a-bcf0-447d-8d64-230f9e2ac291-enHYPHENus)
-   [Reference: WQL REST API](https://developer.workday.com/documentation/GUID-5c940864-7651-4e28-a9d2-79b45292e66a-enHYPHENus)

## Related guides

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

-   [### Handling Silent GraphQL Errors in PMD and Orchestrate When HTTP Status Returns 200 OK Workday Graph API endpoints return HTTP 200 OK even when a query or mutation fails with an S21 or validation error inside the JSON errors array. Inspect $.errors explicitly in Orchestrate and verify that your .amd base URL version matches Graph API Explorer.](https://kiweely.com/guides/workday-graphql-http-200-silent-mutation-errors)
-   [### Why fileLength on workerDocuments Returns 52 in WQL for Business Process Attachments Querying fileLength on the workerDocuments related business object in WQL returns a constant 52 (or 0) whenever the document was attached through a business process event. Retrieve the actual byte length in Workday Orchestrate using Data.contentLength().](https://kiweely.com/guides/wql-workerdocuments-filelength-returns-52)
-   [### Escaping Single Quotes for Multi-Value IN Clauses and Fixing Double URL-Encoded Unicode in PMD WQL Dynamic WQL queries in Workday Extend PMD fail when comma-separated attribute strings are wrapped in a single pair of quotes or when instanceListQuery is double URL-encoded. Split and quote each ID individually, and call string:urlDecode(instanceListQuery) before building the WQL string.](https://kiweely.com/guides/wql-pmd-single-quote-escaping-double-urlencoded-unicode)
-   [### Filtering WQL Queries by Organization Hierarchy and workersByRole Without Throwing Security Errors To return workers in an HR Partner’s assigned organizations and subordinate hierarchies, use workersForHCMReporting with dataSourceFilter = workersByRole. Guard the endpoint with an exclude check so users without the constrained role do not trigger a hard WQL error.](https://kiweely.com/guides/wql-organization-hierarchy-filter-workersbyrole)

### More guides on WQL

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

-   [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)
-   [Fixing WQL “Specify a valid report field” and HTTP 500 Errors When an ISU Queries Calculated Fields](https://kiweely.com/guides/wql-calculated-field-isu-specify-valid-report-field-500)
-   [Why WQL AVG() Rounds to Whole Numbers and How to Handle Conditional Logic Without CASE](https://kiweely.com/guides/wql-avg-integer-rounding-conditional-logic-without-case)
-   [WQL 500-Instance Related Business Object Limit and Large IN (...) Filter Limits](https://kiweely.com/guides/wql-500-rbo-instances-per-row-large-in-filter-limits)

### 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.
