Is this a simple array (only numbers) or an array of objects?
For an array of objects, you will need to extract the value before calling .sum. There is a function called .pluck for this.
Take a look at this article and let me k own if this helps.
https://www.workato.com/product-hub/advanced-transformation-formulas-2/