---
title: "Wait for Import_Payroll_Input Background Processes in O4I"
description: "Replace WQL polling loops in Workday Orchestrate with a Child Integration and Trigger Integration to wait for Import_Payroll_Input_Request completion."
url: https://kiweely.com/guides/workday-orchestrate-wait-background-process-import-payroll-input
---

# Waiting for Import\_Payroll\_Input\_Request Background Processes at Scale in Workday Orchestrate

Calling Import\_Payroll\_Input\_Request in Workday Orchestrate spawns an asynchronous background process. Instead of polling WQL in a fixed-iteration loop, invoke the import inside a child O4I integration via Trigger Integration, which waits for all spawned background jobs to complete before resuming.

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

## Why WQL Polling Loops Fail at Scale for `Import_Payroll_Input_Request`

When an **Orchestrate for Integrations (O4I)** orchestration calls the Workday Payroll `Import_Payroll_Input_Request` SOAP web service, Workday validates the SOAP envelope, returns an `Import_Process_Reference` WID immediately, and queues an asynchronous background import process in the tenant. You cannot retrieve row-level validation errors via `Get_Import_Process_Messages_Request` until that background import process finishes.

A common anti-pattern is placing a fixed-count **Loop** (with Early Stop Conditions) after `Import_Payroll_Input_Request` that repeatedly executes a WQL or SOAP status query to poll whether the background process has reached `Completed` status. At enterprise volumes (30,000 to 50,000+ one-time payroll inputs split into batches of 1,000 to 5,000 records), polling loops break down:

1.  **Unpredictable Background Queue Duration:** Under heavy tenant payroll load, a 5,000-record `Import_Payroll_Input_Request` batch can require 65–70+ polling iterations, exhausting fixed loop limits before the job finishes.
2.  **Per-Process Execution Timeouts:** Spinning inside a sub-orchestration polling loop consumes active orchestration execution time without triggering an integration process checkpoint, causing the run to hit the 45-minute non-production (or 60-minute production) per-process ceiling.
3.  **Wasted API Gateway Capacity:** Executing dozens of WQL or SOAP status checks per batch across 30+ batches generates hundreds of redundant API calls.

* * *

## Using a Child O4I Integration and `Trigger Integration` to Wait Automatically

Workday’s **Trigger Integration** component provides native synchronization for background import processes. When a parent O4I orchestration invokes a child O4I integration via **Trigger Integration**:

1.  The parent orchestration **pauses its execution and checkpoints**, releasing active execution threads.
2.  The child O4I integration executes `Import_Payroll_Input_Request`.
3.  Crucially, Workday’s integration runtime **does not mark the child integration event complete until all background import processes spawned by that child integration have completed**.
4.  Once the background `Import_Payroll_Input` job finishes, Workday sends a completion callback to the parent orchestration, which resumes on a fresh process checkpoint and can immediately call `Get_Import_Process_Messages_Request` without any polling loop.

### Architecture for 30,000+ Payroll Inputs (`Parent -> Batch Loop -> Trigger Integration`)

Split the high-volume import across a **Parent Orchestration** and a **Child Import Processor Orchestration** within the same Integration App:

#### 1\. Parent Orchestration (`PayrollInputParentOrchestration`)

-   Retrieve the inbound flat file or CSV and iterate over the rows using a **Batch Loop** configured to chunk records into batches of **1,000 rows** per batch.
-   Inside the **Batch Loop**, use **Create Text Template** (`BuildImportBatchXml`) to transform the 1,000 rows into an `Import_Payroll_Input_Request` XML payload.
-   Add a **Trigger Integration** step (`TriggerChildImport`) inside the **Batch Loop** that invokes the Child O4I Integration System, passing `data.BuildImportBatchXml.message` on the **Document** tab:
    -   **Document to Store:** `data.BuildImportBatchXml.message`
    -   **Document Title:** `"Payroll_Batch_".append(data.BatchLoop.index.toString()).append(".xml")`
    -   **Storage Expires In:** `zoneddatetime.now().plusDays(7)`
    -   **Add “Retrieved” Workday Tag:** `true` (so the child integration reads the batch XML via `documents.get(0)`).

