n8n LabAdvanced

Sum Values with reduce() in n8n

Calculate an order total from its line items without adding a Code node.

Live Execution Simulator Idle
πŸ“₯
Incoming Data
βš™οΈ
n8n Node
🎯
Next Step
> Ready. Type your expression below and click "Check Answer" to run the node.

Incoming Payload / Data:

{
  "items": [
    { "name": "Plan", "price": 10 },
    { "name": "Add-on", "price": 25 }
  ]
}
$json.items.reduce((sum, item) => , 0)

βš™οΈ Your expression is executed against test data β€” any correct solution passes. +30 XP

Related labs