Workflow Array Functions in Sparkforge (Premium Action)
Array Functions are a premium workflow action that lets you operate on lists of data (Shopify line items, webhook payloads, etc.) directly inside Sparkforge. Five function types: Find, Find by Index, Filter, Line Items, and Math. A small fee applies per run.
Array Functions let workflows process lists of data — order line items, webhook responses, custom payloads — without exporting to a third-party tool. They're a premium action and incur a small fee each time they run.
What an Array Function does
Many triggers return arrays: Shopify orders return line items, inbound webhooks may return collections of records, custom webhooks return whatever the source API gives you. Array Functions extract, filter, transform, or calculate against that data inside the workflow.
Setup
- Open Automation and create or select a workflow.
- Click Add Action and pick Array Function under Premium Actions.
- Choose a function type: Find, Filter, Find by Index, Line Items, or Math.
- Configure the input array, keys, values, or filter criteria.
- Save and run a test.
- Reference the output variable in later actions.
Function types
Find
Locates the first object in an array that matches a key/value pair. Example: check whether product id zGhad23wfadfa exists in a Shopify order's line items.
- Action type: Find.
- Source: Shopify > Line Items.
- Pick the Key (e.g.,
id) and enter the matching Value.
Returns one object — the first match.
Find by Index
Returns one item by array position. Arrays are zero-indexed: (0) Apple, (1) Banana, (2) Cherry — index 2 returns Cherry.
Filter
Returns every object that matches the filter, not just the first. Use it to grab all objects with color = blue, all items in category = home, or all orders for a specific contact via {{user.name}}.
Line Items
Rebuilds an array into a different shape so it fits a target action — a custom webhook, a Google Sheets row, or the Email Builder shopping cart structure. You define the new key/value pairs.
Math
Runs numeric operations across the array:
- Sum — add all values.
- Min — smallest value.
- Max — largest value.
- Average — mean.
- Count — total number of values.
Common use: sum line item prices to calculate total order revenue.
Frequently Asked Questions
What kinds of data can Array Functions handle?
Are Array Functions a premium feature?
Can Array Functions process nested arrays?
Can I chain multiple Array Functions in one workflow?
How do I debug an Array Function?
Was this article helpful?
Thanks for the feedback.