pushToArray requires preexisting arrays

The pushToArray task now requires arrays to exist before use. Previously, the task created arrays automatically.

What changed: If you use pushToArray with a non-existent array, the task fails and the workflow follows the error path.

Who is affected: Platform 6 users with workflows from Platform 2023.2 or earlier that use pushToArray without creating the array first.

What happens now

Error message

When pushToArray cannot find the array variable, you will see:

Cannot destructure property '<location>' of '<_0x8ba882>' as it is undefined.

The task enters an error state and the workflow follows the error transition.

Successful execution

When you create the array first, the task completes successfully.

Fix your workflows

Find affected workflows

Identify workflows that use pushToArray without creating the array first. The most likely candidates are:

  • Workflows created before Platform 6 (2019.1, 2020.2, 2022.1, 2023.1, 2023.2)
  • Workflows using pushToArray in forEach loops
  • Workflows with conditional array creation

Create your arrays first

Add a newVariable task before any pushToArray task. Add it at the start of your workflow, before the forEach loop if using pushToArray inside a loop, or anywhere before the first pushToArray task.

1

Open your workflow

In Studio, open your workflow.

2

Add a newVariable task

From the task palette, select WorkflowEngine > newVariable. Drag the task onto your canvas before pushToArray.

3

Configure the task

Open the task and configure:

  • variableName — Enter your array name (for example, results)
  • variableValue — Enter [] (empty array)
4

Save and connect

Save and connect the task to your workflow.

See Workflow best practices for more details on defining job variables.

Update error handling

If your workflows relied on the old behavior (success path even without an existing array), add error handling:

pushToArray
├─→ [success] Continue normally
└─→ [error] Handle missing array

Test before deploying

  1. Test all workflows with pushToArray in non-production.
  2. Verify arrays are created correctly.
  3. Confirm error paths work as expected.

Additional context

Impact of the change

This change particularly affects:

  • Long-lived workflows migrated through multiple platform versions
  • Dynamic workflows that create arrays conditionally
  • Error handling patterns using pushToArray in loops

UI behavior note

Both Platform 2022.1 and Platform 6 show a red asterisk (*) next to the array field. However:

  • 2022.1 — Visual indicator only. The task still works without creating the array first.
  • Platform 6 — Enforced requirement. The task fails if the array does not exist.