CW Automate is a powerful tool and can do just about anything if you want it to. Here are several ways to automate reboots so that agents don't sit out there for weeks and months pending reboots.
I have written several post about automated reboots, here is one that provides some scripts and searches.
viewtopic.php?p=8972&hilit=reboot#p8972
There is also a built-in search called "Reboot Pending" which you can use to forces reboots when needed.

- Screenshot 2025-03-04 092812.png (110.18 KiB) Viewed 1237 times
Let me explain further how to do this:
Using the search above you can create a process that reboots all agents reporting a reboot needed or you can make a copy of the Reboot Pending script and add extra tests to the search. Things like "OS Like Linux" or maybe only workstations excluding any servers. One of the tests I can't believe they did add to the original search, a test for "is agent currently online"
Why reboot an offline agent? So here is one of my modified searches.

- Screenshot 2025-03-04 093854.png (9.18 KiB) Viewed 1237 times
You should make your searches repersent who and what should qualify them.
Make yourself a GROUP and assign the Search you created.
Now, lets create a group that will manage the agents that show pending reboots. In this new group we will assign our modified search and limit the group to the search. This is very important to get right. The reason we limit the group to the search is because the primary test of the search is that the agent must be pending a reboot. Once we reboot that agent, it will no longer be pending a reboot and so it should leave the group once its been rebooted. This prevents it from being rebooted over and over again as the group processes it's members.

- Screenshot 2025-03-04 094218.png (26.54 KiB) Viewed 1237 times
We will need a reboot script that we can also modify to fit our needs. In my case a one liner is simple enough but you can add all sorts of things to this script that you can do as part of reboot. Options are endless.

- Screenshot 2025-03-04 095133.png (18.65 KiB) Viewed 1237 times
Next, we add our script to our group and set the script schedule for every 2 hours. Why 2 hours? In my case, I want a machine that joins the group to be rebooted with in two hours and when agent returns from reboot, it is still joined to this group. We need to allow time for Automate to scan agent and clear the Pending Reboot flag, and then time to allow group to disjoin the agent as it no longer is in the search. This can take an hour with Automate so two hours seems to work well. You how-ever may only want to reboot agents after 11 pm in which your schedule would be set to daily and to run at 11:15 PM. Since script only runs once a day, your agent has plently of time to leave group after it returns from reboot.

- Screenshot 2025-03-04 095602.png (41.92 KiB) Viewed 1237 times