---
title: "Fix createReferenceList lists same size error — Kiweely"
description: "Why InstanceRef.createReferenceList throws '[StepException] requirement failed: Input lists must be of the same size' in Trigger Integration, and how to fix it."
url: https://kiweely.com/guides/workday-orchestrate-createreferencelist-input-lists-same-size
---

# Resolving ‘\[StepException\] requirement failed: Input lists must be of the same size’ in createReferenceList

The two-list overload InstanceRef.createReferenceList(idTypes: StringList, values: StringList) pairs idTypes\[i\] with values\[i\] and requires equal list lengths. Use the single-String overload InstanceRef.createReferenceList(idTypes: String, values: StringList) when all IDs share one type.

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

## Why `InstanceRef.createReferenceList` fails at runtime when passing multiple values

When configuring the **Launch Parameters** tab of a **Trigger Integration** step in Workday Orchestrate to pass a multi-instance reference launch parameter (such as a list of `Supervisory_Organization` WIDs, `Location_ID`s, or `Worker` WIDs) to a child integration, the step can pass design-time validation and unit tests with a single value, then fail at runtime with:

text

```
[StepException] requirement failed: Input lists must be of the same size
```

This error is thrown by the Orchestrate expression runtime inside `InstanceRef.createReferenceList` when you select the two-list overload (`idTypes: StringList, values: StringList`) or four-list overload (`idTypes: StringList, values: StringList, parentIDs: StringList, parentTypes: StringList`) and pass lists of unequal length.

## How the three `InstanceRef.createReferenceList` overloads differ

Workday’s **Reference: InstanceRef Global Functions** defines three overloads for `InstanceRef.createReferenceList`, all of which return an `InstanceReferenceList`:

| Overload Signature | When to Use | Length Rule |
| --- | --- | --- |
| `InstanceRef.createReferenceList(idTypes: String, values: StringList)` | Every reference in the list uses the **same** ID type (for example, all `"WID"` or all `"Employee_ID"`). | `idTypes` is a single `String`; `values` can contain `0`, `1`, or `N` items. |
| `InstanceRef.createReferenceList(idTypes: StringList, values: StringList)` | Different elements in the list have **different** ID types, paired index-by-index (`idTypes[i]` with `values[i]`). | `idTypes.size()` **must equal** `values.size()`. |
| `InstanceRef.createReferenceList(idTypes: StringList, values: StringList, parentIDs: StringList, parentTypes: StringList)` | Each reference also requires a parent ID and parent type, zipped across all four lists at index `i`. | All four `StringList` arguments **must have the exact same size**. |

### Why unit tests with 1 record hide the bug

Developers frequently select the `createReferenceList(idTypes: StringList, values: StringList)` overload in Expression Builder and construct `idTypes` as a single-element list while binding `values` to a dynamic `StringList` coming from a loop aggregation, WQL query, or parent launch parameter:

javascript

```
// BROKEN WHEN values HAS MORE THAN 1 ELEMENT:
InstanceRef.createReferenceList(
  list.stringList("WID"),
  data.CollectWorkersLoop.WorkerWidList
)
```

When you test the orchestration with a single worker (`WorkerWidList` has length `1`), both `list.stringList("WID")` and `values` have size `1`. The internal requirement check (`1 == 1`) succeeds by coincidence:

text

```
idTypes = ["WID"]         // size = 1
values  = ["3aa5550b..."] // size = 1
-> 1 InstanceReference created, step succeeds
```

As soon as the orchestration runs against real data that yields two or more IDs (or zero IDs), the lengths diverge:

text

```
idTypes = ["WID"]                                   // size = 1
values  = ["3aa5550b...", "7bb8881c...", "9cc1112d"] // size = 3
-> require(1 == 3) fails -> "[StepException] requirement failed: Input lists must be of the same size"
```

Because list lengths depend on runtime data rather than static types, Orchestration Builder’s **Validate** button cannot catch this mismatch at design time.

## How to fix the expression

### Fix 1: Pass a single `String` for `idTypes` (Recommended)

In almost every **Trigger Integration** launch parameter, all IDs in a multi-instance launch parameter share the same reference ID type (such as `"WID"`, `"Organization_Reference_ID"`, or `"Location_ID"`). Switch from the `StringList` overload to the `String` overload for the first argument:

javascript

```
// CORRECT: First argument is a single String, second argument is a StringList of any length
InstanceRef.createReferenceList(
  "WID",
  data.CollectWorkersLoop.WorkerWidList
)
```

With a `String` as the first argument, Orchestrate automatically applies `"WID"` to every element in `WorkerWidList` regardless of whether the list contains 1 item or 500 items.

### Fix 2: Passing through an existing multi-instance launch parameter from the parent integration

If your parent Integration System orchestration received a multi-instance **Instance Set Reference** launch parameter and simply needs to pass those references straight through to a child integration in **Trigger Integration**, you have two clean options:

1.  Extract the `StringList` of IDs using `lp.referenceDataList` (or `lp.wids`) and pass it to the single-`String` overload of `createReferenceList`:
    
    javascript
    
    ```
    InstanceRef.createReferenceList(
      "WID",
      lp.referenceDataList("Cost_Centers", "WID")
    )
    ```
    
2.  Or, for direct pass-through scenarios documented in **Reference: Lp Global Functions**, use `lp.getInstanceReferenceList("Cost_Centers")`.

### Fix 3: When IDs genuinely have mixed `idTypes`

