Edit - I think you already solved it...
According to stackoverflow, the number of weeks since Jan 1 1970 is given by
const weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)
So this function will alternate between 0 and 1 every week:
const weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)
msg.payload = Number(weekno) % 2 // Not sure if Number() is needed
return msg;
So use your weekly cron and only run the downstream code if the function returns 0
demo flow:
[{"id":"937524d4abdadb79","type":"function","z":"5d7e1a0f2e73e424","name":"First week 8th June 07:00","func":"let timestamp = new Date(\"2024-06-08 07:00:00\").getTime()\nconst weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)\nmsg.payload = Number(weekno) % 2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":40,"wires":[["96cdb55923eb10f9"]]},{"id":"96cdb55923eb10f9","type":"debug","z":"5d7e1a0f2e73e424","name":"0 or 1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":40,"wires":[]},{"id":"09b6e8013f76f0e5","type":"inject","z":"5d7e1a0f2e73e424","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"go","payloadType":"str","x":100,"y":40,"wires":[["937524d4abdadb79","ce38be64eda29a71","44c7b0eae01b689b","cc1a6bf62abb3035","20f3c1f767942e77"]]},{"id":"ce38be64eda29a71","type":"function","z":"5d7e1a0f2e73e424","name":"Second week 15th June 07:00","func":"let timestamp = new Date(\"2024-06-15 07:00:00\").getTime()\nconst weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)\nmsg.payload = weekno % 2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":100,"wires":[["c375d43fa73f977d"]]},{"id":"44c7b0eae01b689b","type":"function","z":"5d7e1a0f2e73e424","name":"Third week 22nd June 07:00","func":"let timestamp = new Date(\"2024-06-22 07:00:00\").getTime()\nconst weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)\nmsg.payload = weekno % 2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":160,"wires":[["0ace5d59302d94f8"]]},{"id":"cc1a6bf62abb3035","type":"function","z":"5d7e1a0f2e73e424","name":"Fourth week 29th June 07:00","func":"let timestamp = new Date(\"2024-06-29 07:00:00\").getTime()\nconst weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)\nmsg.payload = weekno % 2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":220,"wires":[["48a47ed504696bcc"]]},{"id":"20f3c1f767942e77","type":"function","z":"5d7e1a0f2e73e424","name":"Fifth week 6th July 07:00","func":"let timestamp = new Date(\"2024-07-06 07:00:00\").getTime()\nconst weekno = Math.floor((timestamp + 345_600_000) / 604_800_000)\nmsg.payload = weekno % 2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":280,"wires":[["d967aa29bbfd863b"]]},{"id":"c375d43fa73f977d","type":"debug","z":"5d7e1a0f2e73e424","name":"0 or 1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":100,"wires":[]},{"id":"0ace5d59302d94f8","type":"debug","z":"5d7e1a0f2e73e424","name":"0 or 1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":160,"wires":[]},{"id":"48a47ed504696bcc","type":"debug","z":"5d7e1a0f2e73e424","name":"0 or 1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":220,"wires":[]},{"id":"d967aa29bbfd863b","type":"debug","z":"5d7e1a0f2e73e424","name":"0 or 1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":280,"wires":[]}]