Node Red Flow Http Request

I have a flow designed to change LIFX Scenes based upon the date of the year (ie Halloween, Thanksgiving etc…). The http node works perfectly so long as I do not insert the function and switch nodes ahead of it.

Does anyone have any ideas as to why the http node will not work?

[{"id":"c8971be928290274","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"44234bbabc754f56","type":"inject","z":"c8971be928290274","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":80,"wires":[["672de771d448cd2e"]]},{"id":"672de771d448cd2e","type":"function","z":"c8971be928290274","name":"","func":"let d = new Date();\nif (d.getMonth() == 9) {\n\tmsg.payload = \"Halloween\";\n\treturn msg;\n}\nif (d.getMonth() == 10 && d.getDate() < 28) {\n\tmsg.payload = \"Thanksgiving\";\n\treturn msg;\n}\nif ((d.getMonth() == 11 && d.getDate() < 27) || (d.getMonth() == 10 && d.getDate() >= 28)) {\n\tmsg.payload = \"Christmas\";\n\treturn msg;\n}\nif ((d.getMonth() == 11 && d.getDate() > 26) || (d.getMonth() == 0 && d.getDate() < 2)) {\n msg.payload = \"NewYear\";\n return msg;\n}\nif ((d.getMonth() == 1) && (d.getDate() > 1 && d.getDate() < 15)) {\n msg.payload = \"Valentine\";\n return msg;\n}\n\nif ((d.getMonth() == 2) && (d.getDate() > 25 && d.getMonth() == 1 && d.getDate() >= 28)) {\n msg.payload = \"StPatricks\";\n return msg;\n}\n\nif ((d.getMonth() == 6) && (d.getDate() > 25 && d.getMonth() == 5 && d.getDate() >= 28)) {\n msg.payload = \"July4\";\n return msg;\n}\n\nmsg.payload = \"Nothing\";\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":180,"y":300,"wires":[["2c82c634ea7214c3"]]},{"id":"2c82c634ea7214c3","type":"switch","z":"c8971be928290274","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Halloween","vt":"str"},{"t":"eq","v":"Thanksgiving","vt":"str"},{"t":"eq","v":"NewYear","vt":"str"},{"t":"eq","v":"Valentine","vt":"str"},{"t":"eq","v":"StPatrick","vt":"str"},{"t":"eq","v":"July4","vt":"str"},{"t":"eq","v":"Christmas","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":8,"x":350,"y":320,"wires":[["e566972a913733af"],["01b3f58c67361f8c"],["1afd9a2205e0ba1c"],["778144ac1cfe16ca"],["4f7d27d1b803eed8"],["32065045da61cbe7"],["55a29d9553080bc4"],["cd54bf9f71890350"]]},{"id":"4f7d27d1b803eed8","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:51f316de-239c-4cbb-bd73-4a489743a758/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":320,"wires":[[]]},{"id":"1afd9a2205e0ba1c","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:5355b93f-a7aa-4c2b-a730-60d5f361c1ff/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":240,"wires":[[]]},{"id":"e566972a913733af","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:62a5d2e7-cdbb-4f61-b236-7a178c50e94a/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":160,"wires":[[]]},{"id":"778144ac1cfe16ca","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:abdf85a7-9968-4674-bb88-c2c350600b99/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":280,"wires":[[]]},{"id":"32065045da61cbe7","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:b0b618e9-0ce6-4095-a75d-21aa2370cf6c/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":360,"wires":[[]]},{"id":"01b3f58c67361f8c","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:e3aafe60-c8eb-45ce-9e84-159856f9ff2c/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":200,"wires":[[]]},{"id":"55a29d9553080bc4","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:b7862e1d-62e1-492c-9cba-95996ffe60f2/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":400,"wires":[[]]},{"id":"cd54bf9f71890350","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:7f9e0ce0-1f7a-4527-86a6-2c20a0e86bea/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":440,"wires":[[]]}]

Hey, try this =)

[{"id":"764aca9459b07c4e","type":"function","z":"c8971be928290274","name":"function 9","func":"const d = new Date();\n//const d = new Date(2022,3,17); // easter 2022\nvar day = d.getDay(); // 0-6\nvar year = d.getFullYear();\nvar date =d.getDate(); //1-31\nvar month = d.getMonth() + 1;\nmsg.payload = 0;\n\nfunction Easter(Y) {\n var C = Math.floor(Y/100);\n var N = Y - 19*Math.floor(Y/19);\n var K = Math.floor((C - 17)/25);\n var I = C - Math.floor(C/4) - Math.floor((C - K)/3) + 19*N + 15;\n I = I - 30*Math.floor((I/30));\n I = I - Math.floor(I/28)*(1 - Math.floor(I/28)*Math.floor(29/(I + 1))*Math.floor((21 - N)/11));\n var J = Y + Math.floor(Y/4) + I + 2 - C + Math.floor(C/4);\n J = J - 7*Math.floor(J/7);\n var L = I - J;\n var M = 3 + Math.floor((L + 40)/44);\n var D = L + 28 - 31*Math.floor(M/4);\n \n return D\n}\n\nswitch (month) {\n case 2: // Valentine's Day\n if (date >= 7 && date <= 14) {\n msg = { payload: 1,output:1,select:1 };\n }\n break;\n case 3: // St. Patrick's Day\n if (date >= 15 && date <= 17) {\n msg = { payload: 1,output:2,select:1 };\n }\n break;\n case 4: // Easter\n var E = Easter(year);\n if (date >= E - 2 && date <= E) {\n msg = { payload: 1,output:Easter,select:1 };\n }\n break;\n case 5: // Memorial Day\n if (date >= 23 && date <= 25) {\n msg = { payload: 1,output:4,select:1 };\n }\n break;\n case 7: // 4th of July\n if (date >= 1 && date <= 4) {\n msg = { payload: 1,output:July4,select:1 };\n }\n break;\n case 10: // Halloween\n if (date >= 1 && date <= 31) {\n msg = { payload: 1,output:Halloween,select:1 };\n }\n break;\n case 11: // Thanksgiving\n if (date >= 15 && date <= 17) {\n msg = { payload: 1,output:Thanksgiving,select:1 };\n }\n break;\n case 12: // Christmas\n if (date >= 1 && date <= 31) {\n msg = { payload: 1,output:Christmas,select:1 };\n }\n break;\n default:\n msg = { payload: 0,output:Nothing,select:1 };\n}\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":1060,"wires":[["e5feb6f7859a3601"]]},{"id":"76efc91c4f2510bd","type":"inject","z":"c8971be928290274","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":1060,"wires":[["764aca9459b07c4e"]]},{"id":"e5feb6f7859a3601","type":"switch","z":"c8971be928290274","name":"","property":"output","propertyType":"msg","rules":[{"t":"eq","v":"Halloween","vt":"str"},{"t":"eq","v":"Thanksgiving","vt":"str"},{"t":"eq","v":"NewYear","vt":"str"},{"t":"eq","v":"Valentine","vt":"str"},{"t":"eq","v":"StPatrick","vt":"str"},{"t":"eq","v":"July4","vt":"str"},{"t":"eq","v":"Christmas","vt":"str"},{"t":"else"},{"t":"eq","v":"Nothing","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":650,"y":1040,"wires":[[],[],[],[],[],[],[],[],[]]}]