{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":16463,"path":"governance-risk-compliance/automate-the-recovery-tasks.md","title":"Automate recovery tasks","bundle":null,"doc_type":null,"release":"australia","body":"\n# Automate recovery tasks\n\nAutomate the manual recovery task within the business continuity plan. You can classify the manual recovery task as an automated task first and then attach an automated flow to it.\n\n## Before you begin\n\nRole required: sn\\_bcm.core\\_manager, sn\\_bcp.plan\\_manager, sn\\_recovery.event\\_manager\n\n## About this task\n\nAdministrators or low-code developers are responsible for building the automation flow. Users with the BCM planner or above role then attach the automation flow to the recovery task. The Workflow Studio is used for this purpose, requiring a local developer persona due to permission restrictions. The Workflow Studio role does not require any extra licensing. However, it requires some special roles. For more information on the Workflow Studio roles and permissions, see [User access to Workflow Studio flows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/user-access-flow-designer.md).\n\nThe flow setup involves these steps:\n\n1.  User defines the permissions to verify the appropriate access and control and creates a subflow to handle the automation process.\n2.  User then defines the inputs to provide necessary information for the automation flow.\n3.  The automation process includes actions to automate the manual task and update its completion status.\n\nAutomated tasks are executed sequentially until a manual task is encountered. If an automated task fails, manual intervention is required to trigger it again. In case of a failure in the automation process, you can retrigger it and verify its completion. If a task fails, the backup assignee is notified via email and must perform the necessary manual actions to address the failure. This confirms that the recovery process continues smoothly even in the event of automation issues.\n\n## Procedure\n\n1.  Navigate to **Workspaces** &gt; **Business Continuity Workspace** and select a plan record.\n\n2.  On the **Recovery tasks** tab, select a manual recovery task that you want to automate.\n\n    You can automate a manual recovery task in the business continuity plan.\n\n3.  Open Workflow Studio and select **Create new subflow**.\n\n4.  On the form, fill in the fields.\n\n    For more information on creating a customized subflow for automating the tasks in the BCM application, see [Create a subflow form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/governance-risk-compliance/create-new-subflow-for-bcm.md).\n\n    For more information on creating a subflow, see [Create a subflow in Workflow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/create-subflow.md).\n\n    The properties for the subflow are filled in.\n\n5.  Select **Submit**.\n\n    The subflow is designed to automate the task. Within the Actions section of the subflow, the **Action**, **Flow Logic**, and **Subflow** tabs are displayed.\n\n6.  Create the subflow inputs to specify the data available to the subflow when it starts running.\n\n    To reference the record linked to the task, specify the input name and type in the Inputs &amp; Outputs section of the subflow. By defining the inputs, you can create a reference to the task responsible for executing the automation.\n\n    \\[Omitted image \"automated-tasks-input.png\"\\] Alt text: Reference to the task.\n\n    1.  Select the label for the input in the **Label** field.\n\n        Within the subflow, there is a special variable known as the Current variable. When the Current variable is chosen in the Inputs section, it is automatically substituted with the task that triggered the automation. This allows for dynamic referencing and processing of the specific task within the subflow.\n\n    2.  Select the name for the input in the **Name** field.\n\n        The Name field is where you must define the variable name to be **current** \\(all lower case\\). The Type must always be **Document ID.Event task**.\n\n    3.  Select the type for the input in the **Type** field.\n\n        For example, you can select **Document ID.Event task** as the type of the input.\n\n    4.  To mark the input as mandatory, select the **Mandatory** option.\n\n        For information on creating subflow inputs and outputs, see [Create a subflow in Workflow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/create-subflow.md).\n\n    5.  Select **+** to add a new input.\n\n    Once you create the flow variables, you can access them on Workflow Studio. For information on creating subflow inputs and outputs, see [Create a subflow in Workflow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/create-subflow.md).\n\n7.  In the Actions section, select **Send Email**.\n\n    Expanding the Send Email section displays the fields as shown in the example. The fields on the form are described in the table. \\[Omitted image \"automated-tasks-revised-subflow.png\"\\] Alt text: Revised subflow.\n\n<table id=\"table_fxr_ghx_hbc\"><thead><tr><th>\n\n \n\n</th><th>\n\n \n\n</th></tr></thead><tbody><tr><td>\n\nAction\n\n</td><td>\n\nName of the action for the subflow.Default: **Send Email**\n\n</td></tr><tr><td>\n\nTarget Record\n\n</td><td>\n\nAssociated task record that is used for the subflow.\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\nName of the table where the task resides. For example, event task \\[sn\\_recovery\\_event\\_task\\].\n\n</td></tr><tr><td>\n\nInclude Watermark\n\n</td><td>\n\nOption to add a watermark in the file that is associated with the task.\n\n</td></tr><tr><td>\n\nTo\n\n</td><td>\n\nEmail addresses of the recipients that should be addressed directly.\n\n</td></tr><tr><td>\n\nCC\n\n</td><td>\n\nEmail addresses of the copied recipients. They can view the list of the recipients that are directly addressed in the email.\n\n</td></tr><tr><td>\n\nBCC\n\n</td><td>\n\nEmail addresses of the copied recipients whose names are not displayed in the email.\n\n</td></tr><tr><td>\n\nSubject\n\n</td><td>\n\nSubject of the email that describes the issue and reason for sending the email.\n\n</td></tr><tr><td>\n\nBody\n\n</td><td>\n\nDescription and action steps about the issue.\n\n</td></tr></tbody>\n</table>8.  Select **Done**.\n\n    Once the automation is triggered, the task is considered complete. In this particular scenario, the email is automatically sent to the user that has been selected.\n\n9.  Select **Update record** in the Actions section of the subflow.\n\n    You can update the original plan task to be completed by updating the record section of the subflow. \\[Omitted image \"automated-tasks-update-record.png\"\\] Alt text: Update the record.\n\n    1.  In the **Action** field, select **Update record**.\n\n    2.  In the **Record** field, select **Current**.\n\n    3.  In the **State** field, select **closed complete**.\n\n    4.  Select **Done**.\n\n        The state of the record moves to **Completed**.\n\n10. To publish the workflow, select **Publish**.\n\n    The changes are applied to all instances where the subflow is used. Similarly, you can define new flows in the subflow that can be run as an automation.\n\n11. Navigate to the **Recovery tasks** tab in the plan with the sn\\_bcm.program\\_manager role and open the manual recovery task that was being edited.\n\n    The recovery task form is displayed.\n\n    \\[Omitted image \"automated-tasks-automated-flow.png\"\\] Alt text: Tasks in the Automated flow field.\n\n12. In the **Task classification** field, select **Automated** to change the manual task to an automated task and select **Save**.\n\n    After saving the form, the flow variables are displayed.\n\n    When you select and save the task, the variables associated with the automated flow are displayed in the **Variables** field of the recovery task.\\[Omitted image \"automated-tasks-variable.png\"\\] Alt text: Variables for the automated flow.\n\n13. In the Assignment details, confirm that the **Backup assignee** field is filled in.\n\n    When converting a manual task to an automated task, the **Backup assignee** field is displayed on the form. In the event of an error causing the automation flow to fail, an email notification is sent to the backup assignee. This email informs them about the failure of the automated flow and the need for manual intervention to resolve the task. The backup assignee can then take the necessary action to complete the task and confirm its resolution.\n\n14. Select **Save**.\n\n    The Recovery task form now includes a Task classification column where the automated tasks are displayed. These automated tasks are executed automatically by the system as part of the plan.\n\n\n-   **[Create a subflow form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/governance-risk-compliance/create-new-subflow-for-bcm.md)**  \nUse the Create a subflow form to automate a manual recovery task within the business continuity plan.\n\n**Parent Topic:**[Structured workflows for BCPs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/governance-risk-compliance/bcp-tasks-performed-by-bcp-owner.md)\n\n"}}