Array Tools

Filter, sort, and manipulate arrays in your workflow data.

Overview

The Array Tools connector is a built-in utility that operates on arrays passed between workflow steps. It bundles the kind of list operations every workflow eventually needs - filter, sort, dedupe, group, set arithmetic - into named tools so you don't have to drop into a Code Runner node for them.

Use it as glue between connectors: pull a list of orders from Shopify, filter by status, pluck the customer IDs, take the unique set, and feed that into the next step. Array Tools keeps the canvas readable and lets the AI agent reason about list operations as named primitives.

What You Can Do

The Array Tools connector exposes these tools:

  • filter - Keep only items matching a condition.
  • find - Return the first item matching a condition.
  • first - Return the first N items.
  • last - Return the last N items.
  • slice - Take a slice of an array by index range.
  • sort - Sort an array, optionally by a field.
  • reverse - Reverse the order of an array.
  • shuffle - Randomize the order of an array.
  • unique - Remove duplicate values (or duplicates by a field).
  • chunk - Split an array into fixed-size sub-arrays.
  • flatten - Flatten a nested array by one level (or all levels).
  • group-by - Group items into buckets keyed by a field.
  • pluck - Extract a single field from each item.
  • compact - Remove null, undefined, and empty values.
  • length - Return the number of items.
  • join - Concatenate items into a string with a separator.
  • union - Combine arrays, keeping unique values.
  • intersection - Return items present in all given arrays.
  • difference - Return items present in the first array but not the others.

Authentication and Setup

No connection or authentication is required. These tools are built into the platform and available in every workflow by default - just drop a Connector node onto the canvas and pick the tool you need.

Using in a Workflow

Add a Connector node, select Array Tools, and pick a mode:

  • Direct Mode - Best for deterministic transforms. Name the tool (filter, group-by, unique) and pass the array plus parameters.
  • Agent Mode - Useful when the agent is composing a multi-step transform over a list and you want it to pick the right primitive.

Chain Array Tools calls together rather than reaching for a Code Runner node - it keeps the workflow auditable and lets the canvas reflect what's happening at each step.

Tips

  • Use pluck before AI steps. Passing 500 full order objects to an LLM is expensive; pluck just the customer IDs and pass that instead.
  • Combine group-by and Loop nodes to fan out by category, region, or vendor - one branch per group.
  • Use chunk to respect rate limits. Chunk a 10,000-record array into batches of 100 before looping API calls.
  • Use difference for sync diffs. Compare incoming IDs with already-synced IDs to find just the new ones.
  • Sort and pick. sort by a numeric field then first 10 is the easy "top N" recipe.

Common Pitfalls

  • Sort is by string by default. Numeric strings ("10", "9") sort lexicographically unless you specify a numeric sort.
  • Unique compares by value. Two objects with the same fields aren't equal by reference; use unique with a field selector to dedupe by ID.
  • Flatten depth. Default flatten goes one level. Pass a depth to fully flatten deeply nested arrays.
  • Empty inputs. Calling first on an empty array returns nothing - downstream nodes need to handle the empty case.
  • Mutation vs return. Every tool returns a new array; the original variable is unchanged. Bind the result to a new variable.

Common Use Cases

Related Articles

For technical API details and field specifications, see the Array Tools documentation.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.