In the rare case where each value in `values` uses a different ID type (or requires `parentIDs` and `parentTypes`), build both `StringList` outputs inside the **same Loop** using two **String List** aggregations on that loop (`AggregatedIdTypes` and `AggregatedValues`) with identical **Condition** filters. Because every loop iteration appends one item to `AggregatedIdTypes` and one item to `AggregatedValues`, both lists are guaranteed to have the exact same size when passed to `InstanceRef.createReferenceList(data.Loop.AggregatedIdTypes, data.Loop.AggregatedValues)`.

## How to verify the fix in the tenant

1.  Open the **Trigger Integration** step’s **Launch Parameters** tab, inspect every parameter that calls `InstanceRef.createReferenceList`, and verify that the first parameter is a `String` literal (such as `"WID"`) rather than `list.stringList("WID")`.
2.  Deploy the orchestration to your development tenant and launch a test run where the upstream dataset passes **at least two** reference IDs into the **Trigger Integration** step.
3.  Open the parent and child **Integration Events** in the tenant and confirm that the child integration launches without `[StepException] requirement failed: Input lists must be of the same size` and receives all expected reference instances in its launch parameters.

## Sources checked

-   [Reference: InstanceRef Global Functions](https://developer.workday.com/documentation/GUID-b4eb648f-6dbe-4582-a1ee-5c37d4265078)
-   [Reference: Trigger Integration](https://developer.workday.com/documentation/GUID-cb68f51e-56ce-4159-b450-5b5ede1caf59)
-   [Reference: List Global Functions](https://developer.workday.com/documentation/GUID-cf80f571-191c-415c-a34a-ab3da97c1fd5)
-   [Reference: Lp Global Functions](https://developer.workday.com/documentation/GUID-00349403-f028-4e53-9a12-b095a8b3cf14)
-   [Reference: InstanceReferenceList Member Functions](https://developer.workday.com/documentation/GUID-158d33c6-3b2b-429c-9d06-898f991d963d)

## Related guides

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

-   [### Fixing ‘not a simple type launch parameter (Text, Number, Boolean, Date)’ on blank O4I launch parameters Calling lp.stringParam, lp.simpleData, lp.numberParam, or lp.dateParam on an optional launch parameter that was left blank at launch throws ‘Parameter is not a simple type launch parameter (Text, Number, Boolean, Date)’. Check lp.existsAndHasValue(‘ParamName’) first before reading the parameter.](https://kiweely.com/guides/workday-orchestrate-null-launch-parameter-not-simple-type)
-   [### Fixing ‘Fast forwarding to correct position’ and 45-minute timeouts in Orchestrate batchLoop A small RaaS step inside a Batch Loop does not reset the 45-minute process timer and disables pipelining. Passing a paged REST iterator directly into a checkpointing Batch Loop throws ‘Fast forwarding to correct position’. Stage pages in a Loop first, and chunk with Trigger Integration.](https://kiweely.com/guides/workday-orchestrate-batchloop-paginatedget-fast-forwarding-timeout)
-   [### Logging in Workday Orchestrate: Log, Log to File, Add Integration Message and verbose logging The Log step writes to the app logs on the Developer Site, kept 30 days. Add Integration Message writes to the integration event in the tenant. Log to File builds a named CSV log you attach with Store Document. Verbose logging is a time-limited REST switch for troubleshooting.](https://kiweely.com/guides/workday-orchestrate-logging)
-   [### How do I debug a Workday Orchestrate orchestration that shows success but some steps failed? A run can look successful because an unsuccessful HTTP response is not a failure unless a retry policy defines a success range, and an error handler set to Conditional Outputs lets the run carry on. Read the run’s per-process stepsFailed, not the status.](https://kiweely.com/guides/orchestrate-errors)

### More guides on Orchestrate

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

-   [Overcoming ‘Message length should be lesser than 1MB in size’ and ‘Orchestration is too large to be saved’](https://kiweely.com/guides/workday-orchestrate-1mb-message-limit-too-large-to-save)
-   [Handling Silent GraphQL Errors in PMD and Orchestrate When HTTP Status Returns 200 OK](https://kiweely.com/guides/workday-graphql-http-200-silent-mutation-errors)
-   [Avoiding the 25-Second Synchronous Timeout When an Extend Page Calls External LLM APIs Through Orchestrate](https://kiweely.com/guides/workday-extend-async-orchestration-llm-timeout)
-   [Why Log to File Turns XML Closing Tags into <// and How to Write #if Conditions in CreateTextTemplate](https://kiweely.com/guides/workday-orchestrate-xml-double-slash-log-to-file-if-conditions)
-   [Waiting for Import\_Payroll\_Input\_Request Background Processes at Scale in Workday Orchestrate](https://kiweely.com/guides/workday-orchestrate-wait-background-process-import-payroll-input)
-   [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)

### From the blog on Orchestrate

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

-   [Keep in Studio, Move to Orchestrate, or Rebuild as an Extend App? A Practical Triage Matrix](https://kiweely.com/blog/migrating-legacy-workday-studio-integrations-to-orchestrate-decision-matrix)
-   [How Kiweely Vine designs, builds, deploys, tests and monitors a Workday Orchestration for Integration](https://kiweely.com/blog/workday-orchestration-for-integration-with-kiweely)
-   [Why Workday Studio Remains Essential in an Orchestrate World](https://kiweely.com/blog/why-workday-studio-still-matters-with-orchestrate)

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