Task: Time spent in meetings every week

n8n workflow:
{"id":"78","name":"Time spent in meetings every week","nodes":[{"name":"Weekly Trigger","type":"n8n-nodes-base.cron","position":[450,450],"parameters":{"triggerTimes":{"item":[{"hour":18,"mode":"everyWeek","weekday":"5"}]}},"typeVersion":1},{"name":"Start and end of week","type":"n8n-nodes-base.function","position":[650,450],"parameters":{"functionCode":"var curr = new Date;\nvar first = (curr.getDate() - curr.getDay()) +1;\nvar last = first + 4;\n\nvar firstday = new Date(curr.setDate(first));\nvar lastday = new Date(curr.setDate(last));\n\nbeginning_week = new Date(firstday.setHours(0,0,0,0));\nending_week = new Date(lastday.setHours(23,59,59,99));\n\nitems[0].json.from = beginning_week.toISOString();\nitems[0].json.to = ending_week.toISOString();\n\nreturn items;"},"typeVersion":1},{"name":"Meetings this week","type":"n8n-nodes-base.googleCalendar","position":[850,450],"parameters":{"options":{"timeMax":"={{$node[\"Start and end of week\"].json[\"to\"]}}","timeMin":"={{$node[\"Start and end of week\"].json[\"from\"]}}","singleEvents":true},"calendar":"","operation":"getAll","returnAll":true},"credentials":{"googleCalendarOAuth2Api":""},"typeVersion":1},{"name":"Total meeting duration","type":"n8n-nodes-base.function","position":[1050,450],"parameters":{"functionCode":"var new_items = [];\nvar total_meeting_time = 0;\n\nfor (var i=0 ; i<items.length ; i++) {\n  var duration = 0;\n  duration = new Date(items[i].json.end.dateTime).getTime() - new Date(items[i].json.start.dateTime).getTime();\n  total_meeting_time = total_meeting_time + duration;\n}\n\nnew_items.push({json: {total_meeting_time: (total_meeting_time/(1000*60*60)).toFixed(1)}});\n\nreturn new_items;"},"typeVersion":1},{"name":"Send SMS notification","type":"n8n-nodes-base.twilio","position":[1250,450],"parameters":{"to":"","from":"","message":"=Time spent in meetings this week: {{$node[\"Total meeting duration\"].json[\"total_meeting_time\"]}} hours 🤯"},"credentials":{"twilioApi":""},"typeVersion":1}],"active":true,"settings":{},"connections":{"Weekly Trigger":{"main":[[{"node":"Start and end of week","type":"main","index":0}]]},"Meetings this week":{"main":[[{"node":"Total meeting duration","type":"main","index":0}]]},"Start and end of week":{"main":[[{"node":"Meetings this week","type":"main","index":0}]]},"Total meeting duration":{"main":[[{"node":"Send SMS notification","type":"main","index":0}]]}}}