#### 2\. Child Integration (`PayrollInputChildProcessor`)

-   Read the passed batch XML payload using `documents.get(0).asXML().wrapSoapV11()` and invoke **Send Workday API Request** (`POST /soap/v46.2/Payroll`).
-   Extract the returned `Import_Process_Reference` WID from `Import_Payroll_Input_Response`:
    
    javascript
    
    ```
    data.SendPayrollImportSoap.response
      .asXML()
      .stringAtXPathWithDefault(
        "/*/*/wd:Import_Payroll_Input_Response/wd:Import_Process_Reference/wd:ID[@wd:type='WID']",
        ""
      )
    ```
    
-   Because a child integration triggered via **Trigger Integration** does not return arbitrary variables directly like a sub-orchestration, write the `Import_Process_Reference` WID into a small JSON or XML file using **Store Document** (`StoreImportProcessWid.json`) on the child integration event:
    
    json
    
    ```
    {
      "importProcessWid": "{{data.ExtractWid.importProcessWid}}"
    }
    ```
    

#### 3\. Retrieving Consolidated Error Messages in the Parent Orchestration

Immediately after the `TriggerChildImport` step inside the parent’s **Batch Loop** (no delay or polling loop needed):

1.  Read the `Import_Process_Reference` WID from the child integration’s attached document using `.childDocuments` on the **Trigger Integration** step output:
    
    javascript
    
    ```
    data.TriggerChildImport.childDocuments
      .name("StoreImportProcessWid.json")
      .get(0)
      .asJSON()
      .stringAtJsonPath("$.importProcessWid")
    ```
    
2.  Invoke **Send Workday API Request** (`POST /soap/v46.2/Integrations`) with `Get_Import_Process_Messages_Request`:
    
    xml
    
    ```
    <bsvc:Get_Import_Process_Messages_Request bsvc:version="v46.2" xmlns:bsvc="urn:com.workday/bsvc">
      <bsvc:Import_Process_Reference>
        <bsvc:ID bsvc:type="WID">{{data.ReadChildWid.importProcessWid}}</bsvc:ID>
      </bsvc:Import_Process_Reference>
    </bsvc:Get_Import_Process_Messages_Request>
    ```
    
3.  Aggregate the returned `<wd:Import_Process_Message>` fragments across all batches and store a single consolidated audit/error report on the parent integration event via **Store Document**.

* * *

## Verifying the Parent-Child Import Flow in Your Tenant

1.  Deploy the Integration App containing both the parent and child O4I Integration Systems to your tenant and ensure the initiating user (or configured ISU) has launch permissions on both systems.
2.  Launch the parent integration with a multi-batch test file (for example, 2,500 rows across 3 batches of 1,000) containing at least one intentional validation error.
3.  Open **Integration Events** in the tenant and verify that each child integration event waits for its spawned **Import Payroll Input** background process to finish before completing, and that the parent integration event immediately collects all row-level messages via `Get_Import_Process_Messages_Request` without any polling loop.

## Sources checked

