MSSQL Always On Availability Group Cluster Patching

Use Tasks 190 and 191 to perform controlled failover and failback of a SQL Server Always On Availability Group during planned maintenance, ensuring data integrity and minimal application downtime.

This is the reference documentation for two MSSQL Always On Availability Group Cluster Patching tasks.
Task 190 - SQL Server Always On Availability Group Failover
Performs a controlled failover of a SQL Server Always On Availability Group from the current primary replica to a healthy synchronous secondary replica. Before initiating the failover, the task validates that the target replica is connected, synchronized, healthy, and eligible to assume the primary role. This enables planned maintenance activities, such as operating system or SQL Server patching, to be performed on the original primary node while minimizing application downtime and ensuring no data loss.
Task 191 - SQL Server Always On Availability Group Failback
Performs a controlled failback of a SQL Server Always On Availability Group to the original primary replica after maintenance has been completed. The task verifies that the original primary replica has rejoined the Availability Group, is synchronized, connected, healthy, and ready to become the primary replica before executing the failback. This restores the Availability Group to its normal operating configuration following planned maintenance.

How to use the tasks for execution in Automation Plans?

Figure 1. How to use the tasks for execution

Parameters tab showing the Availability Group name field required before executing a failover or failback task
Fill-up the Parameters tab with exact Availability Group Name (for example, the lab name AGName is used here. The Take Action OK button will not proceed until a valid AG name is specified. This is a safety requirement for the failover and failback tasks.

How to use the tasks for setup?

Figure 2. How to use task for setups

Setup view showing gathered site content with Availability Group computers listed and the AG name input field
After the site content is gathered, the task uses relevance to pull the applicable Availability Group computers. The user can then enter the Availability Group name as shown in the image.