{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":30359,"path":"it-operations-management/event-management/create-custom-create-incident-subflow.md","title":"Create a custom subflow for alerts","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a custom subflow for alerts\n\nYou can create a subflow according to your requirements. For example, you can resolve alerts, notify teams, or run remediation actions.\n\n## Before you begin\n\nRole required: evt\\_mgmt\\_admin, flow\\_designer\n\n## About this task\n\nCopy an existing subflow, and then customize it. Publish the custom subflow so that it is available to be used to resolve any alert. For more information, see [Create a subflow](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/create-subflow.md).\n\n**Note:** If your ServiceNow instance uses domain separation, you must ensure that the new custom subflow that you created operates only on the data of the designated domain.\n\nTo automate alert responses with an easier interface, you can also create a respond automation in Service Operations Workspace. For more information, see [Create Respond automation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/respond-alert-sow-itom.md).\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Process Automation** &gt; **Flow Designer**.\n\n2.  In the Flow Designer window, click **Subflows**.\n\n3.  Click **Create Incident**.\n\n    The Create Incident subflow opens in Flow Designer in read-only format. The inputs in the Create Incident subflow are described in the following table.\n\n    |Value|Description|\n    |-----|-----------|\n    |alertRuleName|The name of the alert management rule that specifies this subflow, for example `IDD`.|\n    |alertRuleId|The sys\\_id of the alert management rule, for example, `1ae122e84f5f1300b28392918110c71e`.|\n    |alertGR|The alert record that matches the filter that is defined in the alert management rule, for example, `Alert0027931`|\n    |executionId|The ID of the execution to be retrieved, for example, `000182ebdb66630091187f1daf9619d4`|\n    |userName|The current user's name, for example, `admin`.|\n    |userDisplayName|The name that the current user specified to be displayed, for example, `System Administrator`.|\n\n    For example, in an alert management rule that has processed alerts, in the Alert Executions area, click the **Link to execution** of the required alert.\n\n    \\[Omitted image \"link-to-execution.png\"\\] Alt text: Link to execution\n\n    The Flow Designer opens. Click **Subflow Inputs and Outputs**. The input variable names of the subflow are displayed with their respective values.\n\n    \\[Omitted image \"subflow-parameter-values.png\"\\] Alt text: Subflow variable values\n\n4.  In the subflow header, click more actions \\[Omitted image \"more-actions-icon.png\"\\] Alt text: More actions and select **Copy subflow**.\n\n5.  In the **New Subflow Name** field, enter the name of the new subflow.\n\n6.  To limit the application scope of the subflow, in the **Application** field, select the required application, otherwise select `Global`.\n\n7.  Click **Copy**.\n\n    The new subflow is created and is opened as a tab in the subflow designer editor. The inputs provided by the template appear.\n\n    Inputs are fixed and cannot be added to.\n\n    In the editor, you can delete subflow inputs or outputs, as required.\n\n8.  To delete an input, click \\[Omitted image \"delete-input-icon.png\"\\] Alt text: Delete input icon.\n\n    Inputs are fixed and cannot be added to.\n\n9.  Create subflow outputs by defining the names and data types.\n\n    1.  Click \\[Omitted image \"add-input-icon.png\"\\] Alt text: Add new input icon to add output.\n\n    2.  Define the name and the data type.\n\n10. To save the subflow in draft status, click **Save**.\n\n11. To save and publish the subflow so that it can be used in the alert management rule designer, click **Publish**.\n\n\n## Result\n\nInclude the modified subflow in an alert management rule to resolve alerts according to your customized requirements.\n\n**Parent Topic:**[Alert management rules for resolving alerts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/alert-management-rule.md)\n\n**Related topics**  \n\n\n[Subflows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/subflows.md)\n\n"}}