Sure there is , did you forget to add it to the msg object
e.g
[{"id":"acb2384ee87c80c1","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"from\":\"2023-01-01T00:00:00.000+01:00\",\"cost\":107.9644096335,\"unitPrice\":0.21972,\"consumption\":491.372},{\"from\":\"2023-02-01T00:00:00.000+01:00\",\"cost\":37.1151410147,\"unitPrice\":0.220789,\"consumption\":168.102},{\"from\":\"2023-03-01T00:00:00.000+01:00\",\"cost\":9.2954857464,\"unitPrice\":0.228925,\"consumption\":40.605},{\"from\":\"2023-04-01T00:00:00.000+02:00\",\"cost\":1.2290573232,\"unitPrice\":0.24194,\"consumption\":5.08},{\"from\":\"2023-05-01T00:00:00.000+02:00\",\"cost\":0.8601506949,\"unitPrice\":0.229312,\"consumption\":3.751},{\"from\":\"2023-06-01T00:00:00.000+02:00\",\"cost\":0.598018673,\"unitPrice\":0.228688,\"consumption\":2.615},{\"from\":\"2023-07-01T00:00:00.000+02:00\",\"cost\":-9.5399015481,\"unitPrice\":-0.273907,\"consumption\":34.829},{\"from\":\"2023-08-01T00:00:00.000+02:00\",\"cost\":1.428502299,\"unitPrice\":0.22765,\"consumption\":6.275},{\"from\":\"2023-09-01T00:00:00.000+02:00\",\"cost\":1.1379060721,\"unitPrice\":0.208675,\"consumption\":5.453},{\"from\":\"2023-10-01T00:00:00.000+02:00\",\"cost\":3.0323304039,\"unitPrice\":0.214193,\"consumption\":14.157},{\"from\":\"2023-11-01T00:00:00.000+01:00\",\"cost\":54.8661958705,\"unitPrice\":0.200132,\"consumption\":274.15}]","payloadType":"json","x":90,"y":2760,"wires":[["63288222d43f6855"]]},{"id":"63288222d43f6855","type":"function","z":"d1395164b4eec73e","name":"function 149","func":"let Kosten = msg.payload.reduce((acc,obj)=> acc += obj.cost, 0)\nmsg.payload = Kosten\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":2820,"wires":[["ee0c6359eb5ba6e4"]]},{"id":"ee0c6359eb5ba6e4","type":"debug","z":"d1395164b4eec73e","name":"debug 2462","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":450,"y":2760,"wires":[]}]
output in payload
207.98729618310003