If the Workload Automation AE scheduler marks agent offline because of a connection failure it will come back automatically. When agent is available or if the agent restarts, scheduler will be notified by agent.
It is normal for agents to come back online automatically in certain situations as aforesaid.
However, when issuing MACH_OFFLINE event to get the agent offline, the agent will never come back unless you send a MACH_ONLINE event.
To change the machine status from offline to online please use below sendevent command:
sendevent -E MACH_ONLINE -N <machine_name> (hostname of your machine)