-   [Concept: Triggering Integrations](https://developer.workday.com/documentation/GUID-70dd8b29-4d1e-4dd2-be16-3323387933b3)
-   [Reference: Trigger Integration](https://developer.workday.com/documentation/GUID-cb68f51e-56ce-4159-b450-5b5ede1caf59)
-   [Reference: Batch Loop](https://developer.workday.com/documentation/GUID-c382cf0c-48d1-4e31-a923-641d245bd06d)
-   [Reference: Store Document](https://developer.workday.com/documentation/GUID-711d1624-0e00-45a4-98bd-38bf4b9c4419)
-   [Reference: Orchestration Runtime Limits](https://developer.workday.com/documentation/GUID-b341f6f0-cd6f-4930-8bcb-723a03f64805)

## Related guides

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

-   [### Reading Integration Launch Attachments, Calling SOAP Integrations API, and Uploading ZIPs to Workday Drive in O4I In Orchestrate for Integrations (O4I), read launch files via an Integration Retrieval Service (‘Attach file at launch’) and documents.get(0). For Get\_Event\_Documents over SOAP, use /soap/v46.2/Integrations with .wrapSoapV11(), and test Workday Drive ZIP uploads outside Debug Mode.](https://kiweely.com/guides/workday-orchestrate-read-integration-attachment-retrieval-service)
-   [### JSONPath Logical Filter Expressions and Wildcard XPaths in Workday Orchestrate Compound JSONPath filter expressions (&&, ||) in Workday Orchestrate fail silently when typographic quotes are pasted or unsupported filter tokens are chained. Learn the supported JSONPath and wildcard XPath syntax and when to replace SOAP launch polling with Trigger Integration.](https://kiweely.com/guides/workday-orchestrate-jsonpath-logical-filters-xpath-wildcards)
-   [### Preventing Duplicate Records on Orchestration Rerun and Concurrent Webhook Triggers in Workday Rerunning a partially failed orchestration or handling two webhook events firing seconds apart can create duplicate records in Workday. Replace report-fetch-delete-create sequences with atomic REST Batch calls (continueOnFailure: false), deterministic reference IDs, or staging queues.](https://kiweely.com/guides/workday-orchestrate-idempotency-concurrent-webhooks-duplicates)
-   [### Why Log to File Turns XML Closing Tags into <// and How to Write #if Conditions in CreateTextTemplate Viewing aggregated XML through a Log to File step in Workday Orchestrate turns every closing tag ‘</’ into ‘<//’ because Log to File defaults its CSV escape character to ‘/’. Use Store Document for XML files, and omit outer parentheses around #if conditions in CreateTextTemplate.](https://kiweely.com/guides/workday-orchestrate-xml-double-slash-log-to-file-if-conditions)

### More guides on Orchestrate

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

-   [Why Workday sub-orchestrations and BP orchestrations show Completed when an API call fails](https://kiweely.com/guides/workday-orchestrate-sub-orchestration-completed-on-api-error)
-   [Why stripHtmlTags and htmlToPlainText Leave HTML Tags Over 2,003 Characters in Workday Orchestrate](https://kiweely.com/guides/workday-orchestrate-striphtmltags-2003-character-limit)
-   [Sorting JsonKeyValueIterator Collections and Numeric String Values in Workday Orchestrate Loops](https://kiweely.com/guides/workday-orchestrate-sort-jsonkeyvalueiterator-numeric-sorting)
-   [Why SendWorkdayRaasRequest returns 401 Unauthorized or empty data via the cloud proxy](https://kiweely.com/guides/workday-orchestrate-sendworkdayraasrequest-401-cloud-proxy)
-   [Reusing and versioning sub-orchestrations across Workday Extend and O4I apps](https://kiweely.com/guides/workday-orchestrate-reuse-sub-orchestrations-across-apps)
-   [Picking up SFTP files from subfolders and reading IDs from PDF filenames in Orchestrate](https://kiweely.com/guides/workday-orchestrate-sftp-subfolders-pdf-files)
-   [Sending email from Orchestrate: the Connect sendMessage API and email connectors](https://kiweely.com/guides/workday-orchestrate-send-email)
-   [How to keep large Workday Orchestrate loads inside the runtime limits: templates, checkpoints, batches and child runs](https://kiweely.com/guides/workday-orchestrate-runtime-limit-large-loads)

### From the blog on Orchestrate

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

-   [Kiweely Roots vs Workday EIB, Studio, and Orchestrate](https://kiweely.com/blog/kiweely-roots-vs-workday-eib-studio-orchestrate)
-   [Orchestrate, an iPaaS, or Kiweely Roots](https://kiweely.com/blog/orchestrate-ipaas-or-kiweely-roots)
-   [Codex for Orchestration JSON: Catching the 25-Second Sync Trap Before Deploy](https://kiweely.com/blog/codex-orchestration-json-25-second-sync-trap)

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